Skip to content

Commit

Permalink
Fixing ROCTracer to match versioning changes in HIP Runtime
Browse files Browse the repository at this point in the history
Change-Id: Ibde2419314824f12acb4cf51dc675cb14a51851c
  • Loading branch information
ammarwa authored and gargrahul committed Nov 13, 2023
1 parent 428469f commit 65eb55b
Show file tree
Hide file tree
Showing 11 changed files with 367 additions and 357 deletions.
1 change: 1 addition & 0 deletions inc/roctracer_hip.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "roctracer.h"

#include <hip/hip_runtime.h>
#include <hip/hip_deprecated.h>
#include "hip_ostream_ops.h"
#include <hip/amd_detail/hip_prof_str.h>

Expand Down
9 changes: 8 additions & 1 deletion script/gen_ostream_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,14 @@ def gen_cppheader(infilepath, outfilepath, rank):
header_s = \
'#ifndef INC_' + apiname + '_OSTREAM_OPS_H_\n' + \
'#define INC_' + apiname + '_OSTREAM_OPS_H_\n' + \
'\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 "roctracer.h"\n' + \
'\n' + \
'#ifdef __cplusplus\n' + \
Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ find_file(HIP_RUNTIME_API_H hip_runtime_api.h
add_custom_command(
OUTPUT hip_ostream_ops.h
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 hip_runtime_api.h.i
-E "${CMAKE_CURRENT_SOURCE_DIR}/roctracer/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
Expand Down
2 changes: 2 additions & 0 deletions src/roctracer/hip_full_api.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#include <hip/hip_runtime_api.h>
#include <hip/hip_deprecated.h>
2 changes: 1 addition & 1 deletion test/golden_traces/MatrixTranspose_hip_flush_trace.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
ROCtracer (35331):
ROCtracer: trace control flush rate(100000us)
HIP-trace(*)
6503209734529563:6503209734531917 35331:35331 hipGetDeviceProperties(props={pageableMemoryAccessUsesHostPageTables=0, pageableMemoryAccess=0, concurrentManagedAccess=1, directManagedMemAccessFromHost=0, managedMemory=1, asicRevision=1, isLargeBar=1, cooperativeMultiDeviceUnmatchedSharedMem=1, cooperativeMultiDeviceUnmatchedBlockDim=1, cooperativeMultiDeviceUnmatchedGridDim=1, cooperativeMultiDeviceUnmatchedFunc=1, tccDriver=0, ECCEnabled=0, kernelExecTimeoutEnabled=0, texturePitchAlignment=256, textureAlignment=256, memPitch=2147483647, hdpRegFlushCntl=0x7f1f3948c004, hdpMemFlushCntl=0x7f1f3948c000, maxTexture3D=0x7f1e76c31318, maxTexture2D=0x7f1e76c31310, maxTexture1D=16384, maxTexture1DLinear=2147483647, cooperativeMultiDeviceLaunch=1, cooperativeLaunch=1, integrated=0, gcnArchName="gfx90a:sramecc+:xnack-", gcnArch=910, canMapHostMemory=1, isMultiGpuBoard=0, maxSharedMemoryPerMultiProcessor=65536, pciDeviceID=0, pciBusID=74, pciDomainID=0, concurrentKernels=1, arch={}, clockInstructionRate=1000000, computeMode=0, maxThreadsPerMultiProcessor=2048, l2CacheSize=8388608, multiProcessorCount=104, minor=0, major=9, totalConstMem=2147483647, memoryBusWidth=4096, memoryClockRate=1600000, clockRate=1700000, maxGridSize=0x7f1e76c31198, maxThreadsDim=0x7f1e76c3118c, maxThreadsPerBlock=1024, warpSize=64, regsPerBlock=65536, sharedMemPerBlock=65536, totalGlobalMem=68702699520, name="AMD Instinct MI210"}, device=0) :1
6503209734529563:6503209734531917 35331:35331 hipGetDevicePropertiesR0600(props={pageableMemoryAccessUsesHostPageTables=0, pageableMemoryAccess=0, concurrentManagedAccess=1, directManagedMemAccessFromHost=0, managedMemory=1, asicRevision=1, isLargeBar=1, cooperativeMultiDeviceUnmatchedSharedMem=1, cooperativeMultiDeviceUnmatchedBlockDim=1, cooperativeMultiDeviceUnmatchedGridDim=1, cooperativeMultiDeviceUnmatchedFunc=1, tccDriver=0, ECCEnabled=0, kernelExecTimeoutEnabled=0, texturePitchAlignment=256, textureAlignment=256, memPitch=2147483647, hdpRegFlushCntl=0x7f1f3948c004, hdpMemFlushCntl=0x7f1f3948c000, maxTexture3D=0x7f1e76c31318, maxTexture2D=0x7f1e76c31310, maxTexture1D=16384, maxTexture1DLinear=2147483647, cooperativeMultiDeviceLaunch=1, cooperativeLaunch=1, integrated=0, gcnArchName="gfx90a:sramecc+:xnack-", gcnArch=910, canMapHostMemory=1, isMultiGpuBoard=0, maxSharedMemoryPerMultiProcessor=65536, pciDeviceID=0, pciBusID=74, pciDomainID=0, concurrentKernels=1, arch={}, clockInstructionRate=1000000, computeMode=0, maxThreadsPerMultiProcessor=2048, l2CacheSize=8388608, multiProcessorCount=104, minor=0, major=9, totalConstMem=2147483647, memoryBusWidth=4096, memoryClockRate=1600000, clockRate=1700000, maxGridSize=0x7f1e76c31198, maxThreadsDim=0x7f1e76c3118c, maxThreadsPerBlock=1024, warpSize=64, regsPerBlock=65536, sharedMemPerBlock=65536, totalGlobalMem=68702699520, name="AMD Instinct MI210"}, device=0) :1
6503209735378958:6503209735406670 35331:35331 hipMalloc(ptr=0x7f19f7a00000, size=4194304) :2
6503209735407101:6503209735423080 35331:35331 hipMalloc(ptr=0x7f19f7400000, size=4194304) :3
6503209978814181:6503209979619458 2:0 CopyHostToDevice:4:35331
Expand Down
2 changes: 1 addition & 1 deletion test/golden_traces/MatrixTranspose_hip_period_trace.txt
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ PASSED!
PASSED!
## Iteration (0) #################
PASSED!
3802699751533941:3802699751541991 1983:1983 hipGetDeviceProperties(props=, device=0)
3802699751533941:3802699751541991 1983:1983 hipGetDevicePropertiesR0600(props=, device=0)
3802699752571489:3802699752686289 1983:1983 hipMalloc(ptr=0x7f6c121ff010, size=4194304)
3802699752688639:3802699752749390 1983:1983 hipMalloc(ptr=0x7fffefcadf28, size=4194304)
3802699752763840:3802700027958750 1983:1983 hipMemcpy(dst=0x7f6c11400000, src=0x7f6c121ff010, sizeBytes=4194304, kind=1)
Expand Down
Loading

0 comments on commit 65eb55b

Please sign in to comment.