From cbb5c63dd674eddba5c4cd56df7ccca5c9797cd9 Mon Sep 17 00:00:00 2001 From: Evgeny Mankov Date: Thu, 22 Jun 2017 21:53:32 +0300 Subject: [PATCH] [HIPIFY] Sync more CUDA Driver API functions. + 4.14. Event Management + 4.15. Execution Control ToDo: 4.16 - 4.31 modules of CUDA Driver API. --- .../CUDA_Driver_API_functions_supported_by_HIP.md | 11 ++++++++++- hipamd/hipify-clang/src/Cuda2Hip.cpp | 4 ++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/hipamd/docs/markdown/CUDA_Driver_API_functions_supported_by_HIP.md b/hipamd/docs/markdown/CUDA_Driver_API_functions_supported_by_HIP.md index 0b3bb540bf..d797b31832 100644 --- a/hipamd/docs/markdown/CUDA_Driver_API_functions_supported_by_HIP.md +++ b/hipamd/docs/markdown/CUDA_Driver_API_functions_supported_by_HIP.md @@ -583,12 +583,21 @@ | **CUDA** | **HIP** | **CUDA description** | |-----------------------------------------------------------|-------------------------------|--------------------------------------------------------------------------------------------------------------------------------| - +| `cuEventCreate` | `hipEventCreate` | Creates an event. | +| `cuEventDestroy` | `hipEventDestroy` | Destroys an event. | +| `cuEventElapsedTime` | `hipEventElapsedTime` | Computes the elapsed time between two events. | +| `cuEventQuery` | `hipEventQuery` | Queries an event's status. | +| `cuEventRecord` | `hipEventRecord` | Records an event. | +| `cuEventSynchronize` | `hipEventSynchronize` | Waits for an event to complete. | ## **15. Execution Control** | **CUDA** | **HIP** | **CUDA description** | |-----------------------------------------------------------|-------------------------------|--------------------------------------------------------------------------------------------------------------------------------| +| `cuFuncGetAttribute` | | Returns information about a function. | +| `cuFuncSetCacheConfig` | `hipFuncSetCacheConfig` | Sets the preferred cache configuration for a device function. | +| `cuFuncSetSharedMemConfig` | | Sets the shared memory configuration for a device function. | +| `cuLaunchKernel` | `hipModuleLaunchKernel` | Launches a CUDA function. | ## **16. Execution Control [DEPRECATED]** diff --git a/hipamd/hipify-clang/src/Cuda2Hip.cpp b/hipamd/hipify-clang/src/Cuda2Hip.cpp index 7f9fefa7f9..9b58173899 100644 --- a/hipamd/hipify-clang/src/Cuda2Hip.cpp +++ b/hipamd/hipify-clang/src/Cuda2Hip.cpp @@ -987,6 +987,10 @@ struct cuda2hipMap { cuda2hipRename["cuEventRecord"] = {"hipEventRecord", CONV_EVENT, API_DRIVER}; cuda2hipRename["cuEventSynchronize"] = {"hipEventSynchronize", CONV_EVENT, API_DRIVER}; + // Execution Control + cuda2hipRename["cuFuncGetAttribute"] = {"hipFuncGetAttribute", CONV_MODULE, API_DRIVER, HIP_UNSUPPORTED}; + cuda2hipRename["cuFuncSetCacheConfig"] = {"hipFuncSetCacheConfig", CONV_MODULE, API_DRIVER}; + cuda2hipRename["cuFuncSetSharedMemConfig"] = {"hipFuncSetSharedMemConfig", CONV_MODULE, API_DRIVER, HIP_UNSUPPORTED}; cuda2hipRename["cuLaunchKernel"] = {"hipModuleLaunchKernel", CONV_MODULE, API_DRIVER}; // Streams