Skip to content

Commit

Permalink
update the fuse operation in WITH_XPU and WITH_XPU2
Browse files Browse the repository at this point in the history
  • Loading branch information
Liu-xiandong committed Nov 26, 2021
1 parent 9c0a1dd commit d473766
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,11 @@ if (WITH_XPU2 AND NOT WITH_XPU)
"Enable XPU when compiling with XPU2" FORCE)
endif()

if (WITH_XPU AND NOT WITH_XPU2)
set(WITH_XPU2 OFF CACHE STRING
"Disable XPU2 when compiling with XPU" FORCE)
endif()

#
if (NOT WITH_XPU AND WITH_XPU_BKCL)
MESSAGE(WARNING
Expand Down Expand Up @@ -321,7 +326,7 @@ endif(WITH_ROCM)

if(WITH_XPU2)
include(xpu2)
endif(WITH_ROCM)
endif()

if (NOT WITH_ROCM AND WITH_RCCL)
MESSAGE(WARNING
Expand Down
9 changes: 5 additions & 4 deletions cmake/operators.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -356,17 +356,18 @@ function(op_library TARGET)
file(APPEND ${pybind_file} "USE_OP_DEVICE_KERNEL(${TARGET}, CUDNN);\n")
endif()

if (WITH_XPU AND ${pybind_flag} EQUAL 0 AND ${xpu_cc_srcs_len} GREATER 0 AND ${xpu2_cc_srcs_len} EQUAL 0)
#message(STATUS "lxd_debug: ${TARGET} op in XPU1")
if (WITH_XPU AND ${pybind_flag} EQUAL 0 AND ${xpu_cc_srcs_len} GREATER 0 AND ${xpu2_cc_srcs_len} EQUAL 0)
message(STATUS "lxd_debug: ${TARGET} op in XPU1")
file(APPEND ${pybind_file} "USE_OP_DEVICE_KERNEL(${TARGET}, XPU);\n")
endif()

#message(STATUS "lxd_debug: cmake source dir is: ${CMAKE_SOURCE_DIR}")

if (WITH_XPU2 AND ${xpu2_cc_srcs_len} GREATER 0)
message(STATUS "lxd_debug: ${TARGET} op in XPU2")
file(APPEND ${pybind_file} "USE_OP_DEVICE_KERNEL(${TARGET}, XPU);\n")
endif()



if (WITH_ASCEND_CL AND ${npu_cc_srcs_len} GREATER 0)
file(READ ${ORIGINAL_TARGET}_npu.cc TARGET_NPU_CONTENT)
# It is different from the logic above, becareful
Expand Down

0 comments on commit d473766

Please sign in to comment.