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


[ROCm/clr commit: 912cc407a4]
Этот коммит содержится в:
Satyanvesh Dittakavi
2023-12-07 14:40:00 +00:00
родитель f969d89aa4
Коммит a374f74baa
+11 -11
Просмотреть файл
@@ -27,12 +27,7 @@
function(get_hiprtc_macros HIPRTC_DEFINES)
set(${HIPRTC_DEFINES}
"#pragma clang diagnostic push\n\
#pragma clang diagnostic ignored \"-Wreserved-id-macro\"\n\
#pragma clang diagnostic ignored \"-Wc++98-compat-pedantic\"\n\
#pragma clang diagnostic ignored \"-Wreserved-macro-identifier\"\n\
#pragma clang diagnostic ignored \"-Wundef\"\n\
#define __device__ __attribute__((device))\n\
"#define __device__ __attribute__((device))\n\
#define __host__ __attribute__((host))\n\
#define __global__ __attribute__((global))\n\
#define __constant__ __attribute__((constant))\n\
@@ -70,8 +65,7 @@ namespace std {\n\
using ::ptrdiff_t;\n\
using ::clock_t;\n\
}\n\
#endif // __HIP_NO_STD_DEFS__\n\
#pragma clang diagnostic pop"
#endif // __HIP_NO_STD_DEFS__\n"
PARENT_SCOPE)
endfunction(get_hiprtc_macros)
@@ -79,21 +73,27 @@ endfunction(get_hiprtc_macros)
if(HIPRTC_ADD_MACROS)
# Read the existing content of the preprocessed file into a temporary variable
FILE(READ "${HIPRTC_PREPROCESSED_FILE}" ORIGINAL_PREPROCESSED_FILE)
# Prepend the pragma to the original content
set(MODIFIED_PREPROCESSED_FILE "#pragma clang diagnostic ignored \"-Weverything\"
# Prepend the push and ignore pragmas to the original preprocessed file
set(PRAGMA_PUSH "#pragma clang diagnostic push")
set(PRAGMA_EVERYTHING "#pragma clang diagnostic ignored \"-Weverything\"")
set(MODIFIED_PREPROCESSED_FILE "${PRAGMA_PUSH}\n${PRAGMA_EVERYTHING}
\n${ORIGINAL_PREPROCESSED_FILE}")
# Write the modified preprocessed content back to the original file
FILE(WRITE ${HIPRTC_PREPROCESSED_FILE} "${MODIFIED_PREPROCESSED_FILE}")
message(STATUS "Appending hiprtc macros to ${HIPRTC_PREPROCESSED_FILE}.")
get_hiprtc_macros(HIPRTC_DEFINES)
FILE(APPEND ${HIPRTC_PREPROCESSED_FILE} "${HIPRTC_DEFINES}")
set(HIPRTC_HEADER_LIST ${HIPRTC_HEADERS})
separate_arguments(HIPRTC_HEADER_LIST)
# appends all the headers from the list to the hiprtc preprocessed file
# Appends all the headers from the list to the hiprtc preprocessed file
foreach(header ${HIPRTC_HEADER_LIST})
FILE(READ "${header}" HEADER_FILE)
FILE(APPEND ${HIPRTC_PREPROCESSED_FILE} "${HEADER_FILE}")
endforeach()
# Append the pop pragma to the preprocessed file
set(PRAGMA_POP "#pragma clang diagnostic pop\n")
FILE(APPEND ${HIPRTC_PREPROCESSED_FILE} "${PRAGMA_POP}")
endif()
macro(generate_hiprtc_header HiprtcHeader)