From e1802c292cef568b030d0510bfdfef4430976c7f Mon Sep 17 00:00:00 2001 From: Maneesh Gupta Date: Tue, 16 Feb 2021 00:09:32 -0500 Subject: [PATCH] SWDEV-271416 - Keep HIP_DYNAMIC_SHARED macro for compat with existing HIP apps Change-Id: I536e0c65d6e8696cbc369082350834abd710abca [ROCm/hip commit: debceab2a8e93319a0027a5b64d5d6614b2a7931] --- projects/hip/include/hip/amd_detail/device_functions.h | 7 +++++++ projects/hip/include/hip/nvidia_detail/hip_runtime.h | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/projects/hip/include/hip/amd_detail/device_functions.h b/projects/hip/include/hip/amd_detail/device_functions.h index e476a1a013..0e37e256df 100644 --- a/projects/hip/include/hip/amd_detail/device_functions.h +++ b/projects/hip/include/hip/amd_detail/device_functions.h @@ -1238,6 +1238,13 @@ unsigned __smid(void) return (se_id << HW_ID_CU_ID_SIZE) + cu_id; } +/** + * Map HIP_DYNAMIC_SHARED to "extern __shared__" for compatibility with old HIP applications + * To be removed in a future release. + */ +#define HIP_DYNAMIC_SHARED(type, var) extern __shared__ type var[]; +#define HIP_DYNAMIC_SHARED_ATTRIBUTE + #endif //defined(__clang__) && defined(__HIP__) diff --git a/projects/hip/include/hip/nvidia_detail/hip_runtime.h b/projects/hip/include/hip/nvidia_detail/hip_runtime.h index dfe41cf3c3..a42fecc611 100644 --- a/projects/hip/include/hip/nvidia_detail/hip_runtime.h +++ b/projects/hip/include/hip/nvidia_detail/hip_runtime.h @@ -95,6 +95,13 @@ typedef int hipLaunchParm; #define HIP_SYMBOL(X) &X +/** + * Map HIP_DYNAMIC_SHARED to "extern __shared__" for compatibility with old HIP applications + * To be removed in a future release. + */ +#define HIP_DYNAMIC_SHARED(type, var) extern __shared__ type var[]; +#define HIP_DYNAMIC_SHARED_ATTRIBUTE + #ifdef __HIP_DEVICE_COMPILE__ #define abort_() \ { asm("trap;"); }