已合并
[feat] exposed customed api #31388
[feat] exposed customed api #31388
已合并
culechan创建于 3月4日
3 个文件变更+3-1
@@ -23,7 +23,7 @@ ParsedYaml = namedtuple('ParsedYaml', ['native_functions', 'backend_indices'])
23 23 
24 24 
25CUSTOM_FUNCTIONS_DECLARATION = CodeTemplate("""\25CUSTOM_FUNCTIONS_DECLARATION = CodeTemplate("""\
26-${return_type} ${func_name}(${args_str});26+TORCH_NPU_API ${return_type} ${func_name}(${args_str});
27""")27""")
28 28 
29CUSTOM_FUNCTIONS_DEFINITION = CodeTemplate("""\29CUSTOM_FUNCTIONS_DEFINITION = CodeTemplate("""\
@@ -2,6 +2,7 @@
2#define TORCH_NPU_CSRC_ATEN_CUSTOM_FUNCTIONS2#define TORCH_NPU_CSRC_ATEN_CUSTOM_FUNCTIONS
3 3 
4#include <ATen/ATen.h>4#include <ATen/ATen.h>
5+#include "torch_npu/csrc/core/npu/NPUMacros.h"
5 6 
6namespace at_npu {7namespace at_npu {
7namespace native {8namespace native {
@@ -2,6 +2,7 @@
2#define TORCH_NPU_CSRC_ATEN_CUSTOM_REDISPATCH2#define TORCH_NPU_CSRC_ATEN_CUSTOM_REDISPATCH
3 3 
4#include <ATen/ATen.h>4#include <ATen/ATen.h>
5+#include "torch_npu/csrc/core/npu/NPUMacros.h"
5 6 
6namespace at_npu {7namespace at_npu {
7namespace redispatch {8namespace redispatch {