SWDEV-437090: move the __hip_assert macro to a common place

It cannot be moved to amd_device_functions.h because that causes circular
dependences when trying to use the macro in other files. So we create a new
header and move all assert/abort macros to that common header.

As a side-effect, also fix the macro to correctly expand the entire condition
argument, and also consume the trailing semicolon.

Change-Id: I43688c8e61183503a3a1a039b91321a3779152af


[ROCm/clr commit: 7137a296dd]
This commit is contained in:
Sameer Sahasrabuddhe
2023-12-12 11:43:58 +05:30
committad av Sameer Sahasrabuddhe
förälder 3789c40cb5
incheckning 4cf2b1cfd1
4 ändrade filer med 110 tillägg och 91 borttagningar
+2 -1
Visa fil
@@ -132,6 +132,8 @@ set(HIPRTC_GEN_OBJ "${HIPRTC_GEN_DIR}/hipRTC_header${CMAKE_CXX_OUTPUT_EXTENSION}
# list of headers which needs to be appended to the hiprtc preprocessed file
set(HIPRTC_HEADERS
${HIP_COMMON_INCLUDE_DIR}/hip/hip_common.h
${PROJECT_SOURCE_DIR}/include/hip/amd_detail/device_library_decls.h
${PROJECT_SOURCE_DIR}/include/hip/amd_detail/hip_assert.h
${HIP_COMMON_INCLUDE_DIR}/hip/library_types.h
${HIP_COMMON_INCLUDE_DIR}/hip/driver_types.h
${HIP_COMMON_INCLUDE_DIR}/hip/surface_types.h
@@ -144,7 +146,6 @@ ${PROJECT_SOURCE_DIR}/include/hip/amd_detail/amd_surface_functions.h
${PROJECT_SOURCE_DIR}/include/hip/amd_detail/amd_hip_complex.h
${PROJECT_SOURCE_DIR}/include/hip/amd_detail/amd_hip_math_constants.h
${PROJECT_SOURCE_DIR}/include/hip/amd_detail/math_fwd.h
${PROJECT_SOURCE_DIR}/include/hip/amd_detail/device_library_decls.h
${PROJECT_SOURCE_DIR}/include/hip/amd_detail/amd_device_functions.h
${PROJECT_SOURCE_DIR}/include/hip/amd_detail/amd_warp_functions.h
${PROJECT_SOURCE_DIR}/include/hip/amd_detail/hip_cooperative_groups_helper.h