From 55da9344d9dee63bfc2594566afb1a2e282502bc Mon Sep 17 00:00:00 2001 From: Qi Li Date: Mon, 14 Feb 2022 12:40:18 +0800 Subject: [PATCH] [ROCm] fix missing dcu kernel in operator.cmake, test=develop (#39480) --- cmake/operators.cmake | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cmake/operators.cmake b/cmake/operators.cmake index e58dbf77b4..8469dc4c02 100644 --- a/cmake/operators.cmake +++ b/cmake/operators.cmake @@ -335,6 +335,17 @@ function(op_library TARGET) endif() endforeach() + # pybind USE_OP_DEVICE_KERNEL for ROCm + list (APPEND hip_srcs ${hip_cc_srcs}) + # message("hip_srcs ${hip_srcs}") + foreach(hip_src ${hip_srcs}) + set(op_name "") + find_register(${hip_src} "REGISTER_OP_CUDA_KERNEL" op_name) + if(NOT ${op_name} EQUAL "") + file(APPEND ${pybind_file} "USE_OP_DEVICE_KERNEL(${op_name}, CUDA);\n") + set(pybind_flag 1) + endif() + endforeach() # pybind USE_OP_DEVICE_KERNEL for CUDNN/MIOPEN list(APPEND cudnn_cu_srcs ${cudnn_cu_cc_srcs}) -- GitLab