SWDEV-326789 - Add Missing HIP API Functions For Nvidia Platform
Change-Id: I828028c5d893ca1487f33017a6902c3b7f786762
[ROCm/hipother commit: d5be2bb91d]
Bu işleme şunda yer alıyor:
işlemeyi yapan:
Rakesh Roy
ebeveyn
3054e52da0
işleme
6536ccbf3d
@@ -227,6 +227,7 @@ inline static CUresourcetype hipResourcetype_enumToCUresourcetype(
|
||||
|
||||
#define hipTexRef CUtexref
|
||||
#define hiparray CUarray
|
||||
typedef CUmipmappedArray hipMipmappedArray_t;
|
||||
|
||||
// hipTextureAddressMode
|
||||
typedef enum cudaTextureAddressMode hipTextureAddressMode;
|
||||
@@ -411,6 +412,9 @@ typedef struct cudaChannelFormatDesc hipChannelFormatDesc;
|
||||
typedef struct cudaResourceDesc hipResourceDesc;
|
||||
typedef struct cudaTextureDesc hipTextureDesc;
|
||||
typedef struct cudaResourceViewDesc hipResourceViewDesc;
|
||||
typedef CUDA_RESOURCE_DESC HIP_RESOURCE_DESC;
|
||||
typedef CUDA_TEXTURE_DESC HIP_TEXTURE_DESC;
|
||||
typedef CUDA_RESOURCE_VIEW_DESC HIP_RESOURCE_VIEW_DESC;
|
||||
// adding code for hipmemSharedConfig
|
||||
#define hipSharedMemBankSizeDefault cudaSharedMemBankSizeDefault
|
||||
#define hipSharedMemBankSizeFourByte cudaSharedMemBankSizeFourByte
|
||||
@@ -1191,6 +1195,22 @@ inline static hipError_t hipFreeArray(hipArray* array) {
|
||||
return hipCUDAErrorTohipError(cudaFreeArray(array));
|
||||
}
|
||||
|
||||
inline static hipError_t hipMipmappedArrayCreate(hipMipmappedArray_t* pHandle,
|
||||
HIP_ARRAY3D_DESCRIPTOR* pMipmappedArrayDesc,
|
||||
unsigned int numMipmapLevels) {
|
||||
return hipCUResultTohipError(cuMipmappedArrayCreate(pHandle, pMipmappedArrayDesc, numMipmapLevels));
|
||||
}
|
||||
|
||||
inline static hipError_t hipMipmappedArrayDestroy(hipMipmappedArray_t hMipmappedArray) {
|
||||
return hipCUResultTohipError(cuMipmappedArrayDestroy(hMipmappedArray));
|
||||
}
|
||||
|
||||
inline static hipError_t hipMipmappedArrayGetLevel(hipArray_t* pLevelArray,
|
||||
hipMipmappedArray_t hMipMappedArray,
|
||||
unsigned int level) {
|
||||
return hipCUResultTohipError(cuMipmappedArrayGetLevel((CUarray*)pLevelArray, hMipMappedArray, level));
|
||||
}
|
||||
|
||||
inline static hipError_t hipHostGetDevicePointer(void** devPtr, void* hostPtr, unsigned int flags) {
|
||||
return hipCUDAErrorTohipError(cudaHostGetDevicePointer(devPtr, hostPtr, flags));
|
||||
}
|
||||
@@ -2357,6 +2377,29 @@ inline static hipError_t hipLaunchCooperativeKernel(T f, dim3 gridDim, dim3 bloc
|
||||
cudaLaunchCooperativeKernel(reinterpret_cast<const void*>(f), gridDim, blockDim, kernelParams, sharedMemBytes, stream));
|
||||
}
|
||||
|
||||
inline static hipError_t hipTexObjectCreate(hipTextureObject_t* pTexObject,
|
||||
const HIP_RESOURCE_DESC* pResDesc,
|
||||
const HIP_TEXTURE_DESC* pTexDesc,
|
||||
const HIP_RESOURCE_VIEW_DESC* pResViewDesc) {
|
||||
return hipCUResultTohipError(cuTexObjectCreate((CUtexObject*)pTexObject, pResDesc, pTexDesc, pResViewDesc));
|
||||
}
|
||||
|
||||
inline static hipError_t hipTexObjectDestroy(hipTextureObject_t texObject) {
|
||||
return hipCUResultTohipError(cuTexObjectDestroy((CUtexObject)texObject));
|
||||
}
|
||||
|
||||
inline static hipError_t hipTexObjectGetResourceDesc(HIP_RESOURCE_DESC* pResDesc, hipTextureObject_t texObject) {
|
||||
return hipCUResultTohipError(cuTexObjectGetResourceDesc(pResDesc, (CUtexObject)texObject));
|
||||
}
|
||||
|
||||
inline static hipError_t hipTexObjectGetResourceViewDesc(HIP_RESOURCE_VIEW_DESC* pResViewDesc, hipTextureObject_t texObject) {
|
||||
return hipCUResultTohipError(cuTexObjectGetResourceViewDesc(pResViewDesc, (CUtexObject)texObject));
|
||||
}
|
||||
|
||||
inline static hipError_t hipTexObjectGetTextureDesc(HIP_TEXTURE_DESC* pTexDesc, hipTextureObject_t texObject) {
|
||||
return hipCUResultTohipError(cuTexObjectGetTextureDesc(pTexDesc, (CUtexObject)texObject));
|
||||
}
|
||||
|
||||
inline static hipError_t hipTexRefSetAddressMode(hipTexRef hTexRef, int dim, hipAddress_mode am){
|
||||
return hipCUResultTohipError(cuTexRefSetAddressMode(hTexRef,dim,am));
|
||||
}
|
||||
|
||||
Yeni konuda referans
Bir kullanıcı engelle