Browse Source

hip: implement hipDeviceSetCacheConfig when building with nvcc

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
master
Steven Noonan 3 years ago
parent
commit
6436167b59
Signed by: steven GPG Key ID: 408EEB508ED0CD4D
  1. 9
      hip/PKGBUILD
  2. 28
      hip/implement-hipDeviceSetCacheConfig.patch

9
hip/PKGBUILD

@ -2,19 +2,22 @@
# Maintainer: Jakub Okoński <jakub@okonski.org>
pkgname=hip
pkgver=2.1.0
pkgrel=5
pkgrel=6
pkgdesc="Heterogeneous Interface for Portability ROCm"
url="https://github.com/ROCm-Developer-Tools/HIP"
arch=(x86_64)
makedepends=("hcc>=2.1.0" git cmake ninja)
depends=('perl' 'bash' 'rocminfo' 'llvm' 'clang')
source=("git+https://github.com/ROCm-Developer-Tools/HIP.git#tag=roc-2.1.0"
'fix-cuda-path.patch')
'fix-cuda-path.patch'
'implement-hipDeviceSetCacheConfig.patch')
md5sums=('SKIP'
'ad5628fd2af0837ef91b8c091b414e9e')
'ad5628fd2af0837ef91b8c091b414e9e'
'366308d8ae838990d76a47aad634b55c')
prepare() {
patch -Np1 -i "${srcdir}/fix-cuda-path.patch" -d "${srcdir}/HIP"
patch -Np1 -i "${srcdir}/implement-hipDeviceSetCacheConfig.patch" -d "${srcdir}/HIP"
}
build() {

28
hip/implement-hipDeviceSetCacheConfig.patch

@ -0,0 +1,28 @@
diff --git a/include/hip/nvcc_detail/hip_runtime_api.h b/include/hip/nvcc_detail/hip_runtime_api.h
index 02c4b7ee..72245399 100644
--- a/include/hip/nvcc_detail/hip_runtime_api.h
+++ b/include/hip/nvcc_detail/hip_runtime_api.h
@@ -79,6 +79,12 @@ typedef enum hipChannelFormatKind {
#define hipBoundaryModeTrap cudaBoundaryModeTrap
#define hipBoundaryModeClamp cudaBoundaryModeClamp
+// hipFuncCache
+#define hipFuncCachePreferNone cudaFuncCachePreferNone
+#define hipFuncCachePreferShared cudaFuncCachePreferShared
+#define hipFuncCachePreferL1 cudaFuncCachePreferL1
+#define hipFuncCachePreferEqual cudaFuncCachePreferEqual
+
// hipResourceType
#define hipResourceType cudaResourceType
#define hipResourceTypeArray cudaResourceTypeArray
@@ -614,6 +620,10 @@ inline static hipError_t hipDeviceGetCacheConfig(hipFuncCache_t* pCacheConfig) {
return hipCUDAErrorTohipError(cudaDeviceGetCacheConfig(pCacheConfig));
}
+inline static hipError_t hipDeviceSetCacheConfig(hipFuncCache_t cacheConfig) {
+ return hipCUDAErrorTohipError(cudaDeviceSetCacheConfig(cacheConfig));
+}
+
inline static const char* hipGetErrorString(hipError_t error) {
return cudaGetErrorString(hipErrorToCudaError(error));
}
Loading…
Cancel
Save