diff --git a/cmake/FindHIP.cmake b/cmake/FindHIP.cmake index bb5eef6f7..99ad26c32 100644 --- a/cmake/FindHIP.cmake +++ b/cmake/FindHIP.cmake @@ -101,18 +101,14 @@ if(UNIX AND NOT APPLE AND NOT CYGWIN) endif() if(HIP_PLATFORM) - if(${HIP_PLATFORM} STREQUAL "hcc" OR ${HIP_PLATFORM} STREQUAL "amd") - if(${HIP_COMPILER} STREQUAL "hcc") - set(HIP_INCLUDE_DIRS "${HIP_ROOT_DIR}/include;${HIP_ROOT_DIR}/hcc/include") - set(HIP_LIBRARIES "${HIP_ROOT_DIR}/lib/libhip_hcc.so") - set(HIP_RUNTIME_DEFINE "__HIP_PLATFORM_HCC__") - elseif(${HIP_COMPILER} STREQUAL "clang") + if(${HIP_PLATFORM} STREQUAL "amd") + if(${HIP_COMPILER} STREQUAL "clang") set(HIP_INCLUDE_DIRS "${HIP_ROOT_DIR}/include") set(HIP_LIBRARIES "${HIP_ROOT_DIR}/lib/libamdhip64.so") - set(HIP_RUNTIME_DEFINE "__HIP_PLATFORM_HCC__") + set(HIP_RUNTIME_DEFINE "__HIP_PLATFORM_AMD__") set(HIP_PLATFORM "hip-clang") endif() - elseif(${HIP_PLATFORM} STREQUAL "nvcc") + elseif(${HIP_PLATFORM} STREQUAL "nvidia") find_package(CUDA) #find the shared library, rather than the static that find_package returns @@ -127,7 +123,7 @@ if(UNIX AND NOT APPLE AND NOT CYGWIN) set(HIP_INCLUDE_DIRS "${HIP_ROOT_DIR}/include;${CUDA_INCLUDE_DIRS}") set(HIP_LIBRARIES "${CUDART_LIB};cuda") - set(HIP_RUNTIME_DEFINE "__HIP_PLATFORM_NVCC__") + set(HIP_RUNTIME_DEFINE "__HIP_PLATFORM_NVIDIA__") endif() endif() mark_as_advanced(HIP_INCLUDE_DIRS) diff --git a/scripts/build/Makefile b/scripts/build/Makefile index e57a620c4..850941610 100644 --- a/scripts/build/Makefile +++ b/scripts/build/Makefile @@ -330,10 +330,10 @@ ifdef OCCA_HIP_ENABLED hipPlatform = $(HIP_PLATFORM) endif - ifeq ($(hipPlatform),nvcc) + ifeq ($(hipPlatform),nvidia) linkerFlags += -lcuda linkerFlags += -lcudart - else ifeq ($(hipPlatform),$(filter $(hipPlatform),hcc amd)) + else ifeq ($(hipPlatform),amd) #set HIP_COMPILER if not supplied by user ifeq (,$(HIP_COMPILER)) hipCompiler = $(shell $(HIP_PATH)/bin/hipconfig --compiler) @@ -341,10 +341,8 @@ ifdef OCCA_HIP_ENABLED hipCompiler = $(HIP_COMPILER) endif - #Select HCC or HIP Runtime - ifeq ($(hipCompiler),hcc) - linkerFlags += -lhip_hcc - else ifeq ($(hipCompiler),clang) + #Select HIP Runtime + ifeq ($(hipCompiler),clang) linkerFlags += -lamdhip64 endif endif @@ -366,10 +364,10 @@ else hipPlatform = $(HIP_PLATFORM) endif - ifeq ($(hipPlatform),nvcc) + ifeq ($(hipPlatform),nvidia) hipLibFlags = $(call libraryFlagsFor,cuda) hipLibFlags += $(call libraryFlagsFor,cudart) - else ifeq ($(hipPlatform),$(filter $(hipPlatform),hcc amd)) + else ifeq ($(hipPlatform),amd) #set HIP_COMPILER if not supplied by user ifeq (,$(HIP_COMPILER)) hipCompiler = $(shell $(HIP_PATH)/bin/hipconfig --compiler) @@ -377,10 +375,8 @@ else hipCompiler = $(HIP_COMPILER) endif - #Select HCC or HIP Runtime - ifeq ($(hipCompiler),hcc) - hipLibFlags = $(call libraryFlagsFor,hip_hcc) - else ifeq ($(hipCompiler),clang) + #Select HIP Runtime + ifeq ($(hipCompiler),clang) hipLibFlags = $(call libraryFlagsFor,amdhip64) endif endif diff --git a/src/occa/internal/modes/hip/device.cpp b/src/occa/internal/modes/hip/device.cpp index 9f75f6848..818d9917f 100644 --- a/src/occa/internal/modes/hip/device.cpp +++ b/src/occa/internal/modes/hip/device.cpp @@ -274,13 +274,13 @@ namespace occa { //---[ Compiling Command ]-------- command << compiler << " --genco" -#if defined(__HIP_PLATFORM_NVCC___) || (HIP_VERSION >= 305) +#if defined(__HIP_PLATFORM_NVIDIA__) || (HIP_VERSION >= 305) << ' ' << compilerFlags #else << " -f=\\\"" << compilerFlags << "\\\"" #endif << ' ' << hipccCompilerFlags; -#if defined(__HIP_PLATFORM_NVCC___) || (HIP_VERSION >= 305) +#if defined(__HIP_PLATFORM_NVIDIA__) || (HIP_VERSION >= 305) const bool includeOcca = kernelProps.get("kernel/include_occa", false); const bool linkOcca = kernelProps.get("kernel/link_occa", false); if (includeOcca) {