Skip to content

Commit

Permalink
Update op_utils.h
Browse files Browse the repository at this point in the history
  • Loading branch information
Liyulingyue authored Mar 8, 2024
1 parent 23c8b80 commit a2b6fe2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion paddle/phi/core/compat/op_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,21 @@ struct ArgumentMappingFnRegistrar {
__registrar_arg_map_fn_for_##op_type(#op_type, arg_mapping_fn); \
int TouchArgumentMappingFnSymbol_##op_type() { return 0; }

#if(WIN32)
#define PD_DECLARE_ARG_MAPPING_FN(op_type) \
PD_STATIC_ASSERT_GLOBAL_NAMESPACE( \
PD_DECLARE_arg_map_fn_ns_check_##op_type, \
"PD_DECLARE_ARG_MAPPING_FN must be called in global namespace."); \
TEST_API extern int TouchArgumentMappingFnSymbol_##op_type(); \
UNUSED static int __declare_arg_map_fn_symbol_for_##op_type = \
TouchArgumentMappingFnSymbol_##op_type()

#else
#define PD_DECLARE_ARG_MAPPING_FN(op_type) \
PD_STATIC_ASSERT_GLOBAL_NAMESPACE( \
PD_DECLARE_arg_map_fn_ns_check_##op_type, \
"PD_DECLARE_ARG_MAPPING_FN must be called in global namespace."); \
__declspec(dllexport) TEST_API extern int TouchArgumentMappingFnSymbol_##op_type(); \
UNUSED static int __declare_arg_map_fn_symbol_for_##op_type = \
TouchArgumentMappingFnSymbol_##op_type()
#endif
} // namespace phi

0 comments on commit a2b6fe2

Please sign in to comment.