diff --git a/projects/rccl/CMakeLists.txt b/projects/rccl/CMakeLists.txt index 258ebe47de..f21f596e19 100644 --- a/projects/rccl/CMakeLists.txt +++ b/projects/rccl/CMakeLists.txt @@ -63,6 +63,8 @@ list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hcc) find_package(hip REQUIRED) +message(STATUS "HIP compiler: ${HIP_COMPILER}") +message(STATUS "HIP runtime: ${HIP_RUNTIME}") option(BUILD_SHARED_LIBS "Build as a shared library" ON) @@ -130,10 +132,22 @@ if(TRACE) endif() target_link_libraries(rccl - PRIVATE -amdgpu-target=gfx803 - PRIVATE -amdgpu-target=gfx900 - PRIVATE -amdgpu-target=gfx906 - PRIVATE -hc-function-calls) + PRIVATE --amdgpu-target=gfx803 + PRIVATE --amdgpu-target=gfx900 + PRIVATE --amdgpu-target=gfx906) + +if("${HIP_COMPILER}" MATCHES "clang") + target_compile_options(rccl + PRIVATE --amdgpu-target=gfx803 + PRIVATE --amdgpu-target=gfx900 + PRIVATE --amdgpu-target=gfx906 + PRIVATE -fgpu-rdc) + target_link_libraries(rccl PRIVATE -fgpu-rdc) +endif() + +if("${HIP_COMPILER}" MATCHES "hcc") + target_link_libraries(rccl PRIVATE -hc-function-calls) +endif() if(TARGET hip::device) target_link_libraries(rccl PRIVATE hip::device) diff --git a/projects/rccl/src/collectives/device/common.h b/projects/rccl/src/collectives/device/common.h index 2f230c6b4b..9048011aa3 100644 --- a/projects/rccl/src/collectives/device/common.h +++ b/projects/rccl/src/collectives/device/common.h @@ -22,7 +22,7 @@ extern __device__ const ncclKern_t ncclFuncs[]; template struct Caller { static - void call(ncclColl* const c) noexcept + __device__ void call(ncclColl* const c) noexcept { constexpr unsigned short m = f + (l - f) / 2; @@ -33,7 +33,7 @@ struct Caller { template struct Caller{ static - void call(struct ncclColl* const c) noexcept { ncclFuncs[f](&c->args); } + __device__ void call(struct ncclColl* const c) noexcept { ncclFuncs[f](&c->args); } }; inline diff --git a/projects/rccl/src/transport/p2p.cu b/projects/rccl/src/transport/p2p.cu index 301ad3e90d..a616ad5f6d 100644 --- a/projects/rccl/src/transport/p2p.cu +++ b/projects/rccl/src/transport/p2p.cu @@ -12,6 +12,7 @@ #include "param.h" #include #include +#include #include "nvmlwrap.h" #include #if defined(__HIP_PLATFORM_HCC__) || defined(__HCC__)