@@ -51,6 +51,14 @@ set(sparse_bw_api_source_file ${CMAKE_SOURCE_DIR}/paddle/phi/api/lib/sparse_bw_a
5151set (sparse_bw_api_header_file_tmp ${sparse_bw_api_header_file} .tmp)
5252set (sparse_bw_api_source_file_tmp ${sparse_bw_api_source_file} .tmp)
5353
54+ # strings api file 
55+ set (strings_api_gen_file ${CMAKE_SOURCE_DIR} /python/paddle/utils/code_gen/strings_api_gen.py)
56+ set (strings_api_yaml_file ${CMAKE_SOURCE_DIR} /python/paddle/utils/code_gen/strings_api.yaml)
57+ set (strings_api_header_file ${CMAKE_SOURCE_DIR} /paddle/phi/api/include /strings_api.h)
58+ set (strings_api_source_file ${CMAKE_SOURCE_DIR} /paddle/phi/api/lib/strings_api.cc)
59+ set (strings_api_header_file_tmp ${strings_api_header_file} .tmp)
60+ set (strings_api_source_file_tmp ${strings_api_source_file} .tmp)
61+ 
5462# wrapped infermeta file 
5563set (wrapped_infermeta_gen_file ${CMAKE_SOURCE_DIR} /python/paddle/utils/code_gen/wrapped_infermeta_gen.py)
5664set (api_yaml_file ${CMAKE_SOURCE_DIR} /python/paddle/utils/code_gen/api.yaml)
@@ -114,6 +122,19 @@ add_custom_command(
114122 DEPENDS  ${sparse_bw_api_yaml_file}  ${sparse_bw_api_gen_file}  ${api_gen_base}  ${api_gen_file}  ${sparse_api_gen_file}  ${bw_api_gen_file} 
115123 VERBATIM )
116124
125+ # generate strings api 
126+ add_custom_command (
127+  OUTPUT  ${strings_api_header_file}  ${strings_api_source_file} 
128+  COMMAND  ${PYTHON_EXECUTABLE}  ${strings_api_gen_file} 
129+  --api_yaml_path ${strings_api_yaml_file} 
130+  --api_header_path ${strings_api_header_file_tmp} 
131+  --api_source_path ${strings_api_source_file_tmp} 
132+  COMMAND  ${CMAKE_COMMAND}  -E copy_if_different ${strings_api_header_file_tmp}  ${strings_api_header_file} 
133+  COMMAND  ${CMAKE_COMMAND}  -E copy_if_different ${strings_api_source_file_tmp}  ${strings_api_source_file} 
134+  COMMENT  "copy_if_different ${strings_api_header_file}  ${strings_strings_api_source_file} " 
135+  DEPENDS  ${strings_api_yaml_file}  ${strings_api_gen_file}  ${api_gen_base}  ${api_gen_file} 
136+  VERBATIM )
137+ 
117138# generate dygraph(intermediate) api 
118139add_custom_command (
119140 OUTPUT  ${dygraph_api_header_file}  ${dygraph_api_source_file} 
@@ -152,5 +173,5 @@ cc_library(phi_bw_function_api SRCS ${bw_api_source_file} DEPS phi_tensor_raw ph
152173cc_library(sparse_api SRCS ${sparse_api_source_file}  DEPS phi_tensor_raw phi kernel_dispatch api_gen_utils sparse_api_custom_impl)
153174cc_library(sparse_bw_api SRCS ${sparse_bw_api_source_file}  DEPS phi_tensor_raw phi kernel_dispatch api_gen_utils sparse_api sparse_api_custom_impl)
154175cc_library(phi_dygraph_api SRCS ${dygraph_api_source_file}  DEPS phi_tensor_raw phi kernel_dispatch api_gen_utils phi_data_transform phi_function_api sparse_api)
155- 
156- cc_library(phi_tensor SRCS tensor_method.cc DEPS phi_tensor_raw phi_function_api api_gen_utils kernel_dispatch infermeta sparse_api)
176+ cc_library(strings_api SRCS  ${strings_api_source_file}  DEPS phi_tensor_raw phi kernel_dispatch api_gen_utils) 
177+ cc_library(phi_tensor SRCS tensor_method.cc DEPS phi_tensor_raw phi_function_api api_gen_utils kernel_dispatch infermeta sparse_api strings_api )
0 commit comments