Fixing ROCProfilerV2 to match versioning changes in HIP Runtime

Change-Id: Ifb0f98356acebcb7cf5372340b36178de000405d
This commit is contained in:
Ammar ELWazir
2023-11-07 20:55:35 +00:00
کامیت شده توسط Ammar ELWazir
والد 137aef0419
کامیت a59d56f9bc
6فایلهای تغییر یافته به همراه17 افزوده شده و 5 حذف شده
+2 -2
مشاهده پرونده
@@ -128,13 +128,13 @@ find_file(
list(TRANSFORM HIP_INCLUDE_DIRS PREPEND -I)
add_custom_command(
OUTPUT hip_erts.yaml hip_begin.cpp.i hip_end.cpp.i
COMMAND ${CMAKE_C_COMPILER} ${HIP_INCLUDE_DIRS} -E "${HIP_RUNTIME_API_H}"
COMMAND ${CMAKE_C_COMPILER} ${HIP_INCLUDE_DIRS} -E "${PROJECT_SOURCE_DIR}/src/core/session/tracer/src/hip_full_api.h"
-D__HIP_PLATFORM_AMD__=1 -D__HIP_ROCclr__=1 -o hip_runtime_api.h.i
COMMAND cat hip_runtime_api.h.i "${HIP_PROF_STR_H}" > hip_input.h
BYPRODUCTS hip_runtime_api.h.i hip_input.h
COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/gen_api_files.py" hip
hip_input.h
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/gen_api_files.py" "${HIP_RUNTIME_API_H}"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/gen_api_files.py" "${PROJECT_SOURCE_DIR}/src/core/session/tracer/src/hip_full_api.h"
"${HIP_PROF_STR_H}"
COMMENT "Generating HIP API files for the `ctf` plugin...")
@@ -212,6 +212,15 @@ def gen_cppheader(infilepath, outfilepath, rank):
+ apiname
+ "_OSTREAM_OPS_H_\n"
+ "\n"
)
if apiname.upper() == 'HIP':
header_s = (
header_s
+ "#include <hip/hip_runtime.h>\n"
+ "#include <hip/hip_deprecated.h>\n"
)
header_s = (
header_s
+ '#include "src/core/session/tracer/src/roctracer.h"\n'
+ "\n"
+ "#ifdef __cplusplus\n"
+1 -1
مشاهده پرونده
@@ -142,7 +142,7 @@ add_custom_command(
COMMAND
${CMAKE_C_COMPILER}
"$<$<BOOL:${HIP_INCLUDE_DIRECTORIES}>:-I$<JOIN:${HIP_INCLUDE_DIRECTORIES},$<SEMICOLON>-I>>"
-E "${HIP_RUNTIME_API_H}" -D__HIP_PLATFORM_AMD__=1 -D__HIP_ROCclr__=1 -o
-E "${PROJECT_SOURCE_DIR}/src/core/session/tracer/src/hip_full_api.h" -D__HIP_PLATFORM_AMD__=1 -D__HIP_ROCclr__=1 -o
hip_runtime_api.h.i
BYPRODUCTS hip_runtime_api.h.i
COMMAND ${Python3_EXECUTABLE} ${PROJECT_SOURCE_DIR}/script/gen_ostream_ops.py -in
@@ -0,0 +1,2 @@
#include <hip/hip_runtime_api.h>
#include <hip/hip_deprecated.h>
@@ -22,6 +22,7 @@
#define SRC_TOOLS_TRACER_SRC_ROCTRACER_H_
#include <hip/hip_runtime.h>
#include <hip/hip_deprecated.h>
#include <hsa/hsa.h>
#include <hsa/hsa_ext_amd.h>
#include <stddef.h>
@@ -174,12 +174,12 @@ add_custom_command(
COMMAND
${CMAKE_C_COMPILER}
"$<$<BOOL:${HIP_INCLUDE_DIRECTORIES}>:-I$<JOIN:${HIP_INCLUDE_DIRECTORIES},$<SEMICOLON>-I>>"
-E "${HIP_RUNTIME_API_H}" -D__HIP_PLATFORM_AMD__=1 -D__HIP_ROCclr__=1 -o
-E "${PROJECT_SOURCE_DIR}/src/core/session/tracer/src/hip_full_api.h" -D__HIP_PLATFORM_AMD__=1 -D__HIP_ROCclr__=1 -o
hip_runtime_api.h.i
BYPRODUCTS hip_runtime_api.h.i
COMMAND ${Python3_EXECUTABLE} ${PROJECT_SOURCE_DIR}/script/gen_ostream_ops.py -in
hip_runtime_api.h.i -out hip_ostream_ops.h > /dev/null
DEPENDS ${PROJECT_SOURCE_DIR}/script/gen_ostream_ops.py "${HIP_RUNTIME_API_H}"
DEPENDS ${PROJECT_SOURCE_DIR}/script/gen_ostream_ops.py "${PROJECT_SOURCE_DIR}/src/core/session/tracer/src/hip_full_api.h"
COMMENT "Generating hip_ostream_ops.h..."
COMMAND_EXPAND_LISTS)