Fix texture 3D for HIP/NVCC

[ROCm/hip commit: 9de5f23d54]
This commit is contained in:
Rahul Garg
2018-05-02 11:56:37 +05:30
parent c41d423404
commit ab1dabe61b
3 changed files with 22 additions and 5 deletions
@@ -1481,7 +1481,7 @@ hipError_t hipMallocArray(hipArray** array, const hipChannelFormatDesc* desc, si
size_t height __dparm(0), unsigned int flags __dparm(hipArrayDefault));
hipError_t hipArrayCreate(hipArray** pHandle, const HIP_ARRAY_DESCRIPTOR* pAllocateArray);
hipError_t hipArray3DCreate(hipArray_t* array, const HIP_ARRAY_DESCRIPTOR* pAllocateArray);
hipError_t hipArray3DCreate(hipArray** array, const HIP_ARRAY_DESCRIPTOR* pAllocateArray);
hipError_t hipMalloc3D(hipPitchedPtr* pitchedDevPtr, hipExtent extent);
@@ -1507,7 +1507,7 @@ hipError_t hipFreeArray(hipArray* array);
* @see hipMalloc, hipMallocPitch, hipFree, hipFreeArray, hipHostMalloc, hipHostFree
*/
hipError_t hipMalloc3DArray(hipArray_t* array, const struct hipChannelFormatDesc* desc,
hipError_t hipMalloc3DArray(hipArray** array, const struct hipChannelFormatDesc* desc,
struct hipExtent extent, unsigned int flags);
/**
* @brief Copies data between host and device.
@@ -150,13 +150,20 @@ typedef CUfunction hipFunction_t;
typedef CUdeviceptr hipDeviceptr_t;
typedef struct cudaArray hipArray;
typedef struct cudaArray* hipArray_const_t;
typedef cudaMemcpy3DParms hipMemcpy3DParms;
//#define hipMemcpy3DParms cudaMemcpy3DParms
#define hipArrayDefault cudaArrayDefault
typedef cudaTextureObject_t hipTextureObject_t;
typedef cudaSurfaceObject_t hipSurfaceObject_t;
#define hipTextureType2D cudaTextureType2D;
#define hipTextureType2D cudaTextureType2D
#define hipTextureType3D cudaTextureType3D
#define hipDeviceMapHost cudaDeviceMapHost
#define hipExtent cudaExtent
#define make_hipExtent make_cudaExtent
#define make_hipPos make_cudaPos
#define make_hipPitchedPtr make_cudaPitchedPtr
// Flags that can be used with hipStreamCreateWithFlags
#define hipStreamDefault cudaStreamDefault
#define hipStreamNonBlocking cudaStreamNonBlocking
@@ -399,6 +406,11 @@ inline static hipError_t hipMallocArray(hipArray** array, const struct hipChanne
return hipCUDAErrorTohipError(cudaMallocArray(array, desc, width, height, flags));
}
inline static hipError_t hipMalloc3DArray(hipArray** array, const struct hipChannelFormatDesc* desc,
struct hipExtent extent, unsigned int flags) {
return hipCUDAErrorTohipError(cudaMalloc3DArray(array, desc, extent, flags));
}
inline static hipError_t hipFreeArray(hipArray* array) {
return hipCUDAErrorTohipError(cudaFreeArray(array));
}
@@ -531,6 +543,11 @@ inline static hipError_t hipMemcpy2D(void* dst, size_t dpitch, const void* src,
cudaMemcpy2D(dst, dpitch, src, spitch, width, height, hipMemcpyKindToCudaMemcpyKind(kind)));
}
inline static hipError_t hipMemcpy3D(const struct hipMemcpy3DParms *p)
{
return hipCUDAErrorTohipError(cudaMemcpy3D(p));
}
inline static hipError_t hipMemcpy2DAsync(void* dst, size_t dpitch, const void* src, size_t spitch,
size_t width, size_t height, hipMemcpyKind kind,
hipStream_t stream) {
+2 -2
View File
@@ -641,7 +641,7 @@ hipError_t hipMallocArray(hipArray** array, const hipChannelFormatDesc* desc, si
return ihipLogStatus(hip_status);
}
hipError_t hipArray3DCreate(hipArray_t* array, const HIP_ARRAY_DESCRIPTOR* pAllocateArray) {
hipError_t hipArray3DCreate(hipArray** array, const HIP_ARRAY_DESCRIPTOR* pAllocateArray) {
HIP_INIT_SPECIAL_API((TRACE_MEM), array, pAllocateArray);
hipError_t hip_status = hipSuccess;
@@ -764,7 +764,7 @@ hipError_t hipArray3DCreate(hipArray_t* array, const HIP_ARRAY_DESCRIPTOR* pAllo
return ihipLogStatus(hip_status);
}
hipError_t hipMalloc3DArray(hipArray_t* array, const struct hipChannelFormatDesc* desc,
hipError_t hipMalloc3DArray(hipArray** array, const struct hipChannelFormatDesc* desc,
struct hipExtent extent, unsigned int flags) {