Skip to content

Commit 912cc40

Browse files
committed
SWDEV-432684 - SWDEV-433437 - Fix test_gpu_jit MIGraphx test failure
Add clang pragma push and pop diagnostics for ignoring "-Weverything" in the hiprtc builtins header. Otherwise this will ignore even the geniune errors occurring in the hiprtc kernels. Change-Id: I8c3dacf902732b2ea495d83e797369f8aebd75d6
1 parent 058b270 commit 912cc40

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

hipamd/src/hiprtc/cmake/HIPRTC.cmake

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,7 @@
2727

2828
function(get_hiprtc_macros HIPRTC_DEFINES)
2929
set(${HIPRTC_DEFINES}
30-
"#pragma clang diagnostic push\n\
31-
#pragma clang diagnostic ignored \"-Wreserved-id-macro\"\n\
32-
#pragma clang diagnostic ignored \"-Wc++98-compat-pedantic\"\n\
33-
#pragma clang diagnostic ignored \"-Wreserved-macro-identifier\"\n\
34-
#pragma clang diagnostic ignored \"-Wundef\"\n\
35-
#define __device__ __attribute__((device))\n\
30+
"#define __device__ __attribute__((device))\n\
3631
#define __host__ __attribute__((host))\n\
3732
#define __global__ __attribute__((global))\n\
3833
#define __constant__ __attribute__((constant))\n\
@@ -70,30 +65,35 @@ namespace std {\n\
7065
using ::ptrdiff_t;\n\
7166
using ::clock_t;\n\
7267
}\n\
73-
#endif // __HIP_NO_STD_DEFS__\n\
74-
#pragma clang diagnostic pop"
68+
#endif // __HIP_NO_STD_DEFS__\n"
7569
PARENT_SCOPE)
7670
endfunction(get_hiprtc_macros)
7771

7872
# To allow concatenating above macros during build time, call this file in script mode.
7973
if(HIPRTC_ADD_MACROS)
8074
# Read the existing content of the preprocessed file into a temporary variable
8175
FILE(READ "${HIPRTC_PREPROCESSED_FILE}" ORIGINAL_PREPROCESSED_FILE)
82-
# Prepend the pragma to the original content
83-
set(MODIFIED_PREPROCESSED_FILE "#pragma clang diagnostic ignored \"-Weverything\"
76+
# Prepend the push and ignore pragmas to the original preprocessed file
77+
set(PRAGMA_PUSH "#pragma clang diagnostic push")
78+
set(PRAGMA_EVERYTHING "#pragma clang diagnostic ignored \"-Weverything\"")
79+
set(MODIFIED_PREPROCESSED_FILE "${PRAGMA_PUSH}\n${PRAGMA_EVERYTHING}
8480
\n${ORIGINAL_PREPROCESSED_FILE}")
8581
# Write the modified preprocessed content back to the original file
8682
FILE(WRITE ${HIPRTC_PREPROCESSED_FILE} "${MODIFIED_PREPROCESSED_FILE}")
83+
8784
message(STATUS "Appending hiprtc macros to ${HIPRTC_PREPROCESSED_FILE}.")
8885
get_hiprtc_macros(HIPRTC_DEFINES)
8986
FILE(APPEND ${HIPRTC_PREPROCESSED_FILE} "${HIPRTC_DEFINES}")
9087
set(HIPRTC_HEADER_LIST ${HIPRTC_HEADERS})
9188
separate_arguments(HIPRTC_HEADER_LIST)
92-
# appends all the headers from the list to the hiprtc preprocessed file
89+
# Appends all the headers from the list to the hiprtc preprocessed file
9390
foreach(header ${HIPRTC_HEADER_LIST})
9491
FILE(READ "${header}" HEADER_FILE)
9592
FILE(APPEND ${HIPRTC_PREPROCESSED_FILE} "${HEADER_FILE}")
9693
endforeach()
94+
# Append the pop pragma to the preprocessed file
95+
set(PRAGMA_POP "#pragma clang diagnostic pop\n")
96+
FILE(APPEND ${HIPRTC_PREPROCESSED_FILE} "${PRAGMA_POP}")
9797
endif()
9898

9999
macro(generate_hiprtc_header HiprtcHeader)

0 commit comments

Comments
 (0)