mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
Include _native.h for structured_native_functions (#131208)
In gen.py, the code for generating CompositeViewCopyKernels.cpp includes *_native.h headers for "view_groups" but not "structured_native_functions". However, this results in the TORCH_API in the headers being ineffective and presents such functions being used outside libtorch_cpu.so This patch ensures that gen.py includes the native headers for "structured_native_functions" in the same way as for "view_groups". Pull Request resolved: https://github.com/pytorch/pytorch/pull/131208 Approved by: https://github.com/bdhirsh
This commit is contained in:
parent
31da9ee711
commit
7124efa81b
|
|
@ -2664,7 +2664,9 @@ codegen to generate the correct cpp call for this op. Contact AOTInductor team f
|
||||||
]
|
]
|
||||||
+ [
|
+ [
|
||||||
"\n".join(
|
"\n".join(
|
||||||
f"#include <ATen/ops/{f.root_name}_ops.h>"
|
f"#include <ATen/ops/{f.root_name}_ops.h>\n"
|
||||||
|
# NB: this include is also important for correct visibility
|
||||||
|
f"#include <ATen/ops/{f.root_name}_native.h>"
|
||||||
for f in [g.inplace, g.mutable, g.functional]
|
for f in [g.inplace, g.mutable, g.functional]
|
||||||
if f is not None and "generated" not in f.tags
|
if f is not None and "generated" not in f.tags
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user