From 643eb7ace71f4980059231d4b2f0fd832a77f8fd Mon Sep 17 00:00:00 2001 From: Evgeny Mankov Date: Thu, 5 Oct 2017 16:38:36 +0300 Subject: [PATCH] [HIPIFY] CUDA RT Textures and Arrays support update [ROCm/hip commit: 53ce40ebab5a608dee7d8ba159664d00f76f186a] --- ..._Runtime_API_functions_supported_by_HIP.md | 23 ++++++++++++------- projects/hip/hipify-clang/src/Cuda2Hip.cpp | 14 +++++++++++ 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/projects/hip/docs/markdown/CUDA_Runtime_API_functions_supported_by_HIP.md b/projects/hip/docs/markdown/CUDA_Runtime_API_functions_supported_by_HIP.md index 73994026e3..f27f1538b7 100644 --- a/projects/hip/docs/markdown/CUDA_Runtime_API_functions_supported_by_HIP.md +++ b/projects/hip/docs/markdown/CUDA_Runtime_API_functions_supported_by_HIP.md @@ -135,7 +135,7 @@ | `cudaMemcpy` | `hipMemcpy` | | `cudaMemcpy2D` | `hipMemcpy2D` | | `cudaMemcpy2DArrayToArray` | | -| `cudaMemcpy2DAsync` | | +| `cudaMemcpy2DAsync` | `hipMemcpy2DAsync` | | `cudaMemcpy2DFromArray` | | | `cudaMemcpy2DFromArrayAsync` | | | `cudaMemcpy2DToArray` | `hipMemcpy2DToArray` | @@ -743,17 +743,17 @@ | typedef | `cudaStream_t` | `hipStream_t` | | typedef | `cudaStreamCallback_t` | `hipStreamCallback_t` | | typedef | `cudaSurfaceObject_t` | | -| typedef | `cudaTextureObject_t` | | +| typedef | `cudaTextureObject_t` | `hipTextureObject_t` | | typedef | `CUuuid_stcudaUUID_t` | | | define | `CUDA_IPC_HANDLE_SIZE` | | -| define | `cudaArrayCubemap` | | -| define | `cudaArrayDefault` | | -| define | `cudaArrayLayered` | | -| define | `cudaArraySurfaceLoadStore` | | -| define | `cudaArrayTextureGather` | | +| define | `cudaArrayCubemap` | `hipArrayCubemap` | +| define | `cudaArrayDefault` | `hipArrayDefault` | +| define | `cudaArrayLayered` | `hipArrayLayered` | +| define | `cudaArraySurfaceLoadStore` | `hipArraySurfaceLoadStore` | +| define | `cudaArrayTextureGather` | `hipArrayTextureGather` | | define | `cudaDeviceBlockingSync` | `hipDeviceScheduleBlockingSync` | | define | `cudaDeviceLmemResizeToMax` | | -| define | `cudaDeviceMapHost` | | +| define | `cudaDeviceMapHost` | `hipDeviceMapHost` | | define | `cudaDeviceMask` | | | define | `cudaDevicePropDontCare` | | | define | `cudaDeviceScheduleAuto` | `hipDeviceScheduleAuto` | @@ -783,3 +783,10 @@ | define | `cudaStreamLegacy` | | | define | `cudaStreamNonBlocking` | `hipStreamNonBlocking` | | define | `cudaStreamPerThread` | | +| define | `cudaTextureType1D` | `hipTextureType1D` | +| define | `cudaTextureType2D` | `hipTextureType2D` | +| define | `cudaTextureType3D` | `hipTextureType3D` | +| define | `cudaTextureTypeCubemap` | `hipTextureTypeCubemap` | +| define | `cudaTextureType1DLayered` | `hipTextureType1DLayered` | +| define | `cudaTextureType2DLayered` | `hipTextureType2DLayered` | +| define | `cudaTextureTypeCubemapLayered` | `hipTextureTypeCubemapLayered` | diff --git a/projects/hip/hipify-clang/src/Cuda2Hip.cpp b/projects/hip/hipify-clang/src/Cuda2Hip.cpp index 553ea5d8af..1f49313b56 100644 --- a/projects/hip/hipify-clang/src/Cuda2Hip.cpp +++ b/projects/hip/hipify-clang/src/Cuda2Hip.cpp @@ -1379,6 +1379,12 @@ struct cuda2hipMap { cuda2hipRename["cudaMipmappedArray_t"] = {"hipMipmappedArray_t", CONV_MEM, API_RUNTIME}; cuda2hipRename["cudaMipmappedArray_const_t"] = {"hipMipmappedArray_const_t", CONV_MEM, API_RUNTIME}; + cuda2hipRename["cudaArrayDefault"] = {"hipArrayDefault", CONV_MEM, API_RUNTIME}; // 0x00 + cuda2hipRename["cudaArrayLayered"] = {"hipArrayLayered", CONV_MEM, API_RUNTIME}; // 0x01 // Unsupported yet on NVCC path + cuda2hipRename["cudaArraySurfaceLoadStore"] = {"hipArraySurfaceLoadStore", CONV_MEM, API_RUNTIME}; // 0x02 // Unsupported yet on NVCC path + cuda2hipRename["cudaArrayCubemap"] = {"hipArrayCubemap", CONV_MEM, API_RUNTIME}; // 0x04 // Unsupported yet on NVCC path + cuda2hipRename["cudaArrayTextureGather"] = {"hipArrayTextureGather", CONV_MEM, API_RUNTIME}; // 0x08 // Unsupported yet on NVCC path + // memcpy // memcpy structs cuda2hipRename["cudaMemcpy3DParms"] = {"hipMemcpy3DParms", CONV_MEM, API_RUNTIME}; @@ -1903,6 +1909,14 @@ struct cuda2hipMap { cuda2hipRename["cudaAddressModeMirror"] = {"hipAddressModeMirror", CONV_TEX, API_RUNTIME}; cuda2hipRename["cudaAddressModeBorder"] = {"hipAddressModeBorder", CONV_TEX, API_RUNTIME}; + cuda2hipRename["cudaTextureType1D"] = {"hipTextureType1D", CONV_TEX, API_RUNTIME}; // 0x01 // Unsupported yet on NVCC path + cuda2hipRename["cudaTextureType2D"] = {"hipTextureType2D", CONV_TEX, API_RUNTIME}; // 0x02 + cuda2hipRename["cudaTextureType3D"] = {"hipTextureType3D", CONV_TEX, API_RUNTIME}; // 0x03 // Unsupported yet on NVCC path + cuda2hipRename["cudaTextureTypeCubemap"] = {"hipTextureTypeCubemap", CONV_TEX, API_RUNTIME}; // 0x0C // Unsupported yet on NVCC path + cuda2hipRename["cudaTextureType1DLayered"] = {"hipTextureType1DLayered", CONV_TEX, API_RUNTIME}; // 0xF1 // Unsupported yet on NVCC path + cuda2hipRename["cudaTextureType2DLayered"] = {"hipTextureType2DLayered", CONV_TEX, API_RUNTIME}; // 0xF2 // Unsupported yet on NVCC path + cuda2hipRename["cudaTextureTypeCubemapLayered"] = {"hipTextureTypeCubemapLayered", CONV_TEX, API_RUNTIME}; // 0xFC // Unsupported yet on NVCC path + // functions cuda2hipRename["cudaCreateTextureObject"] = {"hipCreateTextureObject", CONV_TEX, API_RUNTIME}; cuda2hipRename["cudaDestroyTextureObject"] = {"hipDestroyTextureObject", CONV_TEX, API_RUNTIME};