hip: 5.2.3 → 5.3.0

+43 -13
+12 -7
pkgs/development/compilers/hip/default.nix
··· 29 29 let 30 30 hip = stdenv.mkDerivation rec { 31 31 pname = "hip"; 32 - version = "5.2.3"; 32 + version = "5.3.0"; 33 33 34 34 src = fetchFromGitHub { 35 35 owner = "ROCm-Developer-Tools"; 36 36 repo = "HIP"; 37 37 rev = "rocm-${version}"; 38 - hash = "sha256-QaN666Rku2Tkio2Gm5/3RD8D5JgmCZLe0Yun1fGxa8U="; 38 + hash = "sha256-UAodlVUiTU4n/EyvTIuQekTGh4izmBjKCRXOHXVKY4M="; 39 39 }; 40 40 41 41 patches = [ ··· 102 102 description = "C++ Heterogeneous-Compute Interface for Portability"; 103 103 homepage = "https://github.com/ROCm-Developer-Tools/HIP"; 104 104 license = licenses.mit; 105 - maintainers = with maintainers; [ lovesegfault ]; 105 + maintainers = with maintainers; [ lovesegfault Flakebi ]; 106 106 platforms = platforms.linux; 107 107 }; 108 108 }; 109 109 in 110 110 stdenv.mkDerivation rec { 111 111 pname = "hip"; 112 - version = "5.2.3"; 112 + version = "5.3.0"; 113 113 114 114 src = fetchFromGitHub { 115 115 owner = "ROCm-Developer-Tools"; 116 116 repo = "hipamd"; 117 117 rev = "rocm-${version}"; 118 - hash = "sha256-9YZBFn1jpOiX0X9rcpsFDNhas9vfxNkNnbsWSi7unPU="; 118 + hash = "sha256-gZGZiDP/HbdmzLQkG9Jq9lyMP9hoD6UzTMiX9cUmQNA="; 119 119 }; 120 120 121 121 nativeBuildInputs = [ cmake python3 makeWrapper perl ]; ··· 133 133 patches = [ 134 134 (substituteAll { 135 135 src = ./hipamd-config-paths.patch; 136 - inherit llvm hip; 136 + inherit clang llvm hip; 137 137 rocm_runtime = rocm-runtime; 138 138 }) 139 139 ]; 140 + 141 + prePatch = '' 142 + sed -e 's,#!/bin/bash,#!${stdenv.shell},' \ 143 + -i src/hip_embed_pch.sh 144 + ''; 140 145 141 146 preConfigure = '' 142 147 export HIP_CLANG_PATH=${clang}/bin ··· 189 194 description = "C++ Heterogeneous-Compute Interface for Portability"; 190 195 homepage = "https://github.com/ROCm-Developer-Tools/hipamd"; 191 196 license = licenses.mit; 192 - maintainers = with maintainers; [ lovesegfault ]; 197 + maintainers = with maintainers; [ lovesegfault Flakebi ]; 193 198 platforms = platforms.linux; 194 199 }; 195 200 }
+4 -5
pkgs/development/compilers/hip/hip-config-paths.patch
··· 2 2 index 1a72643a..7f35031f 100644 3 3 --- a/hip-lang-config.cmake.in 4 4 +++ b/hip-lang-config.cmake.in 5 - @@ -72,8 +72,8 @@ get_filename_component(_IMPORT_PREFIX "${_DIR}/../../../" REALPATH) 5 + @@ -71,8 +71,8 @@ get_filename_component(_IMPORT_PREFIX "${_DIR}/../../../" REALPATH) 6 6 7 7 8 8 #need _IMPORT_PREFIX to be set #FILE_REORG_BACKWARD_COMPATIBILITY ··· 13 13 find_path(HIP_CLANG_INCLUDE_PATH __clang_cuda_math.h 14 14 HINTS ${HIP_CLANG_INCLUDE_SEARCH_PATHS} 15 15 ${HIP_CLANG_INCLUDE_SEARCH_PATHS_REORG} 16 - @@ -88,10 +88,7 @@ endif() 16 + @@ -87,9 +87,7 @@ endif() 17 17 #if HSA is not under ROCm then provide CMAKE_PREFIX_PATH=<HSA_PATH> 18 18 find_path(HSA_HEADER hsa/hsa.h 19 19 PATHS 20 20 - "${_IMPORT_PREFIX}/../include" #FILE_REORG_BACKWARD_COMPATIBILITY 21 21 - "${_IMPORT_PREFIX}/include" 22 22 - "${ROCM_PATH}/include" 23 - - /opt/rocm/include 24 23 + "@rocm_runtime@/include" 25 24 ) 26 25 27 - if (HSA_HEADER-NOTFOUND) 28 - @@ -99,7 +96,7 @@ if (HSA_HEADER-NOTFOUND) 26 + if (NOT HSA_HEADER) 27 + @@ -97,7 +94,7 @@ if (HSA_HEADER-NOTFOUND) 29 28 endif() 30 29 31 30 get_filename_component(HIP_COMPILER_INSTALL_PATH ${CMAKE_HIP_COMPILER} DIRECTORY)
+27 -1
pkgs/development/compilers/hip/hipamd-config-paths.patch
··· 7 7 endif() 8 8 else() 9 9 - set(HIP_CLANG_ROOT "${ROCM_PATH}/llvm") 10 - + set(HIP_CLANG_ROOT "@llvm@") 10 + + set(HIP_CLANG_ROOT "@clang@") 11 11 endif() 12 12 if(NOT HIP_CXX_COMPILER) 13 13 set(HIP_CXX_COMPILER ${CMAKE_CXX_COMPILER}) ··· 45 45 ) 46 46 endif() 47 47 endif() 48 + diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt 49 + index 83866d83..4125d3aa 100644 50 + --- a/src/CMakeLists.txt 51 + +++ b/src/CMakeLists.txt 52 + @@ -178,7 +178,7 @@ if(__HIP_ENABLE_PCH) 53 + ${ROCM_PATH}/llvm) 54 + # find_package(LLVM) returns the lib/cmake/llvm location. We require the root. 55 + if(NOT DEFINED HIP_LLVM_ROOT) 56 + - set(HIP_LLVM_ROOT "${LLVM_DIR}/../../..") 57 + + set(HIP_LLVM_ROOT "@clang@") 58 + endif() 59 + 60 + execute_process(COMMAND sh -c "${CMAKE_CURRENT_SOURCE_DIR}/hip_embed_pch.sh ${HIP_COMMON_INCLUDE_DIR} ${PROJECT_BINARY_DIR}/include ${PROJECT_SOURCE_DIR}/include ${HIP_LLVM_ROOT}" COMMAND_ECHO STDERR RESULT_VARIABLE EMBED_PCH_RC) 61 + diff --git a/src/hip_embed_pch.sh b/src/hip_embed_pch.sh 62 + index 0a1572b2..aa855d63 100755 63 + --- a/src/hip_embed_pch.sh 64 + +++ b/src/hip_embed_pch.sh 65 + @@ -149,7 +149,7 @@ EOF 66 + 67 + $LLVM_DIR/bin/clang -cc1 -O3 -emit-pch -triple amdgcn-amd-amdhsa -aux-triple x86_64-unknown-linux-gnu -fcuda-is-device -std=c++17 -fgnuc-version=4.2.1 -o $tmp/hip_wave64.pch -x hip-cpp-output - <$tmp/pch_wave64.cui && 68 + 69 + - $LLVM_DIR/bin/llvm-mc -o hip_pch.o $tmp/hip_pch.mcin --filetype=obj && 70 + + @llvm@/bin/llvm-mc -o hip_pch.o $tmp/hip_pch.mcin --filetype=obj && 71 + 72 + rm -rf $tmp 73 + }