From 528b25700431880c116dd0f7b0af71a2b7855784 Mon Sep 17 00:00:00 2001 From: Maneesh Gupta Date: Tue, 25 Oct 2016 12:26:54 +0530 Subject: [PATCH 1/6] hipcc: Turn back linking hip_ir.ll by default Change-Id: I9cec5a1a5a4791eddf6ef3e3332143ffc3ceadb6 --- bin/hipcc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/hipcc b/bin/hipcc index 21453634d6..2f3cd46c62 100755 --- a/bin/hipcc +++ b/bin/hipcc @@ -211,7 +211,7 @@ if($HIP_PLATFORM eq "hcc"){ } } -if(($HIP_PLATFORM eq "hcc") and defined $ENV{HIP_EXPERIMENTAL}){ +if($HIP_PLATFORM eq "hcc"){ $EXPORT_LL=" "; $ENV{HCC_EXTRA_LIBRARIES}="$HIP_PATH/lib/hip_ir.ll\n"; } From db7a46adf68738d92b3f124ceb4cd2c143cb3280 Mon Sep 17 00:00:00 2001 From: Maneesh Gupta Date: Tue, 25 Oct 2016 15:42:24 +0530 Subject: [PATCH 2/6] hip_hcc package: install hip_ir.ll to lib folder Change-Id: Ieaa4ff83597c211f221b4c1b0b93e08ad7c92ea6 --- packaging/hip_hcc.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/packaging/hip_hcc.txt b/packaging/hip_hcc.txt index 5801554f7c..d7b0877b62 100644 --- a/packaging/hip_hcc.txt +++ b/packaging/hip_hcc.txt @@ -9,6 +9,7 @@ else() install(FILES @PROJECT_BINARY_DIR@/libhip_hcc.so DESTINATION lib) endif() install(FILES @PROJECT_BINARY_DIR@/.hipInfo DESTINATION lib) +install(FILES @hip_SOURCE_DIR@/src/hip_ir.ll DESTINATION lib) ############################# # Packaging steps From 2abf300797c40e2d7fc32bfafa285244e56f3bb0 Mon Sep 17 00:00:00 2001 From: pensun Date: Tue, 25 Oct 2016 15:29:33 -0500 Subject: [PATCH 3/6] Remove extra semicolons and extra spaces in header on NV path Change-Id: Ib33aec2451a4e0b298d537dbb1b9df000405871b --- include/hip/nvcc_detail/hip_runtime_api.h | 58 +++++++++++------------ 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/include/hip/nvcc_detail/hip_runtime_api.h b/include/hip/nvcc_detail/hip_runtime_api.h index a632e57f97..769a66ea7b 100644 --- a/include/hip/nvcc_detail/hip_runtime_api.h +++ b/include/hip/nvcc_detail/hip_runtime_api.h @@ -106,7 +106,7 @@ switch(cuError) { case cudaErrorHostMemoryNotRegistered : return hipErrorHostMemoryNotRegistered ; case cudaErrorUnsupportedLimit : return hipErrorUnsupportedLimit ; default : return hipErrorUnknown; // Note - translated error. -}; +} } inline static hipError_t hipCUResultTohipError(CUresult cuError) { //TODO Populate further @@ -120,7 +120,7 @@ switch(cuError) { case CUDA_ERROR_INVALID_CONTEXT : return hipErrorInvalidContext ; case CUDA_ERROR_NOT_INITIALIZED : return hipErrorNotInitialized ; default : return hipErrorUnknown; // Note - translated error. -}; +} } // TODO match the error enum names of hip and cuda @@ -319,11 +319,11 @@ inline static hipError_t hipDeviceSynchronize() { } inline static const char* hipGetErrorString(hipError_t error){ - return cudaGetErrorString( hipErrorToCudaError(error) ); + return cudaGetErrorString(hipErrorToCudaError(error)); } inline static const char* hipGetErrorName(hipError_t error){ - return cudaGetErrorName( hipErrorToCudaError(error) ); + return cudaGetErrorName(hipErrorToCudaError(error)); } inline static hipError_t hipGetDeviceCount(int * count){ @@ -611,12 +611,12 @@ inline static hipError_t hipDeviceCanAccessPeer ( int* canAccessPeer, int devic inline static hipError_t hipDeviceDisablePeerAccess ( int peerDevice ) { - return hipCUDAErrorTohipError(cudaDeviceDisablePeerAccess ( peerDevice )); -}; + return hipCUDAErrorTohipError(cudaDeviceDisablePeerAccess(peerDevice)); +} inline static hipError_t hipDeviceEnablePeerAccess ( int peerDevice, unsigned int flags ) { - return hipCUDAErrorTohipError(cudaDeviceEnablePeerAccess ( peerDevice, flags )); + return hipCUDAErrorTohipError(cudaDeviceEnablePeerAccess(peerDevice, flags)); } inline static hipError_t hipCtxDisablePeerAccess ( hipCtx_t peerCtx ) @@ -626,22 +626,22 @@ inline static hipError_t hipCtxDisablePeerAccess ( hipCtx_t peerCtx ) inline static hipError_t hipCtxEnablePeerAccess ( hipCtx_t peerCtx, unsigned int flags ) { - return hipCUResultTohipError(cuCtxEnablePeerAccess ( peerCtx, flags )); + return hipCUResultTohipError(cuCtxEnablePeerAccess(peerCtx, flags)); } inline static hipError_t hipMemcpyPeer ( void* dst, int dstDevice, const void* src, int srcDevice, size_t count ) { - return hipCUDAErrorTohipError(cudaMemcpyPeer ( dst, dstDevice, src, srcDevice, count )); -}; + return hipCUDAErrorTohipError(cudaMemcpyPeer(dst, dstDevice, src, srcDevice, count)); +} inline static hipError_t hipMemcpyPeerAsync ( void* dst, int dstDevice, const void* src, int srcDevice, size_t count, hipStream_t stream=0 ) { - return hipCUDAErrorTohipError(cudaMemcpyPeerAsync ( dst, dstDevice, src, srcDevice, count, stream )); -}; + return hipCUDAErrorTohipError(cudaMemcpyPeerAsync(dst, dstDevice, src, srcDevice, count, stream)); +} inline static hipError_t hipSetDeviceFlags (unsigned int flags) { - return hipCUDAErrorTohipError(cudaSetDeviceFlags( flags )); + return hipCUDAErrorTohipError(cudaSetDeviceFlags(flags)); } inline static hipError_t hipEventCreateWithFlags(hipEvent_t* event, unsigned int flags) @@ -656,62 +656,62 @@ inline static hipError_t hipEventQuery(hipEvent_t event) inline static hipError_t hipCtxCreate(hipCtx_t *ctx, unsigned int flags, hipDevice_t device) { - return hipCUResultTohipError(cuCtxCreate ( ctx,flags,device )); + return hipCUResultTohipError(cuCtxCreate(ctx,flags,device)); } inline static hipError_t hipCtxDestroy(hipCtx_t ctx) { - return hipCUResultTohipError(cuCtxDestroy ( ctx )); + return hipCUResultTohipError(cuCtxDestroy(ctx)); } inline static hipError_t hipCtxPopCurrent(hipCtx_t* ctx) { - return hipCUResultTohipError(cuCtxPopCurrent ( ctx )); + return hipCUResultTohipError(cuCtxPopCurrent(ctx)); } inline static hipError_t hipCtxPushCurrent(hipCtx_t ctx) { - return hipCUResultTohipError(cuCtxPushCurrent ( ctx )); + return hipCUResultTohipError(cuCtxPushCurrent(ctx)); } inline static hipError_t hipCtxSetCurrent(hipCtx_t ctx) { - return hipCUResultTohipError(cuCtxSetCurrent ( ctx )); + return hipCUResultTohipError(cuCtxSetCurrent(ctx)); } inline static hipError_t hipCtxGetCurrent(hipCtx_t* ctx) { - return hipCUResultTohipError(cuCtxGetCurrent ( ctx )); + return hipCUResultTohipError(cuCtxGetCurrent(ctx)); } inline static hipError_t hipCtxGetDevice(hipDevice_t *device) { - return hipCUResultTohipError(cuCtxGetDevice ( device )); + return hipCUResultTohipError(cuCtxGetDevice(device)); } inline static hipError_t hipCtxGetApiVersion (hipCtx_t ctx,int *apiVersion) { - return hipCUResultTohipError(cuCtxGetApiVersion ( ctx,(unsigned int*)apiVersion )); + return hipCUResultTohipError(cuCtxGetApiVersion(ctx,(unsigned int*)apiVersion)); } -inline static hipError_t hipCtxGetCacheConfig ( hipFuncCache *cacheConfig ) +inline static hipError_t hipCtxGetCacheConfig (hipFuncCache *cacheConfig) { - return hipCUResultTohipError(cuCtxGetCacheConfig ( cacheConfig )); + return hipCUResultTohipError(cuCtxGetCacheConfig(cacheConfig)); } -inline static hipError_t hipCtxSetCacheConfig ( hipFuncCache cacheConfig ) +inline static hipError_t hipCtxSetCacheConfig (hipFuncCache cacheConfig) { - return hipCUResultTohipError(cuCtxSetCacheConfig ( cacheConfig )); + return hipCUResultTohipError(cuCtxSetCacheConfig(cacheConfig)); } -inline static hipError_t hipCtxSetSharedMemConfig ( hipSharedMemConfig config ) +inline static hipError_t hipCtxSetSharedMemConfig (hipSharedMemConfig config) { - return hipCUResultTohipError(cuCtxSetSharedMemConfig ( config )); + return hipCUResultTohipError(cuCtxSetSharedMemConfig(config)); } inline static hipError_t hipCtxGetSharedMemConfig ( hipSharedMemConfig * pConfig ) { - return hipCUResultTohipError(cuCtxGetSharedMemConfig ( pConfig )); + return hipCUResultTohipError(cuCtxGetSharedMemConfig(pConfig)); } inline static hipError_t hipCtxSynchronize ( void ) @@ -721,7 +721,7 @@ inline static hipError_t hipCtxSynchronize ( void ) inline static hipError_t hipCtxGetFlags ( unsigned int* flags ) { - return hipCUResultTohipError(cuCtxGetFlags ( flags )); + return hipCUResultTohipError(cuCtxGetFlags(flags)); } inline static hipError_t hipCtxDetach(hipCtx_t ctx) From 6fa9bc3b61d1d78a3414511fd658281399d27165 Mon Sep 17 00:00:00 2001 From: Maneesh Gupta Date: Fri, 28 Oct 2016 14:12:13 +0530 Subject: [PATCH 4/6] hipcc: Update flags for Fedora support Change-Id: I90be7768410e491b4f11c3b0f08470246d781d80 --- bin/hipcc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/hipcc b/bin/hipcc index 2f3cd46c62..f5692e6fca 100755 --- a/bin/hipcc +++ b/bin/hipcc @@ -116,9 +116,16 @@ if ($HIP_PLATFORM eq "hcc") { } else { $HIPLDFLAGS .= " -Wl,--defsym=_binary_kernel_spir_end=1 -Wl,--defsym=_binary_kernel_spir_start=1 -Wl,--defsym=_binary_kernel_cl_start=1 -Wl,--defsym=_binary_kernel_cl_end=1"; } + if ($HOST_OSNAME eq "fedora") { + $HIPCXXFLAGS .= " -I/usr/local/include/c++/v1"; + } # Satisfy HCC dependencies - $HIPLDFLAGS .= " -lc++abi -lsupc++"; + if ($HOST_OSNAME eq "fedora") { + $HIPLDFLAGS .= " -lc++abi"; + } else { + $HIPLDFLAGS .= " -lc++abi -lsupc++"; + } $HIPLDFLAGS .= " -L$HSA_PATH/lib -L$ROCM_PATH/lib -lhsa-runtime64 -lhc_am -lhsakmt"; # Handle ROCm target platform From c5a2ad496476b42c1425b97b8a4ebf8b2c2a1165 Mon Sep 17 00:00:00 2001 From: Maneesh Gupta Date: Fri, 28 Oct 2016 14:12:53 +0530 Subject: [PATCH 5/6] CMakeLists.txt: Update include paths needed for Fedora support Change-Id: Ib84f9dba30d2c64f344d6f8e85ddbe15f30af1a0 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9ea2e0f877..8958eaa090 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -164,7 +164,7 @@ if(HIP_PLATFORM STREQUAL "hcc") set(HIP_HCC_BUILD_FLAGS "${HIP_HCC_BUILD_FLAGS} -DHIP_VERSION_MAJOR=${HIP_VERSION_MAJOR} -DHIP_VERSION_MINOR=${HIP_VERSION_MINOR} -DHIP_VERSION_PATCH=${HIP_VERSION_PATCH}") # Add remaining flags - set(HIP_HCC_BUILD_FLAGS "${HIP_HCC_BUILD_FLAGS} -fPIC -hc -I${HCC_HOME}/include -I${HSA_PATH}/include -I/opt/rocm/libhsakmt/include -stdlib=libc++") + set(HIP_HCC_BUILD_FLAGS "${HIP_HCC_BUILD_FLAGS} -fPIC -hc -I${HCC_HOME}/include -I${HSA_PATH}/include -I/opt/rocm/libhsakmt/include -I/usr/local/include/c++/v1 -stdlib=libc++") # Set compiler and compiler flags set(CMAKE_CXX_COMPILER "${HCC_HOME}/bin/hcc") From 7c68768a0d86a1efd5293b78126850e91486623e Mon Sep 17 00:00:00 2001 From: Maneesh Gupta Date: Tue, 8 Nov 2016 16:31:56 +0530 Subject: [PATCH 6/6] Update release notes for 1.0 release Change-Id: I74fa2b41afc334a76c309b125c27aa141cd59554 --- RELEASE.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/RELEASE.md b/RELEASE.md index d1f79bc3c6..a7c770f611 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -13,8 +13,25 @@ Upcoming: ## Revision History: +=================================================================================================== +Release:1.0 +Date: 2016.11.8 +- Initial implementation for FindHIP.cmake +- HIP library now installs as a static library by default +- Added support for HIP context and HIP module APIs +- Major changes to HIP signal & memory management implementation +- Support for complex data type and math functions +- clang-hipify is now known as hipify-clang +- Added several new HIP samples +- Preliminary support for new APIs: hipMemcpyToSymbol, hipDeviceGetLimit, hipRuntimeGetVersion +- Added support for async memcpy driver API (for example hipMemcpyHtoDAsync) +- Support for memory management device functions: malloc, free, memcpy & memset +- Removed deprecated HIP runtime header locations. Please include "hip/hip_runtime.h" instead of "hip_runtime.h". You can use `find . -type f -exec sed -i 's:#include "hip_runtime.h":#include "hip/hip_runtime.h":g' {} +` to replace all such references + + =================================================================================================== Release:0.92.00 +Date: 2016.8.14 - hipLaunchKernel supports one-dimensional grid and/or block dims, without explicit cast to dim3 type (actually in 0.90.00) - fp16 software support - Support for Hawaii dGPUs using environment variable ROCM_TARGET=hawaii