From 8e9541dbbdc75b95143feddcd732ce443b8f66bf Mon Sep 17 00:00:00 2001 From: Satyanvesh Dittakavi Date: Fri, 13 May 2022 10:38:16 +0000 Subject: [PATCH] SWDEV-334908 - Guard the __noinline__ macro as it is also supported as keyword by clang Change-Id: I314b3ac463ea63132a5107f4f24ce769d8112b9b [ROCm/clr commit: 8dfa7e7f989daa2a4a7c753ad978e1ae033f6794] --- projects/clr/hipamd/include/hip/amd_detail/host_defines.h | 5 ++++- projects/clr/hipamd/src/hiprtc/cmake/HIPRTC.cmake | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/projects/clr/hipamd/include/hip/amd_detail/host_defines.h b/projects/clr/hipamd/include/hip/amd_detail/host_defines.h index 6c3438311d..5a89433c04 100644 --- a/projects/clr/hipamd/include/hip/amd_detail/host_defines.h +++ b/projects/clr/hipamd/include/hip/amd_detail/host_defines.h @@ -1,5 +1,5 @@ /* -Copyright (c) 2015 - 2021 Advanced Micro Devices, Inc. All rights reserved. +Copyright (c) 2015 - 2022 Advanced Micro Devices, Inc. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -47,7 +47,10 @@ THE SOFTWARE. #define __constant__ __attribute__((constant)) #endif // !__CLANG_HIP_RUNTIME_WRAPPER_INCLUDED__ +#if !defined(__has_feature) || !__has_feature(cuda_noinline_keyword) #define __noinline__ __attribute__((noinline)) +#endif + #define __forceinline__ inline __attribute__((always_inline)) #if __HIP_NO_IMAGE_SUPPORT diff --git a/projects/clr/hipamd/src/hiprtc/cmake/HIPRTC.cmake b/projects/clr/hipamd/src/hiprtc/cmake/HIPRTC.cmake index 209a484e3c..ddafe6002d 100644 --- a/projects/clr/hipamd/src/hiprtc/cmake/HIPRTC.cmake +++ b/projects/clr/hipamd/src/hiprtc/cmake/HIPRTC.cmake @@ -35,7 +35,9 @@ function(get_hiprtc_macros HIPRTC_DEFINES) #define __constant__ __attribute__((constant))\n\ #define __shared__ __attribute__((shared))\n\ #define __align__(x) __attribute__((aligned(x)))\n\ +#if !defined(__has_feature) || !__has_feature(cuda_noinline_keyword)\n\ #define __noinline__ __attribute__((noinline))\n\ +#endif\n\ #define __forceinline__ inline __attribute__((always_inline))\n\ #define launch_bounds_impl0(requiredMaxThreadsPerBlock) \\\n\