From 698ea7f30fa8f3843496574052f006dd6cfc7889 Mon Sep 17 00:00:00 2001 From: Ben Sander Date: Sun, 17 Apr 2016 07:40:04 -0500 Subject: [PATCH] Move HIP_HCC define to CMake [ROCm/hip commit: 65abde6626023d5ba1a8ced18548804e49c6ea23] --- projects/hip/CMakeLists.txt | 4 ++-- projects/hip/include/hcc_detail/hip_hcc.h | 3 --- projects/hip/src/hip_hcc.cpp | 5 ----- projects/hip/src/staging_buffer.cpp | 4 +++- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/projects/hip/CMakeLists.txt b/projects/hip/CMakeLists.txt index 11c6420a08..d498038c24 100644 --- a/projects/hip/CMakeLists.txt +++ b/projects/hip/CMakeLists.txt @@ -92,8 +92,8 @@ if(HIP_PLATFORM STREQUAL "hcc") set(CMAKE_CXX_COMPILER "${HCC_HOME}/bin/hcc") set(CMAKE_C_COMPILER "${HCC_HOME}/bin/hcc") - set(CMAKE_CXX_FLAGS " -hc -I${HCC_HOME}/include -I${HSA_PATH}/include -stdlib=libc++ ") - set(CMAKE_C_FLAGS " -hc -I${HCC_HOME}/include -I${HSA_PATH}/include -stdlib=libc++ ") + set(CMAKE_CXX_FLAGS " -hc -I${HCC_HOME}/include -I${HSA_PATH}/include -stdlib=libc++ -DHIP_HCC") + set(CMAKE_C_FLAGS " -hc -I${HCC_HOME}/include -I${HSA_PATH}/include -stdlib=libc++ -DHIP_HCC") set(SOURCE_FILES src/device_util.cpp src/hip_hcc.cpp diff --git a/projects/hip/include/hcc_detail/hip_hcc.h b/projects/hip/include/hcc_detail/hip_hcc.h index 46737e5545..d97a41ef59 100644 --- a/projects/hip/include/hcc_detail/hip_hcc.h +++ b/projects/hip/include/hcc_detail/hip_hcc.h @@ -24,7 +24,6 @@ THE SOFTWARE. #include "hcc_detail/hip_util.h" #include "hcc_detail/staging_buffer.h" -#define HIP_HCC #if defined(__HCC__) && (__hcc_workweek__ < 1502) #error("This version of HIP requires a newer version of HCC."); @@ -90,8 +89,6 @@ class ihipDevice_t; #define API_COLOR KGRN -#define HIP_HCC - // If set, thread-safety is enforced on all stream functions. // Stream functions will acquire a mutex before entering critical sections. #define STREAM_THREAD_SAFE 1 diff --git a/projects/hip/src/hip_hcc.cpp b/projects/hip/src/hip_hcc.cpp index 5977099c9c..3fba257698 100644 --- a/projects/hip/src/hip_hcc.cpp +++ b/projects/hip/src/hip_hcc.cpp @@ -43,11 +43,6 @@ THE SOFTWARE. #include "hcc_detail/hip_hcc.h" #include "hsa_ext_amd.h" -// HIP includes: -#define HIP_HCC -//#include "hcc_detail/staging_buffer.h" - - // TODO, re-org header order. extern const char *ihipErrorString(hipError_t hip_error); #include "hcc_detail/trace_helper.h" diff --git a/projects/hip/src/staging_buffer.cpp b/projects/hip/src/staging_buffer.cpp index ffc1566380..201472c7f3 100644 --- a/projects/hip/src/staging_buffer.cpp +++ b/projects/hip/src/staging_buffer.cpp @@ -24,6 +24,8 @@ THE SOFTWARE. #include "hcc_detail/staging_buffer.h" #ifdef HIP_HCC +#include "hcc_detail/hip_runtime.h" +#include "hcc_detail/hip_hcc.h" #define THROW_ERROR(e) throw ihipException(e) #else #define THROW_ERROR(e) throw @@ -301,7 +303,7 @@ void StagingBuffer::CopyPeerToPeer(void* dst, hsa_agent_t dstAgent, const void* tprintf (DB_COPY2, "P2P: wait_completion[%d] bytesRemaining=%zu\n", bufferIndex, bytesRemaining1); - bool hostWait = 0; + bool hostWait = 0; // TODO - remove me if (hostWait) { // Host-side wait, should not be necessary: