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)
22
22
set (LITE_WITH_XPU ON )
23
23
include_directories ("${XPU_SDK_ROOT} /XTDK/include" )
24
24
include_directories ("${XPU_SDK_ROOT} /XTCL/include" )
25
- add_definitions (-DPADDLE_WITH_XPU )
25
+ add_definitions (-DLITE_SUBGRAPH_WITH_XPU )
26
26
LINK_DIRECTORIES ("${XPU_SDK_ROOT} /XTDK/shlib/" )
27
27
LINK_DIRECTORIES ("${XPU_SDK_ROOT} /XTDK/runtime/shlib/" )
28
28
endif ()
Original file line number Diff line number Diff line change @@ -375,7 +375,7 @@ void AnalysisConfig::Update() {
375
375
}
376
376
377
377
if (use_xpu_) {
378
- #ifndef PADDLE_WITH_XPU
378
+ #ifndef LITE_SUBGRAPH_WITH_XPU
379
379
PADDLE_THROW (platform::errors::Unavailable (
380
380
" You tried to use an XPU device, but Paddle was not compiled "
381
381
" with XPU-runtime." ));
Original file line number Diff line number Diff line change 4
4
5
5
cc_library (lite_op_teller SRCS op_teller.cc DEPS lite_full_static framework_proto device_context boost xxhash )
6
6
cc_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} )
8
8
cc_test (test_lite_engine SRCS test_engine.cc DEPS lite_engine protobuf framework_proto glog gtest analysis )
9
9
cc_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 16
16
#define LITE_WITH_CUDA 1
17
17
#endif
18
18
19
- #ifdef PADDLE_WITH_XPU
19
+ #ifdef LITE_SUBGRAPH_WITH_XPU
20
20
#define LITE_WITH_XPU 1
21
21
#endif
22
22
@@ -59,7 +59,7 @@ paddle::lite_api::PaddlePredictor* EngineManager::Create(
59
59
cfg.cpu_math_library_num_threads );
60
60
#endif
61
61
62
- #ifdef PADDLE_WITH_XPU
62
+ #ifdef LITE_SUBGRAPH_WITH_XPU
63
63
lite_cxx_config.set_xpu_workspace_l3_size_per_thread (
64
64
cfg.xpu_l3_workspace_size );
65
65
#endif
Original file line number Diff line number Diff line change @@ -444,6 +444,8 @@ void BindAnalysisConfig(py::module *m) {
444
444
.def (" enable_use_gpu" , &AnalysisConfig::EnableUseGpu,
445
445
py::arg (" memory_pool_init_size_mb" ), py::arg (" device_id" ) = 0 )
446
446
.def (" disable_gpu" , &AnalysisConfig::DisableGpu)
447
+ .def (" enable_xpu" , &AnalysisConfig::EnableXpu,
448
+ py::arg (" l3_workspace_size" ))
447
449
.def (" use_gpu" , &AnalysisConfig::use_gpu)
448
450
.def (" gpu_device_id" , &AnalysisConfig::gpu_device_id)
449
451
.def (" memory_pool_init_size_mb" ,
You can’t perform that action at this time.
0 commit comments