Add hipBindTexture2D on NVCC path (#1773)

Bu işleme şunda yer alıyor:
Rahul Garg
2020-01-05 23:03:50 -08:00
işlemeyi yapan: Maneesh Gupta
ebeveyn 178d432b90
işleme 534376cb41
2 değiştirilmiş dosya ile 6 ekleme ve 11 silme
+6
Dosyayı Görüntüle
@@ -1383,6 +1383,12 @@ inline static hipError_t hipBindTexture(size_t* offset, struct textureReference*
return hipCUDAErrorTohipError(cudaBindTexture(offset, tex, devPtr, desc, size));
}
inline static hipError_t hipBindTexture2D(size_t* offset, struct textureReference* tex, const void* devPtr,
const hipChannelFormatDesc* desc, size_t width, size_t height,
size_t pitch) {
return hipCUDAErrorTohipError(cudaBindTexture2D(offset, tex, devPtr, desc, width, height, pitch));
}
inline static hipChannelFormatDesc hipCreateChannelDesc(int x, int y, int z, int w,
hipChannelFormatKind f) {
return cudaCreateChannelDesc(x, y, z, w, hipChannelFormatKindToCudaChannelFormatKind(f));
-11
Dosyayı Görüntüle
@@ -58,19 +58,8 @@ int main (void)
SIZE_W*sizeof(TYPE_t), SIZE_H, hipMemcpyHostToDevice));
tex.normalized = false;
#if defined(__HIP_PLATFORM_NVCC__)
cudaError_t status = cudaBindTexture2D(&tex_ofs, &tex, devPtrA, &tex.channelDesc,
SIZE_W, SIZE_H, devPitchA);
if (status != cudaSuccess) {
printf("%serror: '%s'(%d) at %s:%d%s\n", KRED, cudaGetErrorString(status),
status,__FILE__, __LINE__, KNRM);
failed("API returned error code.");
}
#else
HIPCHECK(hipBindTexture2D(&tex_ofs, &tex, devPtrA, &tex.channelDesc,
SIZE_W, SIZE_H, devPitchA));
#endif
HIPCHECK(hipMalloc((void**)&devPtrB, SIZE_W*sizeof(TYPE_t)*SIZE_H)) ;
hipLaunchKernelGGL(texture2dCopyKernel, dim3(4,4,1), dim3(32,32,1), 0, 0, devPtrB);