Skip to content
This repository has been archived by the owner on Jan 26, 2024. It is now read-only.

make nvidia_hip_runtime_api work with CUDA 12 #74

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions include/hip/nvidia_detail/nvidia_hip_runtime_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -2792,6 +2792,7 @@ inline static hipError_t hipFuncSetCacheConfig(const void* func, hipFuncCache_t
return hipCUDAErrorTohipError(cudaFuncSetCacheConfig(func, cacheConfig));
}

#if CUDA_VERSION < 12000
__HIP_DEPRECATED inline static hipError_t hipBindTexture(size_t* offset,
struct textureReference* tex,
const void* devPtr,
Expand All @@ -2805,6 +2806,7 @@ __HIP_DEPRECATED inline static hipError_t hipBindTexture2D(
const hipChannelFormatDesc* desc, size_t width, size_t height, size_t pitch) {
return hipCUDAErrorTohipError(cudaBindTexture2D(offset, tex, devPtr, desc, width, height, pitch));
}
#endif // CUDA_VERSION < 12000

inline static hipChannelFormatDesc hipCreateChannelDesc(int x, int y, int z, int w,
hipChannelFormatKind f) {
Expand Down Expand Up @@ -2837,10 +2839,12 @@ inline static hipError_t hipGetTextureObjectResourceDesc(hipResourceDesc* pResDe
return hipCUDAErrorTohipError(cudaGetTextureObjectResourceDesc( pResDesc, textureObject));
}

#if CUDA_VERSION < 12000
__HIP_DEPRECATED inline static hipError_t hipGetTextureAlignmentOffset(
size_t* offset, const struct textureReference* texref) {
return hipCUDAErrorTohipError(cudaGetTextureAlignmentOffset(offset,texref));
}
#endif // CUDA_VERSION < 12000

inline static hipError_t hipGetChannelDesc(hipChannelFormatDesc* desc, hipArray_const_t array)
{
Expand Down Expand Up @@ -3086,6 +3090,7 @@ inline static hipError_t hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(
blockSize, dynamicSMemSize, flags));
}

#if CUDA_VERSION < 12000
template <class T, int dim, enum cudaTextureReadMode readMode>
inline static hipError_t hipBindTexture(size_t* offset, const struct texture<T, dim, readMode>& tex,
const void* devPtr, size_t size = UINT_MAX) {
Expand Down Expand Up @@ -3128,6 +3133,7 @@ __HIP_DEPRECATED inline static hipError_t hipBindTextureToArray(
struct texture<T, dim, readMode>& tex, hipArray_const_t array) {
return hipCUDAErrorTohipError(cudaBindTextureToArray(tex, array));
}
#endif // CUDA_VERSION < 12000

template <class T>
inline static hipChannelFormatDesc hipCreateChannelDesc() {
Expand Down