File tree Expand file tree Collapse file tree 5 files changed +7
-5
lines changed
Expand file tree Collapse file tree 5 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ if(XPU_SDK_ROOT)
2222 set (LITE_WITH_XPU ON )
2323 include_directories ("${XPU_SDK_ROOT} /XTDK/include" )
2424 include_directories ("${XPU_SDK_ROOT} /XTCL/include" )
25- add_definitions (-DPADDLE_WITH_XPU )
25+ add_definitions (-DLITE_SUBGRAPH_WITH_XPU )
2626 LINK_DIRECTORIES ("${XPU_SDK_ROOT} /XTDK/shlib/" )
2727 LINK_DIRECTORIES ("${XPU_SDK_ROOT} /XTDK/runtime/shlib/" )
2828endif ()
Original file line number Diff line number Diff line change @@ -375,7 +375,7 @@ void AnalysisConfig::Update() {
375375 }
376376
377377 if (use_xpu_) {
378- #ifndef PADDLE_WITH_XPU
378+ #ifndef LITE_SUBGRAPH_WITH_XPU
379379 PADDLE_THROW (platform::errors::Unavailable (
380380 " You tried to use an XPU device, but Paddle was not compiled "
381381 " with XPU-runtime." ));
Original file line number Diff line number Diff line change 44
55cc_library(lite_op_teller SRCS op_teller.cc DEPS lite_full_static framework_proto device_context boost xxhash)
66cc_library(lite_engine SRCS engine.cc DEPS lite_full_static framework_proto ${XPU_DEPS} )
7- cc_library(lite_tensor_utils SRCS tensor_utils.cc DEPS memcpy lite_full_static framework_proto boost device_context)
7+ cc_library(lite_tensor_utils SRCS tensor_utils.cc DEPS memcpy lite_full_static framework_proto boost device_context ${XPU_DEPS} )
88cc_test(test_lite_engine SRCS test_engine.cc DEPS lite_engine protobuf framework_proto glog gtest analysis)
99cc_test(test_lite_tensor_utils SRCS test_tensor_utils.cc DEPS lite_engine lite_tensor_utils)
Original file line number Diff line number Diff line change 1616#define LITE_WITH_CUDA 1
1717#endif
1818
19- #ifdef PADDLE_WITH_XPU
19+ #ifdef LITE_SUBGRAPH_WITH_XPU
2020#define LITE_WITH_XPU 1
2121#endif
2222
@@ -59,7 +59,7 @@ paddle::lite_api::PaddlePredictor* EngineManager::Create(
5959 cfg.cpu_math_library_num_threads );
6060#endif
6161
62- #ifdef PADDLE_WITH_XPU
62+ #ifdef LITE_SUBGRAPH_WITH_XPU
6363 lite_cxx_config.set_xpu_workspace_l3_size_per_thread (
6464 cfg.xpu_l3_workspace_size );
6565#endif
Original file line number Diff line number Diff line change @@ -444,6 +444,8 @@ void BindAnalysisConfig(py::module *m) {
444444 .def (" enable_use_gpu" , &AnalysisConfig::EnableUseGpu,
445445 py::arg (" memory_pool_init_size_mb" ), py::arg (" device_id" ) = 0 )
446446 .def (" disable_gpu" , &AnalysisConfig::DisableGpu)
447+ .def (" enable_xpu" , &AnalysisConfig::EnableXpu,
448+ py::arg (" l3_workspace_size" ))
447449 .def (" use_gpu" , &AnalysisConfig::use_gpu)
448450 .def (" gpu_device_id" , &AnalysisConfig::gpu_device_id)
449451 .def (" memory_pool_init_size_mb" ,
You can’t perform that action at this time.
0 commit comments