From f81a8bca3a062c47ab806fdc727f009eb368939b Mon Sep 17 00:00:00 2001 From: Maneesh Gupta Date: Wed, 26 Aug 2026 10:53:35 +0000 Subject: [PATCH 01/10] Move HRR into standalone project Move the portable HRR wire format, playback tool, generator, docs, skills, and HRR-owned tests under projects/hrr while keeping runtime capture compiled into CLR.\n\nReplace the hip-tests HRR suite with a smoke-only capture sentinel, add HRR label/CODEOWNERS metadata, and update the decode/triage helper scripts for standalone hrr-playback builds.\n\nCo-Authored-By: Claude --- .github/CODEOWNERS | 7 +- .github/labeler.yml | 4 + projects/clr/hipamd/src/hrr/CMakeLists.txt | 8 +- projects/clr/hipamd/src/hrr/hip_capture.cpp | 2 +- .../hipamd/src/hrr/hip_capture_generated.cpp | 49 +- .../clr/hipamd/src/hrr/hip_capture_writer.h | 2 +- .../hipamd/src/hrr/playback/CMakeLists.txt | 58 - .../scripts/ensure_playback.ps1 | 290 --- .../scripts/ensure_playback.sh | 269 --- .../catch/config/configs/unit/hrr.yaml | 484 +--- .../hip-tests/catch/unit/hrr/CMakeLists.txt | 151 +- .../catch/unit/hrr/hrr_capture_smoke_test.cc | 82 + projects/hip/docs/how-to/debugging.rst | 2 +- projects/hrr/CMakeLists.txt | 34 + projects/{clr/hipamd/src => }/hrr/DESIGN.md | 107 +- projects/{clr/hipamd/src => }/hrr/README.md | 13 +- .../src => hrr/include}/hrr/hrr_api_args.h | 1023 +++++---- projects/hrr/playback/CMakeLists.txt | 65 + .../src => }/hrr/playback/hip_playback.cpp | 2 +- .../src => }/hrr/playback/hip_playback.h | 2 +- .../hrr/playback/hip_playback_generated.cpp | 2014 +++++++++-------- .../src => }/hrr/playback/hrr_playback.cpp | 0 .../src => }/hrr/playback/hrr_reader.cpp | 0 .../hipamd/src => }/hrr/playback/hrr_reader.h | 2 +- .../hrr/skills/decode-and-triage/SKILL.md | 22 +- .../scripts/analyze_replay_finding.py | 0 .../scripts/check_replay_compat.py | 3 +- .../scripts/ensure_playback.ps1 | 192 ++ .../scripts/ensure_playback.sh | 131 ++ .../scripts/replay_docker.sh | 29 +- .../scripts/test_analyze_replay_finding.py | 0 .../scripts/test_check_replay_compat.py | 17 +- .../scripts/triage_archive.ps1 | 8 +- .../scripts/triage_archive.sh | 11 +- projects/hrr/tests/CMakeLists.txt | 38 + projects/hrr/tests/hrr_test_common.hh | 38 + projects/hrr/tests/hrr_test_process.hh | 267 +++ projects/hrr/tests/integration/CMakeLists.txt | 99 + .../integration}/hrr_repro_workload_test.cc | 104 +- .../tests/integration}/hrr_roundtrip_test.cc | 154 +- .../integration}/hrr_spt_workload_test.cc | 38 +- .../tests/integration}/hrr_workload_test.cc | 1652 +++++++------- projects/hrr/tests/unit/CMakeLists.txt | 61 + .../hrr => hrr/tests/unit}/hrr_format_test.cc | 30 +- .../tests/unit}/hrr_playback_test.cc | 6 +- .../tests/unit}/hrr_recovery_test.cc | 22 +- .../src/hrr => hrr/tools}/gen_hrr_api_args.py | 53 +- 47 files changed, 3811 insertions(+), 3834 deletions(-) delete mode 100644 projects/clr/hipamd/src/hrr/playback/CMakeLists.txt delete mode 100644 projects/clr/hipamd/src/hrr/skills/decode-and-triage/scripts/ensure_playback.ps1 delete mode 100755 projects/clr/hipamd/src/hrr/skills/decode-and-triage/scripts/ensure_playback.sh create mode 100644 projects/hip-tests/catch/unit/hrr/hrr_capture_smoke_test.cc create mode 100644 projects/hrr/CMakeLists.txt rename projects/{clr/hipamd/src => }/hrr/DESIGN.md (94%) rename projects/{clr/hipamd/src => }/hrr/README.md (95%) rename projects/{clr/hipamd/src => hrr/include}/hrr/hrr_api_args.h (89%) create mode 100644 projects/hrr/playback/CMakeLists.txt rename projects/{clr/hipamd/src => }/hrr/playback/hip_playback.cpp (99%) rename projects/{clr/hipamd/src => }/hrr/playback/hip_playback.h (99%) rename projects/{clr/hipamd/src => }/hrr/playback/hip_playback_generated.cpp (81%) rename projects/{clr/hipamd/src => }/hrr/playback/hrr_playback.cpp (100%) rename projects/{clr/hipamd/src => }/hrr/playback/hrr_reader.cpp (100%) rename projects/{clr/hipamd/src => }/hrr/playback/hrr_reader.h (99%) rename projects/{clr/hipamd/src => }/hrr/skills/decode-and-triage/SKILL.md (92%) rename projects/{clr/hipamd/src => }/hrr/skills/decode-and-triage/scripts/analyze_replay_finding.py (100%) rename projects/{clr/hipamd/src => }/hrr/skills/decode-and-triage/scripts/check_replay_compat.py (99%) create mode 100644 projects/hrr/skills/decode-and-triage/scripts/ensure_playback.ps1 create mode 100755 projects/hrr/skills/decode-and-triage/scripts/ensure_playback.sh rename projects/{clr/hipamd/src => }/hrr/skills/decode-and-triage/scripts/replay_docker.sh (80%) rename projects/{clr/hipamd/src => }/hrr/skills/decode-and-triage/scripts/test_analyze_replay_finding.py (100%) rename projects/{clr/hipamd/src => }/hrr/skills/decode-and-triage/scripts/test_check_replay_compat.py (95%) rename projects/{clr/hipamd/src => }/hrr/skills/decode-and-triage/scripts/triage_archive.ps1 (98%) rename projects/{clr/hipamd/src => }/hrr/skills/decode-and-triage/scripts/triage_archive.sh (94%) create mode 100644 projects/hrr/tests/CMakeLists.txt create mode 100644 projects/hrr/tests/hrr_test_common.hh create mode 100644 projects/hrr/tests/hrr_test_process.hh create mode 100644 projects/hrr/tests/integration/CMakeLists.txt rename projects/{hip-tests/catch/unit/hrr => hrr/tests/integration}/hrr_repro_workload_test.cc (81%) rename projects/{hip-tests/catch/unit/hrr => hrr/tests/integration}/hrr_roundtrip_test.cc (94%) rename projects/{hip-tests/catch/unit/hrr => hrr/tests/integration}/hrr_spt_workload_test.cc (85%) rename projects/{hip-tests/catch/unit/hrr => hrr/tests/integration}/hrr_workload_test.cc (71%) create mode 100644 projects/hrr/tests/unit/CMakeLists.txt rename projects/{hip-tests/catch/unit/hrr => hrr/tests/unit}/hrr_format_test.cc (95%) rename projects/{hip-tests/catch/unit/hrr => hrr/tests/unit}/hrr_playback_test.cc (92%) rename projects/{hip-tests/catch/unit/hrr => hrr/tests/unit}/hrr_recovery_test.cc (95%) rename projects/{clr/hipamd/src/hrr => hrr/tools}/gen_hrr_api_args.py (97%) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 29bcd1f3517a..29a0f8757411 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -11,10 +11,11 @@ /projects/hipfile/ @ROCm/hipfile-reviewers /projects/hipother/ @ROCm/hipother-reviewers /projects/hip-tests/ @ROCm/hip-tests-reviewers -/projects/rccl/ @ROCm/rccl-reviewers @ROCm/rccl-leads -/projects/rccl/src/include/api_trace.h @ROCm/rccl-reviewers @ROCm/rccl-leads @ROCm/ROCM-DevTools-Team +/projects/hrr/ @andraghetti +/projects/rccl/ @ROCm/rccl-reviewers +/projects/rccl/src/include/api_trace.h @ROCm/rccl-reviewers @ROCm/ROCM-DevTools-Team /projects/rccl/tools/scripts/test_runner/configs/ci-precheckin.json @ROCm/rccl-ci -/projects/rccl-tests/ @ROCm/rccl-reviewers @ROCm/rccl-leads +/projects/rccl-tests/ @ROCm/rccl-reviewers /projects/rdc/ @ROCm/rdc-reviewers /projects/rocm-core/ @nunnikri @frepaul @raramakr @ashutom @amd-isparry @arvindcheru /projects/rocm-core/rdhc/ @nunnikri @frepaul @raramakr @ashutom @amd-isparry @arvindcheru @solaiys diff --git a/.github/labeler.yml b/.github/labeler.yml index 6bf27c4955fc..abbcc2cc71a7 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -32,6 +32,10 @@ - changed-files: - any-glob-to-any-file: 'projects/hip-tests/**/*' +"project: hrr": +- changed-files: + - any-glob-to-any-file: 'projects/hrr/**/*' + "project: rccl": - changed-files: - any-glob-to-any-file: 'projects/rccl/**/*' diff --git a/projects/clr/hipamd/src/hrr/CMakeLists.txt b/projects/clr/hipamd/src/hrr/CMakeLists.txt index d9eff010c178..5b5784e411f5 100644 --- a/projects/clr/hipamd/src/hrr/CMakeLists.txt +++ b/projects/clr/hipamd/src/hrr/CMakeLists.txt @@ -9,10 +9,10 @@ target_sources(amdhip64 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/hip_capture_generated.cpp ) -# hrr_api_args.h and all capture headers live here. +# Capture headers live here; the shared HRR archive wire format now lives in +# projects/hrr/include and is included as "hrr/hrr_api_args.h". +# Playback tools (hrr-playback, hrr_reader) now live in projects/hrr. target_include_directories(amdhip64 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/../../../../hrr/include ) - -# Playback tools (hrr-playback, hrr_reader/hrr_playback libs) -add_subdirectory(playback) diff --git a/projects/clr/hipamd/src/hrr/hip_capture.cpp b/projects/clr/hipamd/src/hrr/hip_capture.cpp index cc8c69f68d51..9d2bacfe533c 100644 --- a/projects/clr/hipamd/src/hrr/hip_capture.cpp +++ b/projects/clr/hipamd/src/hrr/hip_capture.cpp @@ -33,7 +33,7 @@ #include "hip_capture_writer.h" // hrr_api_args.h — for hrr_args_* struct types and hrr_api_id_t enum -#include "hrr_api_args.h" +#include "hrr/hrr_api_args.h" // HIP runtime internals #include "../hip_global.hpp" // hip::asKernel() diff --git a/projects/clr/hipamd/src/hrr/hip_capture_generated.cpp b/projects/clr/hipamd/src/hrr/hip_capture_generated.cpp index c145e51be198..28a2b099ac4e 100644 --- a/projects/clr/hipamd/src/hrr/hip_capture_generated.cpp +++ b/projects/clr/hipamd/src/hrr/hip_capture_generated.cpp @@ -32,8 +32,8 @@ #include "hip_capture.h" #include "hip_capture_writer.h" -// hrr_api_args.h lives in the same directory (hipamd/src/hrr/) -#include "hrr_api_args.h" +// hrr_api_args.h now lives in projects/hrr/include/hrr (shared wire format) +#include "hrr/hrr_api_args.h" #include "hip/amd_detail/hip_api_trace.hpp" @@ -749,6 +749,20 @@ static hipError_t capture_hipDeviceGetLimit(size_t* pValue, enum hipLimit_t limi return r; } +// Generated shim +static hipError_t capture_hipDeviceGetLuid(char* luid, unsigned int* deviceNodeMask, hipDevice_t device) { + hipError_t r = g_real_table.hipDeviceGetLuid_fn(luid, deviceNodeMask, device); + if (r == hipSuccess) { + hrr_args_hipDeviceGetLuid a{}; + a.ret = static_cast(r); + a.luid = reinterpret_cast(luid); + a.deviceNodeMask = reinterpret_cast(deviceNodeMask); + a.device = static_cast(static_cast(device)); + hrr_cap::writer::write_event_raw(HRR_API_HIPDEVICEGETLUID, &a.hdr, sizeof(a)); + } + return r; +} + // Generated shim static hipError_t capture_hipDeviceGetMemPool(hipMemPool_t* mem_pool, int device) { hipError_t r = g_real_table.hipDeviceGetMemPool_fn(mem_pool, device); @@ -2838,6 +2852,20 @@ static hipError_t capture_hipInit(unsigned int flags) { return r; } +// Generated shim +static hipError_t capture_hipInitDevice(int device, unsigned int deviceFlags, unsigned int flags) { + hipError_t r = g_real_table.hipInitDevice_fn(device, deviceFlags, flags); + if (r == hipSuccess) { + hrr_args_hipInitDevice a{}; + a.ret = static_cast(r); + a.device = static_cast(device); + a.deviceFlags = static_cast(deviceFlags); + a.flags = static_cast(flags); + hrr_cap::writer::write_event_raw(HRR_API_HIPINITDEVICE, &a.hdr, sizeof(a)); + } + return r; +} + // Generated shim static hipError_t capture_hipIpcCloseMemHandle(void* devPtr) { hipError_t r = g_real_table.hipIpcCloseMemHandle_fn(devPtr); @@ -7392,6 +7420,20 @@ static hipError_t capture_hipExecutionCtxWaitEvent(hipExecutionCtx_t ctx, hipEve return r; } +// Generated shim +static hipError_t capture_hipMemGetDefaultMemPool(hipMemPool_t* memPool, hipMemLocation* location, hipMemAllocationType type) { + hipError_t r = g_real_table.hipMemGetDefaultMemPool_fn(memPool, location, type); + if (r == hipSuccess) { + hrr_args_hipMemGetDefaultMemPool a{}; + a.ret = static_cast(r); + a.location = 0; // non-castable type skipped + a.type = static_cast(type); + if (memPool) a.memPool = reinterpret_cast(*memPool); + hrr_cap::writer::write_event_raw(HRR_API_HIPMEMGETDEFAULTMEMPOOL, &a.hdr, sizeof(a)); + } + return r; +} + // ============================================================ // Table builders // ============================================================ @@ -7490,6 +7532,7 @@ void hip_capture_build_table() { g_cap_table.hipDeviceGetDefaultMemPool_fn = capture_hipDeviceGetDefaultMemPool; g_cap_table.hipDeviceGetGraphMemAttribute_fn = capture_hipDeviceGetGraphMemAttribute; g_cap_table.hipDeviceGetLimit_fn = capture_hipDeviceGetLimit; + g_cap_table.hipDeviceGetLuid_fn = capture_hipDeviceGetLuid; g_cap_table.hipDeviceGetMemPool_fn = capture_hipDeviceGetMemPool; g_cap_table.hipDeviceGetName_fn = capture_hipDeviceGetName; g_cap_table.hipDeviceGetP2PAttribute_fn = capture_hipDeviceGetP2PAttribute; @@ -7646,6 +7689,7 @@ void hip_capture_build_table() { g_cap_table.hipImportExternalMemory_fn = capture_hipImportExternalMemory; g_cap_table.hipImportExternalSemaphore_fn = capture_hipImportExternalSemaphore; g_cap_table.hipInit_fn = capture_hipInit; + g_cap_table.hipInitDevice_fn = capture_hipInitDevice; g_cap_table.hipIpcCloseMemHandle_fn = capture_hipIpcCloseMemHandle; g_cap_table.hipIpcGetEventHandle_fn = capture_hipIpcGetEventHandle; g_cap_table.hipIpcGetMemHandle_fn = capture_hipIpcGetMemHandle; @@ -7984,6 +8028,7 @@ void hip_capture_build_table() { g_cap_table.hipExecutionCtxRecordEvent_fn = capture_hipExecutionCtxRecordEvent; g_cap_table.hipExecutionCtxSynchronize_fn = capture_hipExecutionCtxSynchronize; g_cap_table.hipExecutionCtxWaitEvent_fn = capture_hipExecutionCtxWaitEvent; + g_cap_table.hipMemGetDefaultMemPool_fn = capture_hipMemGetDefaultMemPool; } void hip_capture_build_compiler_table() { diff --git a/projects/clr/hipamd/src/hrr/hip_capture_writer.h b/projects/clr/hipamd/src/hrr/hip_capture_writer.h index 44ad5a68c870..325d45c83892 100644 --- a/projects/clr/hipamd/src/hrr/hip_capture_writer.h +++ b/projects/clr/hipamd/src/hrr/hip_capture_writer.h @@ -6,7 +6,7 @@ #pragma once #include "hip_capture.h" -#include "hrr_api_args.h" +#include "hrr/hrr_api_args.h" #include #include diff --git a/projects/clr/hipamd/src/hrr/playback/CMakeLists.txt b/projects/clr/hipamd/src/hrr/playback/CMakeLists.txt deleted file mode 100644 index 1df3611e9443..000000000000 --- a/projects/clr/hipamd/src/hrr/playback/CMakeLists.txt +++ /dev/null @@ -1,58 +0,0 @@ -# HRR Playback Tools -# Built as part of the main HIP runtime CMake tree. -# HIP headers are inherited from amdhip64 via target_link_libraries. - -# hrr_api_args.h and capture headers are one directory up (hipamd/src/hrr/). -set(HRR_DIR ${CMAKE_CURRENT_SOURCE_DIR}/..) - -# C++20 on Windows (MSVC requires it for some std features), C++17 on Linux. -if(WIN32) - set(HRR_CXX_STANDARD 20) -else() - set(HRR_CXX_STANDARD 17) -endif() - -# --------------------------------------------------------------------------- -# hrr_reader — archive loader (STATIC) -# --------------------------------------------------------------------------- -add_library(hrr_reader STATIC hrr_reader.cpp) -set_target_properties(hrr_reader PROPERTIES CXX_STANDARD ${HRR_CXX_STANDARD} CXX_STANDARD_REQUIRED ON) -target_include_directories(hrr_reader PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} - ${HRR_DIR} - ${HIP_COMMON_INCLUDE_DIR} - ${PROJECT_BINARY_DIR}/include -) -target_compile_definitions(hrr_reader PRIVATE - HRR_API_ARGS_IMPLEMENTATION - $<$:NOMINMAX WIN32_LEAN_AND_MEAN> -) - -# --------------------------------------------------------------------------- -# hrr-playback — full replay tool -# --------------------------------------------------------------------------- -add_executable(hrr-playback - hrr_playback.cpp - hip_playback.cpp - hip_playback_generated.cpp -) -set_target_properties(hrr-playback PROPERTIES CXX_STANDARD ${HRR_CXX_STANDARD} CXX_STANDARD_REQUIRED ON) -target_include_directories(hrr-playback PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR} - ${HRR_DIR} - ${HIP_COMMON_INCLUDE_DIR} - ${PROJECT_SOURCE_DIR}/include - ${PROJECT_BINARY_DIR}/include -) -target_compile_definitions(hrr-playback PRIVATE - __HIP_PLATFORM_AMD__ - $<$:NOMINMAX WIN32_LEAN_AND_MEAN> -) -find_package(Threads REQUIRED) -target_link_libraries(hrr-playback PRIVATE hrr_reader amdhip64 Threads::Threads) - -install(TARGETS hrr-playback RUNTIME DESTINATION bin) - -# Crash-truncation recovery is covered by the hip-tests catch suite -# (projects/hip-tests/catch/unit/hrr/hrr_recovery.cc, run via HrrTest "[hrr]"), -# so it is part of CI rather than a standalone EXCLUDE_FROM_ALL target. diff --git a/projects/clr/hipamd/src/hrr/skills/decode-and-triage/scripts/ensure_playback.ps1 b/projects/clr/hipamd/src/hrr/skills/decode-and-triage/scripts/ensure_playback.ps1 deleted file mode 100644 index 05ea9e263e6f..000000000000 --- a/projects/clr/hipamd/src/hrr/skills/decode-and-triage/scripts/ensure_playback.ps1 +++ /dev/null @@ -1,290 +0,0 @@ -#!/usr/bin/env pwsh -# Locate hrr-playback.exe; optionally build from the colocated CLR tree (--build). -# Prints the absolute path to stdout on success. -# -# Usage: -# .\ensure_playback.ps1 [--build] -# -# Environment: -# HRR_PLAYBACK Explicit binary path (checked first) -# CLR_BUILD Existing build dir (hipamd\src\hrr\playback\hrr-playback.exe expected inside) -# CLR_ROOT CLR source root (overrides auto-detection) -# HIP_PATH / ROCM_PATH HIP SDK root for -DHIP_COMMON_DIR / -DROCM_PATH (default: C:\Program Files\AMD\ROCm\6.2) -# ROCR_INC Optional ROCR include dir for -DHSA_HEADER_DIR -# HRR_ROOT Explicit repo root (overrides git detection) -# HRR_ENSURE_BUILD=1 Same as passing --build -# --------------------------------------------------------------------------- -Set-StrictMode -Version Latest -$ErrorActionPreference = "Stop" - -# Declare variables — no param() block so $args is always the raw token list -$Build = $false -$Help = $false - -$ScriptDir = $PSScriptRoot -$SkillDir = Split-Path $ScriptDir -Parent # decode-and-triage/ -$HipRoot = if ($env:HIP_PATH) { $env:HIP_PATH } - elseif ($env:ROCM_PATH) { $env:ROCM_PATH } - else { "C:\Program Files\AMD\ROCm\6.2" } - -# Parse flags from $args directly (no param() block — avoids PS binder interference) -foreach ($tok in $args) { - switch -Exact ($tok) { - "--build" { $Build = $true } - "--help" { $Help = $true } - "-h" { $Help = $true } - default { Write-Host "error: unknown arg: $tok" -ForegroundColor Red; exit 1 } - } -} - -if ($Help) { - @" -usage: ensure_playback.ps1 [--build] - default: locate an existing hrr-playback.exe (no build) - --build: configure + compile hrr-playback when not found - -Searched in order: - HRR_PLAYBACK env, CLR_BUILD tree, HIP_PATH\bin, ROCM_PATH\bin, PATH, - build-hrr* / build* dirs adjacent to CLR root. -"@ | Write-Host -ForegroundColor Cyan - exit 0 -} - -if ($env:HRR_ENSURE_BUILD -eq "1") { $Build = $true } - -# --------------------------------------------------------------------------- -# Find hrr-playback.exe inside a build tree -# --------------------------------------------------------------------------- -function Find-InBuild([string]$BuildDir) { - if (-not $BuildDir) { return $null } - foreach ($rel in @( - "hipamd\src\hrr\playback\hrr-playback.exe", - "hipamd\src\hrr\playback\hrr-playback", # no-extension (rare) - "bin\hrr-playback.exe", - "bin\hrr-playback" - )) { - $p = Join-Path $BuildDir $rel - if (Test-Path $p -PathType Leaf) { return (Resolve-Path $p).Path } - } - # Recursive search as a last resort (slower) - $found = Get-ChildItem $BuildDir -Recurse -Filter "hrr-playback.exe" -ErrorAction SilentlyContinue | - Select-Object -First 1 - if ($found) { return $found.FullName } - return $null -} - -# --------------------------------------------------------------------------- -# Locate the CLR source root (hipamd\src\hrr must be present) -# --------------------------------------------------------------------------- -function Resolve-ClrRoot { - if ($env:CLR_ROOT) { - $p = $env:CLR_ROOT - if ((Test-Path (Join-Path $p "CMakeLists.txt")) -and - (Test-Path (Join-Path $p "hipamd\src\hrr"))) { - return $p - } - } - - # Walk up 5 levels from skill dir (decode-and-triage → skills → hrr → hipamd → clr) - $candidate = $SkillDir - for ($i = 0; $i -lt 5; $i++) { - if (-not $candidate) { break } # stop before Split-Path "" errors - $candidate = Split-Path $candidate -Parent - if (-not $candidate) { break } # root exhausted (Split-Path "C:\" returns "") - if ((Test-Path (Join-Path $candidate "CMakeLists.txt")) -and - (Test-Path (Join-Path $candidate "hipamd\src\hrr"))) { - return $candidate - } - } - - # Try git top-level / projects\clr - try { - $repo = & git -C $SkillDir rev-parse --show-toplevel 2>$null - if ($repo) { - foreach ($sub in @("projects\clr", "rocm-systems\projects\clr")) { - $p = Join-Path $repo $sub - if ((Test-Path (Join-Path $p "CMakeLists.txt")) -and - (Test-Path (Join-Path $p "hipamd\src\hrr"))) { - return $p - } - } - } - } catch {} - - return $null -} - -# --------------------------------------------------------------------------- -# Probe known HIP SDK paths -# --------------------------------------------------------------------------- -function Find-InHipSdk { - foreach ($dir in @( - (Join-Path $HipRoot "bin"), - (Join-Path $HipRoot "hip\bin"), - (Join-Path $HipRoot "tools\bin") - )) { - foreach ($name in @("hrr-playback.exe", "hrr-playback")) { - $p = Join-Path $dir $name - if (Test-Path $p -PathType Leaf) { return $p } - } - } - # PATH fallback - $cmd = Get-Command "hrr-playback.exe" -ErrorAction SilentlyContinue - if ($cmd) { return $cmd.Source } - $cmd = Get-Command "hrr-playback" -ErrorAction SilentlyContinue - if ($cmd) { return $cmd.Source } - return $null -} - -# --------------------------------------------------------------------------- -# STEP 1 — Honour explicit HRR_PLAYBACK env -# --------------------------------------------------------------------------- -if ($env:HRR_PLAYBACK -and (Test-Path $env:HRR_PLAYBACK -PathType Leaf)) { - Write-Host $env:HRR_PLAYBACK - exit 0 -} - -# --------------------------------------------------------------------------- -# STEP 2 — Look in CLR_BUILD env -# --------------------------------------------------------------------------- -$ClrRoot = Resolve-ClrRoot - -if ($env:CLR_BUILD) { - $found = Find-InBuild $env:CLR_BUILD - if ($found) { Write-Host $found; exit 0 } -} - -# --------------------------------------------------------------------------- -# STEP 3 — Scan build-hrr* / build* dirs adjacent to the CLR root -# --------------------------------------------------------------------------- -if ($ClrRoot) { - $searchRoot = Split-Path $ClrRoot -Parent - $dirs = Get-ChildItem $searchRoot -Directory -ErrorAction SilentlyContinue | - Where-Object { $_.Name -match '^build' } | - Sort-Object { $_.LastWriteTime } -Descending - - foreach ($d in $dirs) { - $found = Find-InBuild $d.FullName - if ($found) { Write-Host $found; exit 0 } - } - - # Also check inside CLR root itself (e.g. clr\build-win) - $innerDirs = Get-ChildItem $ClrRoot -Directory -ErrorAction SilentlyContinue | - Where-Object { $_.Name -match '^build' } | - Sort-Object { $_.LastWriteTime } -Descending - - foreach ($d in $innerDirs) { - $found = Find-InBuild $d.FullName - if ($found) { Write-Host $found; exit 0 } - } -} - -# --------------------------------------------------------------------------- -# STEP 4 — HIP SDK install / PATH -# --------------------------------------------------------------------------- -$sdkFound = Find-InHipSdk -if ($sdkFound) { Write-Host $sdkFound; exit 0 } - -# --------------------------------------------------------------------------- -# STEP 5 — Build (only when --build requested) -# --------------------------------------------------------------------------- -if (-not $Build) { - Write-Host @" -[ensure_playback] hrr-playback.exe not found. - -This script is running outside the rocm-systems source tree, so --build is not -available here. Choose one of the options below: - - 1. Point at an existing binary: - `$env:HRR_PLAYBACK = 'C:\path\to\hrr-playback.exe' - - 2. Point at a CLR build directory that already contains hrr-playback.exe: - `$env:CLR_BUILD = 'C:\path\to\build-dir' - - 3. Install the HIP SDK and ensure hrr-playback.exe is under HIP_PATH\bin: - `$env:HIP_PATH = 'C:\Program Files\AMD\ROCm\6.2' - - 4. Triage without replay (no binary needed — reads manifest.json only): - .\triage_archive.ps1 --archive --no-replay - - 5. Build from source: clone rocm-systems, set CLR_ROOT, then re-run with --build: - git clone https://github.com/ROCm/rocm-systems - `$env:CLR_ROOT = 'C:\rocm-systems\projects\clr' - .\ensure_playback.ps1 --build -"@ -ForegroundColor Yellow - exit 1 -} - -if (-not $ClrRoot) { - Write-Host @" -[ensure_playback] Cannot locate the CLR source root for --build. - -This script is not inside a rocm-systems checkout, so it cannot find -hipamd\src\hrr\ (required for cmake configure). - -Options: - A. Set CLR_ROOT explicitly: - `$env:CLR_ROOT = 'C:\path\to\rocm-systems\projects\clr' - .\ensure_playback.ps1 --build - - B. Clone rocm-systems first: - git clone https://github.com/ROCm/rocm-systems - `$env:CLR_ROOT = 'C:\rocm-systems\projects\clr' - .\ensure_playback.ps1 --build - - C. Skip the build — use an existing binary instead: - `$env:HRR_PLAYBACK = 'C:\path\to\hrr-playback.exe' - - D. Metadata-only triage (no binary needed): - .\triage_archive.ps1 --archive --no-replay -"@ -ForegroundColor Yellow - exit 1 -} - -$BuildOut = Join-Path (Split-Path $ClrRoot -Parent) "build-hrr-win" -New-Item -ItemType Directory -Force -Path $BuildOut | Out-Null - -Write-Host "[ensure_playback] configuring in $BuildOut" -ForegroundColor DarkGray - -# ---- CMake configure ------------------------------------------------------- -# ROCM_PATH / HIP_PATH must point to the HIP SDK install that includes -# amdhip64.lib, hip\include, etc. -$CMakeArgs = @( - "-S", $ClrRoot, - "-B", $BuildOut, - "-G", "Ninja", - "-DHIP_COMMON_DIR=$(Join-Path $HipRoot 'include')", - "-DROCM_PATH=$HipRoot", - "-DCLR_BUILD_HIP=ON", - "-DCLR_BUILD_OCL=OFF", - "-DHIP_PLATFORM=amd", - "-DCMAKE_BUILD_TYPE=Release" -) -if ($env:ROCR_INC) { $CMakeArgs += "-DHSA_HEADER_DIR=$($env:ROCR_INC)" } - -Write-Host "[ensure_playback] cmake $($CMakeArgs -join ' ')" -ForegroundColor DarkGray -cmake @CMakeArgs -if ($LASTEXITCODE -ne 0) { - Write-Error "CMake configure failed (exit $LASTEXITCODE). Review output above." - exit 1 -} - -# ---- Ninja build ----------------------------------------------------------- -$Jobs = if ($env:NUMBER_OF_PROCESSORS) { $env:NUMBER_OF_PROCESSORS } else { "4" } -Write-Host "[ensure_playback] ninja -C $BuildOut hrr-playback -j $Jobs" -ForegroundColor DarkGray -ninja -C $BuildOut hrr-playback -j $Jobs -if ($LASTEXITCODE -ne 0) { - Write-Error "ninja build failed (exit $LASTEXITCODE). Review output above." - exit 1 -} - -# ---- Return path ----------------------------------------------------------- -$built = Find-InBuild $BuildOut -if (-not $built) { - Write-Error "Build completed but hrr-playback.exe not found under $BuildOut" - exit 1 -} - -Write-Host "[ensure_playback] built: $built" -ForegroundColor DarkGray -Write-Host $built -exit 0 diff --git a/projects/clr/hipamd/src/hrr/skills/decode-and-triage/scripts/ensure_playback.sh b/projects/clr/hipamd/src/hrr/skills/decode-and-triage/scripts/ensure_playback.sh deleted file mode 100755 index 751b2cd44724..000000000000 --- a/projects/clr/hipamd/src/hrr/skills/decode-and-triage/scripts/ensure_playback.sh +++ /dev/null @@ -1,269 +0,0 @@ -#!/usr/bin/env bash -# Locate hrr-playback; optionally build from the colocated CLR tree (--build). -# Prints the absolute path to stdout on success. -set -euo pipefail - -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -SKILL_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" -ROCM_PATH="${ROCM_PATH:-/opt/rocm}" -DO_BUILD=0 - -while [[ $# -gt 0 ]]; do - case "$1" in - --build) DO_BUILD=1; shift ;; - -h|--help) - echo "usage: ensure_playback.sh [--build]" >&2 - echo " default: find existing hrr-playback only (no cmake/ninja)" >&2 - echo " --build: configure and build amdhip64 + hrr-playback when missing" >&2 - exit 0 - ;; - *) echo "error: unknown arg: $1" >&2; exit 1 ;; - esac -done - -[[ "${HRR_ENSURE_BUILD:-0}" == 1 ]] && DO_BUILD=1 - -playback_from_build() { - local build="$1" - [[ -n "$build" && -x "$build/hipamd/src/hrr/playback/hrr-playback" ]] || return 1 - echo "$build/hipamd/src/hrr/playback/hrr-playback" -} - -resolve_repo_root() { - local root="" - [[ -n "${HRR_ROOT:-}" ]] && { echo "$HRR_ROOT"; return; } - root="$(git -C "$SKILL_DIR" rev-parse --show-toplevel 2>/dev/null || true)" - echo "$root" -} - -resolve_clr_root() { - local repo candidates=() - [[ -n "${CLR_ROOT:-}" ]] && candidates+=("$CLR_ROOT") - candidates+=("$(cd "$SKILL_DIR/../../../../../" 2>/dev/null && pwd || true)") - repo="$(resolve_repo_root)" - [[ -n "$repo" ]] && candidates+=("$repo/projects/clr") - [[ -n "$repo" ]] && candidates+=("$repo/rocm-systems/projects/clr") - local c - for c in "${candidates[@]}"; do - [[ -n "$c" && -f "$c/CMakeLists.txt" && -d "$c/hipamd/src/hrr" ]] || continue - echo "$c" - return - done - echo "" -} - -resolve_rocr_lib_dir() { - local clr="${1:-}" repo candidates=() d - [[ -n "${ROCR_LIB:-}" ]] && { echo "$ROCR_LIB"; return; } - repo="$(resolve_repo_root)" - [[ -n "$repo" ]] && candidates+=("$repo/projects/rocr-runtime/build-local/rocr/lib") - [[ -n "$clr" ]] && candidates+=("$clr/../rocr-runtime/build-local/rocr/lib") - for d in "${candidates[@]}"; do - [[ -n "$d" && -f "$d/libhsa-runtime64.so.1" ]] || continue - echo "$d" - return - done - echo "" -} - -resolve_rocr_inc_dir() { - local clr="${1:-}" repo rocr candidates=() d - [[ -n "${ROCR_INC:-}" ]] && { echo "$ROCR_INC"; return; } - repo="$(resolve_repo_root)" - [[ -n "$repo" ]] && candidates+=("$repo/projects/rocr-runtime/runtime/hsa-runtime/inc") - [[ -n "$clr" ]] && candidates+=("$clr/../rocr-runtime/runtime/hsa-runtime/inc") - for d in "${candidates[@]}"; do - [[ -n "$d" && -d "$d" ]] || continue - echo "$d" - return - done - echo "" -} - -setup_rocr_header_wrap() { - local rocr_inc="$1" wrap="$2" f - mkdir -p "$wrap/hsa" - for f in "$rocr_inc"/*.h; do - [[ -f "$f" ]] || continue - ln -sfn "$f" "$wrap/hsa/$(basename "$f")" - done -} - -find_playback_under_clr() { - local clr="$1" b play - [[ -n "$clr" ]] || return 1 - for b in "$clr"/build-hrr* "$clr/build"; do - [[ -d "$b" ]] || continue - if play="$(playback_from_build "$b" 2>/dev/null)"; then - echo "$play" - return 0 - fi - done - return 1 -} - -resolve_build_dir() { - local clr="$1" - local candidates=() b play - [[ -n "${CLR_BUILD:-}" ]] && candidates+=("$CLR_BUILD") - for b in "$clr"/build-hrr* "$clr/build"; do - [[ -d "$b" ]] || continue - candidates+=("$b") - done - candidates+=("$clr/build-hrr") - for b in "${candidates[@]}"; do - [[ -n "$b" ]] || continue - if playback_from_build "$b" >/dev/null 2>&1; then - echo "$b" - return - fi - [[ -d "$b" ]] && echo "$b" && return - done - echo "$clr/build-hrr" -} - -resolve_hip_common_dir() { - local clr="$1" repo candidates=() - [[ -n "${HIP_COMMON_DIR:-}" ]] && candidates+=("$HIP_COMMON_DIR") - candidates+=("$(cd "$clr/../hip" 2>/dev/null && pwd || true)") - repo="$(resolve_repo_root)" - [[ -n "$repo" ]] && candidates+=("$repo/projects/hip") - [[ -n "$repo" ]] && candidates+=("$repo/rocm-systems/projects/hip") - local h - for h in "${candidates[@]}"; do - [[ -n "$h" && -d "$h/include/hip" ]] || continue - echo "$h" - return - done - echo "" -} - -find_existing_playback() { - local p candidates=() clr - [[ -n "${HRR_PLAYBACK:-}" && -x "${HRR_PLAYBACK}" ]] && candidates+=("$HRR_PLAYBACK") - if command -v hrr-playback >/dev/null 2>&1; then - candidates+=("$(command -v hrr-playback)") - fi - [[ -n "${CLR_BUILD:-}" ]] && candidates+=("${CLR_BUILD}/hipamd/src/hrr/playback/hrr-playback") - candidates+=("$ROCM_PATH/bin/hrr-playback") - for p in "${candidates[@]}"; do - [[ -n "$p" && -x "$p" ]] || continue - echo "$p" - return - done - clr="$(resolve_clr_root)" - play="$(find_playback_under_clr "$clr" 2>/dev/null || true)" - if [[ -n "$play" ]]; then - echo "$play" - return - fi - echo "" -} - -build_playback() { - local clr="$1" build="$2" hip="$3" - local rocr_inc rocr_lib wrap cxx_flags ld_flags cmake_args=() - rocr_inc="$(resolve_rocr_inc_dir "$clr")" - rocr_lib="$(resolve_rocr_lib_dir "$clr")" - wrap="$build/.rocr-hsa-wrap" - cxx_flags="" - ld_flags="" - if [[ -n "$rocr_inc" ]]; then - setup_rocr_header_wrap "$rocr_inc" "$wrap" - cxx_flags="-I$wrap" - echo "[ensure_playback] using in-tree ROCR headers from $rocr_inc" >&2 - else - echo "[ensure_playback] warning: in-tree ROCR headers not found; build may fail in rocdevice.cpp on older /opt/rocm" >&2 - fi - if [[ -n "$rocr_lib" ]]; then - ld_flags="-L$rocr_lib -Wl,-rpath,$rocr_lib" - echo "[ensure_playback] linking in-tree ROCR from $rocr_lib" >&2 - fi - cmake_args=( - -S "$clr" -B "$build" -GNinja - -DHIP_COMMON_DIR="$hip" - -DROCM_PATH="$ROCM_PATH" - -DCLR_BUILD_HIP=ON -DCLR_BUILD_OCL=OFF -DHIP_PLATFORM=amd - -DCMAKE_BUILD_TYPE=Release - ) - [[ -n "$cxx_flags" ]] && cmake_args+=(-DCMAKE_CXX_FLAGS="$cxx_flags" -DCMAKE_C_FLAGS="$cxx_flags") - [[ -n "$ld_flags" ]] && cmake_args+=(-DCMAKE_SHARED_LINKER_FLAGS="$ld_flags" -DCMAKE_EXE_LINKER_FLAGS="$ld_flags") - echo "[ensure_playback] configuring CLR at $clr (build=$build)" >&2 - cmake "${cmake_args[@]}" - echo "[ensure_playback] building amdhip64 hrr-playback" >&2 - ninja -C "$build" amdhip64 hrr-playback -j"$(nproc)" -} - -export_playback_env() { - local play="$1" build rocr_lib ld_parts=() - build="$(cd "$(dirname "$play")/../../../.." && pwd)" - rocr_lib="$(resolve_rocr_lib_dir "$(resolve_clr_root)" || true)" - export CLR_BUILD="$build" - export HRR_PLAYBACK="$play" - [[ -d "$build/hipamd/lib" ]] && ld_parts+=("$build/hipamd/lib") - [[ -n "$rocr_lib" ]] && ld_parts+=("$rocr_lib") - ld_parts+=("$ROCM_PATH/lib") - export LD_LIBRARY_PATH="$(IFS=:; echo "${ld_parts[*]}")${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" - [[ -n "$rocr_lib" ]] && export ROCR_LIB="$rocr_lib" -} - -fail_not_found() { - echo "error: hrr-playback not found." >&2 - if [[ "$DO_BUILD" -eq 0 ]]; then - echo "error: re-run with --build for full GPU replay, or set HRR_PLAYBACK." >&2 - echo "error: metadata-only: triage_archive.sh --archive --no-replay" >&2 - else - echo "error: set CLR_ROOT/HRR_ROOT or fix the build environment (see SKILL.md)." >&2 - fi - return 1 -} - -main() { - local existing play clr build hip - - existing="$(find_existing_playback)" - if [[ -n "$existing" ]]; then - export_playback_env "$existing" - echo "$existing" - return 0 - fi - - [[ "$DO_BUILD" -eq 1 ]] || fail_not_found - - clr="$(resolve_clr_root)" - [[ -n "$clr" ]] || { - echo "error: CLR source tree not discoverable." >&2 - fail_not_found - } - - build="$(resolve_build_dir "$clr")" - if play="$(playback_from_build "$build" 2>/dev/null)"; then - export_playback_env "$play" - echo "$play" - return 0 - fi - - hip="$(resolve_hip_common_dir "$clr")" - [[ -n "$hip" ]] || { - echo "error: HIP_COMMON_DIR not found (expected projects/hip next to projects/clr)." >&2 - fail_not_found - } - - for tool in cmake ninja; do - command -v "$tool" >/dev/null 2>&1 || { - echo "error: $tool required to build hrr-playback" >&2 - fail_not_found - } - done - - build_playback "$clr" "$build" "$hip" - play="$(playback_from_build "$build")" - [[ -n "$play" ]] || { - echo "error: build finished but hrr-playback not found under $build" >&2 - fail_not_found - } - export_playback_env "$play" - echo "$play" -} - -main "$@" diff --git a/projects/hip-tests/catch/config/configs/unit/hrr.yaml b/projects/hip-tests/catch/config/configs/unit/hrr.yaml index 55c48eff5231..3edee006d0e8 100644 --- a/projects/hip-tests/catch/config/configs/unit/hrr.yaml +++ b/projects/hip-tests/catch/config/configs/unit/hrr.yaml @@ -1,484 +1,8 @@ --- hrr: - Unit_HRR_Format_Roundtrip: + Unit_HRR_CaptureSmoke: <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [format] - Unit_HRR_Format_BadMagic: + tags: [smoke, capture] + Unit_HRR_CaptureSmoke_Direct: <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [format] - Unit_HRR_Format_TruncatedEvent: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [format] - Unit_HRR_Format_HashHex: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [format] - Unit_HRR_Format_EventTypeName: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [format] - Unit_HRR_TranslatePtr_ExactMatch: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [format, cpu] - Unit_HRR_TranslatePtr_SubAlloc_ReturnsOffset: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [format, cpu] - Unit_HRR_TranslatePtr_OutOfRange_ReturnsNull: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [format, cpu] - Unit_HRR_TranslatePtr_Zero_ReturnsNull: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [format, cpu] - Unit_HRR_Format_SmallPayloadForType: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [format, cpu] - Unit_HRR_Format_UnknownEventType: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [format, cpu] - Unit_HRR_TranslatePtr_TightestEnclosing: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [format, cpu] - Unit_HRR_AllocKind_FreeDispatch: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [format, cpu] - Unit_HRR_Playback_ReplayedH2DDrainGraphGuard: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [playback, cpu] - Unit_HRR_Playback_ZeroInitDrainGuard: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [playback, cpu] - Unit_HRR_Recovery_CompleteArchive: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [format, recovery, cpu] - Unit_HRR_Recovery_TornHeader: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [format, recovery, cpu] - Unit_HRR_Recovery_TornPayload: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [format, recovery, cpu] - Unit_HRR_Recovery_NoTrailer: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [format, recovery, cpu] - Unit_HRR_Recovery_RepairWritesProcessManifest: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [format, recovery, repair, cpu] - Unit_HRR_Recovery_MultiProcessRootInfo: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [format, recovery, multiprocess, cpu] - Unit_HRR_AllApisRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, allapis, playback, roundtrip] - Unit_HRR_CaptureReplayRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, playback, roundtrip] - Unit_HRR_GraphRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, graph, playback, roundtrip] - Unit_HRR_HostMemRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, hostmem, playback, roundtrip] - Unit_HRR_StressApisRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, stress, playback, roundtrip] - Unit_HRR_StreamWriteValueRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, stream, playback, roundtrip] - Unit_HRR_MemsetVariantsRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, memset, playback, roundtrip] - Unit_HRR_DeviceInfoRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, device, playback, roundtrip] - Unit_HRR_MetadataManifest: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, metadata] - Unit_HRR_StreamAdvancedRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, stream, playback, roundtrip] - Unit_HRR_DrvMemcpyRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, memcpy, playback, roundtrip] - Unit_HRR_OccupancyRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, occupancy, playback, roundtrip] - Unit_HRR_HostAliasesRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, hostmem, playback, roundtrip] - Unit_HRR_MemPoolExtendedRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, mempool, playback, roundtrip] - Unit_HRR_DeviceMemPoolRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, mempool, playback, roundtrip] - Unit_HRR_ExtMallocRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, alloc, playback, roundtrip] - Unit_HRR_StreamWaitEventSptRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, stream, playback, roundtrip] - Unit_HRR_GraphLaunchSptRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, graph, playback, roundtrip] - Unit_HRR_ExtModuleLaunchKernelRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, module, launch, playback, roundtrip] - Unit_HRR_HostFreeRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, hostmem, playback, roundtrip] - Unit_HRR_LoggingRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, logging, playback, roundtrip] - Unit_HRR_StreamCaptureQuerySptRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, stream, graph, playback, roundtrip] - Unit_HRR_StreamCaptureBeginSptRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, stream, graph, playback, roundtrip] - Unit_HRR_MemcpyPeerRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, memcpy, peer, playback, roundtrip] - Unit_HRR_ConfigureCallRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, launch, playback, roundtrip] - Unit_HRR_MemsetExtraRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, memset, playback, roundtrip] - Unit_HRR_MemcpyExtraRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, memcpy, playback, roundtrip] - Unit_HRR_DeviceExtraRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, device, playback, roundtrip] - Unit_HRR_StreamAdvanced2Roundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, stream, playback, roundtrip] - Unit_HRR_ContextRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, context, playback, roundtrip] - Unit_HRR_ModuleExtraRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, module, playback, roundtrip] - Unit_HRR_MiscAPIsRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, misc, playback, roundtrip] - Unit_HRR_DrvMemcpy3DRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, memcpy, playback, roundtrip] - Unit_HRR_DrvMemcpy2DUnalignedRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, memcpy, playback, roundtrip] - Unit_HRR_TextureRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, texture, playback, roundtrip] - Unit_HRR_GraphExplicitRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, graph, playback, roundtrip] - Unit_HRR_HostRegLaunchRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, hostmem, launch, playback, roundtrip] - Unit_HRR_ModuleAPIRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, module, launch, playback, roundtrip] - Unit_HRR_VMMRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, vmm, playback, roundtrip] - Unit_HRR_ChevronLaunchRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, launch, playback, roundtrip] - Unit_HRR_EmbeddedPtrRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, playback, roundtrip, repro] - Unit_HRR_ZeroInitRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, playback, roundtrip, repro] - Unit_HRR_DivergenceAbortRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, playback, roundtrip, repro] - Unit_HRR_FirstMallocRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, playback, roundtrip, repro] - Unit_HRR_NullOptionalPtrRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, playback, roundtrip, repro] - Unit_HRR_MultiThreadRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, multithread, playback, roundtrip] - Unit_HRR_ReplaceKernelRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, playback, roundtrip, replacekernel] - Unit_HRR_ReplaceKernelMissingCO: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, playback, roundtrip, replacekernel] - Unit_HRR_ReplaceKernelBadSpec: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, playback, roundtrip, replacekernel] - - Unit_HRR_AllApis_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, allapis] - Unit_HRR_ChevronLaunch_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, launch] - Unit_HRR_Context_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, context] - Unit_HRR_DeviceExtra_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, device] - Unit_HRR_DeviceInfo_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, device] - Unit_HRR_DrvMemcpy3D_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, memcpy] - Unit_HRR_DrvMemcpy2DUnaligned_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, memcpy] - Unit_HRR_DrvMemcpy_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, memcpy] - Unit_HRR_GpuWorkload_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct] - Unit_HRR_GraphExplicit_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, graph] - Unit_HRR_GraphWorkload_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, graph] - Unit_HRR_HostAliases_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, hostmem] - Unit_HRR_HostMemWorkload_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, hostmem] - Unit_HRR_HostRegLaunch_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, hostmem, launch] - Unit_HRR_MemPoolExtended_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, mempool] - Unit_HRR_DeviceMemPool_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, mempool] - Unit_HRR_ExtMalloc_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, alloc] - Unit_HRR_StreamWaitEventSpt_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, stream] - Unit_HRR_GraphLaunchSpt_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, graph] - Unit_HRR_ExtModuleLaunchKernel_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, module, launch] - Unit_HRR_HostFree_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, hostmem] - Unit_HRR_Logging_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, logging] - Unit_HRR_StreamCaptureQuerySpt_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, stream, graph] - Unit_HRR_StreamCaptureBeginSpt_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, stream, graph] - Unit_HRR_MemcpyPeer_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, memcpy, peer] - Unit_HRR_ConfigureCall_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, launch] - Unit_HRR_MemcpyExtra_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, memcpy] - Unit_HRR_MemsetExtra_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, memset] - Unit_HRR_StreamWriteValue_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, stream] - - Unit_HRR_MemsetD2D_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, memset] - Unit_HRR_MemsetD2DPitchAlloc_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, memset] - Unit_HRR_MemsetD2DRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, memset, playback, roundtrip] - Unit_HRR_MemsetD2DPitchAllocRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, memset, playback, roundtrip] - Unit_HRR_MemsetSpt_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, memset] - Unit_HRR_MemsetSptRoundtrip: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [capture, memset, playback, roundtrip] - Unit_HRR_MemsetVariants_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, memset] - Unit_HRR_MiscAPIs_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, misc] - Unit_HRR_ModuleAPI_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, module, launch] - Unit_HRR_ModuleExtra_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, module] - Unit_HRR_Occupancy_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, occupancy] - Unit_HRR_StreamAdvanced2_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, stream] - Unit_HRR_StreamAdvanced_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, stream] - Unit_HRR_StressApis_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, stress] - Unit_HRR_Texture_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, texture] - Unit_HRR_VMM_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, vmm] - Unit_HRR_FirstMalloc_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, repro] - Unit_HRR_EmbeddedPtrStruct_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, repro] - Unit_HRR_UncapturedHostWrite_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, repro] - Unit_HRR_NullOptionalPtr_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, repro] - Unit_HRR_ZeroInitRead_Direct: - <<: *level_2 - disabled: [amd_windows, amd_linux, amd_wsl] - tags: [direct, repro] + tags: [direct, smoke] diff --git a/projects/hip-tests/catch/unit/hrr/CMakeLists.txt b/projects/hip-tests/catch/unit/hrr/CMakeLists.txt index 39c2e9148fbe..ef37e51ede58 100644 --- a/projects/hip-tests/catch/unit/hrr/CMakeLists.txt +++ b/projects/hip-tests/catch/unit/hrr/CMakeLists.txt @@ -2,161 +2,26 @@ # # SPDX-License-Identifier: MIT -# HRR (HIP Record & Replay) tests -# -# Source files compiled into HrrTest: -# -# hrr_format_test.cc — CPU-only: archive format I/O unit tests (no GPU). -# hrr_recovery_test.cc — CPU-only: crash-truncation recovery unit tests for -# the archive reader (no GPU). -# hrr_workload_test.cc — Hidden ([.][hrr-direct]) GPU test cases invoked as -# subprocesses by hrr_roundtrip_test.cc; provides clean -# Windows process context for HIP + capture layer. -# hrr_repro_workload_test.cc — Hidden ([.][hrr-direct]) regression micro-kernels -# (first-hipMalloc capture, embedded-pointer struct -# args, uncaptured-host-write divergence, null optional -# output pointer 0x20000 fault class, replay zero-init). -# hrr_spt_workload_test.cc — Hidden ([.][hrr-direct]) workload for the -# per-thread-default-stream (_spt) entry points. Built -# with the per-thread compile option set below, which is -# how applications reach _spt; it must stay a separate -# translation unit so the other workloads keep resolving -# to the plain entry points. -# hrr_roundtrip_test.cc — Round-trip: sets HIP_HRR_CAPTURE_OUTPUT, spawns -# Unit_HRR_GpuWorkload_Direct / Unit_HRR_GraphWorkload_Direct -# as subprocesses, then runs hrr-playback to validate -# replayed D2H buffers byte-for-byte against captured blobs. -# -# hrr_reader.cpp is compiled directly into the test executable so the format -# tests can exercise the reader without a separate install step. - -if(NOT DEFINED HRR_CLR_DIR) - # Default: clr and hip-tests are siblings under projects/ - get_filename_component(HRR_CLR_DIR - "${CMAKE_CURRENT_SOURCE_DIR}/../../../../clr/hipamd/src/hrr" - ABSOLUTE) -endif() -if(NOT IS_DIRECTORY "${HRR_CLR_DIR}") - message(FATAL_ERROR "HRR_CLR_DIR not found: ${HRR_CLR_DIR}\n" - "Pass -DHRR_CLR_DIR= to point to clr/hipamd/src/hrr") -endif() +# Minimal HRR capture sentinel for hip-tests. +# Full HRR unit and integration tests live under projects/hrr/tests. set(TEST_SRC - hrr_format_test.cc - hrr_recovery_test.cc - hrr_playback_test.cc - hrr_workload_test.cc - hrr_repro_workload_test.cc - hrr_spt_workload_test.cc - hrr_roundtrip_test.cc - ${HRR_CLR_DIR}/playback/hrr_reader.cpp + hrr_capture_smoke_test.cc ) -# hrr_spt_workload_test.cc calls the ordinary hipMemset* names and relies on -# this option to redirect them to the _spt entry points under test. Per source, -# not per target: the remaining workloads must keep the plain entry points. -if(HIP_PLATFORM STREQUAL "amd") - set_source_files_properties(hrr_spt_workload_test.cc PROPERTIES - COMPILE_OPTIONS "-fgpu-default-stream=per-thread") -elseif(HIP_PLATFORM STREQUAL "nvidia") - set_source_files_properties(hrr_spt_workload_test.cc PROPERTIES - COMPILE_OPTIONS "--default-stream=per-thread") -endif() - hip_add_exe_to_target(NAME HrrTest TEST_SRC ${TEST_SRC} TEST_TARGET_NAME build_tests - LINKER_LIBS hiprtc::hiprtc PROPERTY CXX_STANDARD 17) -# On Linux with ROCm clang/lld, the system C++ stdlib is not automatically -# linked. Add it explicitly so that std::filesystem, std::ostream etc. resolve. -# Use plain (non-keyword) signature to match hip_add_exe_to_target's usage. -if(NOT WIN32) - target_link_libraries(HrrTest stdc++ stdc++fs) -endif() - -target_include_directories(HrrTest PRIVATE - ${HRR_CLR_DIR} - ${HRR_CLR_DIR}/playback -) - -# hrr_api_args.h uses a compile-time guard to emit the hrr_api_names[] string -# table in exactly one translation unit. -target_compile_definitions(HrrTest PRIVATE - HRR_API_ARGS_IMPLEMENTATION - __HIP_PLATFORM_AMD__ -) - -# --------------------------------------------------------------------------- -# hrr_roundtrip_test.cc needs: -# HRR_TEST_EXE — bare filename; SpawnProc resolves it from currentPath() -# (= CTest WORKING_DIRECTORY = HrrTest's own directory). -# HRR_PLAYBACK_EXE — bare filename; hrr-playback is copied next to HrrTest -# via POST_BUILD so it is always colocated. -# ROCM_BIN_PATH — prepended to PATH in the child so it finds amdhip64_7.dll -# (CTest/bash PATH does not include the ROCm bin directory) -# --------------------------------------------------------------------------- +# hrr_capture_smoke_test.cc needs: +# HRR_TEST_EXE — bare filename; SpawnProc resolves it from currentPath() +# (= CTest WORKING_DIRECTORY = HrrTest's own directory). +# ROCM_BIN_PATH — prepended to PATH in the child so it finds amdhip64_7.dll +# on Windows and the ROCm bin directory in packaged runs. if(HIP_PLATFORM STREQUAL "amd") - if(NOT DEFINED HRR_PLAYBACK_EXE) - find_program(HRR_PLAYBACK_EXE NAMES hrr-playback hrr-playback.exe - HINTS - "${CMAKE_INSTALL_PREFIX}/bin" - "${ROCM_PATH}/bin" - ) - endif() - if(NOT HRR_PLAYBACK_EXE) - message(FATAL_ERROR "hrr-playback not found.\n" - "Pass -DHRR_PLAYBACK_EXE= to cmake.") - endif() - message(STATUS "HRR playback: ${HRR_PLAYBACK_EXE}") - - # Copy hrr-playback next to HrrTest so SpawnProc finds it via the bare name - # "hrr-playback" (resolved from currentPath() = CTest WORKING_DIRECTORY). - # - # Two steps are needed: - # 1. POST_BUILD copy into the build-tree output dir (for local ctest runs). - # 2. install(PROGRAMS ...) into share/hip/catch_tests/ (for packaged runs). - # packaging/CMakeLists.txt installs all G_INSTALL_EXE_TARGETS there; - # we install hrr-playback to the same destination so it is colocated. - add_custom_command(TARGET HrrTest POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different - "${HRR_PLAYBACK_EXE}" - "$/" - COMMENT "Copying hrr-playback next to HrrTest" - ) - include(GNUInstallDirs) - install(PROGRAMS "${HRR_PLAYBACK_EXE}" - DESTINATION "${CMAKE_INSTALL_DATADIR}/hip/${CATCH_BUILD_DIR}") - - # Optional: hip_raw_trace.exe for Unit_HRR_MultiThreadRoundtrip. - # A genuine multi-threaded capture workload (4 threads + graph + pinned + hostReg). - # If not found, the MT roundtrip test is skipped at runtime via HRR_RAW_TRACE_EXE="". - if(NOT DEFINED HRR_RAW_TRACE_EXE) - # Use a local variable so find_program's cache sentinel (-NOTFOUND) does - # not leak into the compile definition. - find_program(_hrr_raw_trace_found NAMES hip_raw_trace hip_raw_trace.exe - HINTS - "${CMAKE_INSTALL_PREFIX}/bin" - "${ROCM_PATH}/bin" - ) - if(_hrr_raw_trace_found) - set(HRR_RAW_TRACE_EXE "${_hrr_raw_trace_found}") - else() - set(HRR_RAW_TRACE_EXE "") - endif() - endif() - message(STATUS "HRR raw trace: ${HRR_RAW_TRACE_EXE}") - target_compile_definitions(HrrTest PRIVATE - # Use the exe filename only (no directory). SpawnProc resolves relative - # paths via currentPath() which equals the CTest WORKING_DIRECTORY — - # the directory containing HrrTest.exe. This works both from the build - # tree and from an installed/packaged test run where the build tree is - # no longer present. HRR_TEST_EXE="HrrTest" - HRR_PLAYBACK_EXE="hrr-playback" - HRR_RAW_TRACE_EXE="${HRR_RAW_TRACE_EXE}" ROCM_BIN_PATH="${ROCM_PATH}/bin" ) endif() diff --git a/projects/hip-tests/catch/unit/hrr/hrr_capture_smoke_test.cc b/projects/hip-tests/catch/unit/hrr/hrr_capture_smoke_test.cc new file mode 100644 index 000000000000..294710e87ac1 --- /dev/null +++ b/projects/hip-tests/catch/unit/hrr/hrr_capture_smoke_test.cc @@ -0,0 +1,82 @@ +/* + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + +/** + * @addtogroup HRR HRR Capture Smoke + * @{ + * @ingroup HRRTest + * Minimal HIP-side sentinel for the HRR capture path. + * + * Full HRR format, playback, and GPU round-trip coverage lives in projects/hrr. + * This test only protects the HIP runtime integration point: a capture-enabled + * amdhip64 must honor HIP_HRR_CAPTURE_OUTPUT and write an archive. + */ + +#include +#include + +#include +#include +#include + +namespace fs = std::filesystem; + +#ifdef _WIN32 +static constexpr char kPathSep = ';'; +#else +static constexpr char kPathSep = ':'; +#endif + +static void set_proc_search_path(hip::SpawnProc& proc) { + const char* cur_path = getenv("PATH"); + proc.setEnv("PATH", + std::string(ROCM_BIN_PATH) + kPathSep + (cur_path ? cur_path : "")); +} + +struct ScopedDir { + fs::path path; + explicit ScopedDir(fs::path p) : path(std::move(p)) { fs::remove_all(path); } + ~ScopedDir() { fs::remove_all(path); } +}; + +static fs::path hrr_single_process_archive(const fs::path& root) { + if (fs::exists(root / "events.bin")) return root; + + std::vector archives; + for (const auto& ent : fs::directory_iterator(root)) { + if (!ent.is_directory()) continue; + const std::string name = ent.path().filename().string(); + if (name.rfind("pid-", 0) == 0 && fs::exists(ent.path() / "events.bin")) { + archives.push_back(ent.path()); + } + } + INFO("Process archive count: " << archives.size()); + REQUIRE(archives.size() == 1); + return archives.front(); +} + +TEST_CASE("Unit_HRR_CaptureSmoke_Direct", "[.][hrr-direct]") { + HIP_CHECK(hipFree(nullptr)); +} + +HIP_TEST_CASE(Unit_HRR_CaptureSmoke) { + ScopedDir cap{fs::temp_directory_path() / "hrr_capture_smoke"}; + + hip::SpawnProc proc(HRR_TEST_EXE); + proc.setEnv("HIP_HRR_CAPTURE_OUTPUT", cap.path.string()); + set_proc_search_path(proc); + int ret = proc.run("\"Unit_HRR_CaptureSmoke_Direct\""); + INFO("Capture subprocess exit code: " << ret); + REQUIRE(ret == 0); + + fs::path archive_path = hrr_single_process_archive(cap.path); + REQUIRE(fs::exists(archive_path / "events.bin")); +} + +/** + * End doxygen group HRR. + * @} + */ diff --git a/projects/hip/docs/how-to/debugging.rst b/projects/hip/docs/how-to/debugging.rst index 2aa06dfe3138..84c7c3c186d4 100644 --- a/projects/hip/docs/how-to/debugging.rst +++ b/projects/hip/docs/how-to/debugging.rst @@ -200,7 +200,7 @@ HIP Record & Replay HIP Record & Replay (HRR) captures HIP API traces into a binary archive and replays them on a live GPU for bug reproduction, debugging, and validation. During capture, HRR records every HIP API call made by an application into a binary archive (.hrr directory). During replay, it reproduces the original workload on a live GPU, including multi-threaded command submission, graph execution, and GPU memory transfers. -As described in https://github.com/ROCm/rocm-systems/blob/develop/projects/clr/hipamd/src/hrr/README.md +As described in https://github.com/ROCm/rocm-systems/blob/develop/projects/hrr/README.md HRR allows you to capture and replay runtime operations of a HIP kernel, letting you replay the kernel on other GPUs without having the avilable source code. This lets you review performance issues or execution problems without the actual application. diff --git a/projects/hrr/CMakeLists.txt b/projects/hrr/CMakeLists.txt new file mode 100644 index 000000000000..c1811bd00bef --- /dev/null +++ b/projects/hrr/CMakeLists.txt @@ -0,0 +1,34 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT + +cmake_minimum_required(VERSION 3.16) +project(hrr LANGUAGES CXX) + +option(HRR_BUILD_PLAYBACK "Build HRR playback tools" ON) +option(HRR_BUILD_TESTS "Build HRR unit tests" OFF) + +# Shared HRR archive wire format (header-only public interface). +add_library(hrr_api_args INTERFACE) +add_library(hrr::api_args ALIAS hrr_api_args) + +target_include_directories(hrr_api_args INTERFACE + $ + $ +) + +install(DIRECTORY include/ DESTINATION include) + +# The playback subdirectory defines both the CPU-only hrr_reader library and the +# HIP-dependent hrr-playback tool. hrr_reader is needed by the unit tests even +# when the playback tool itself is not built, so add the subdirectory when either +# playback or tests are enabled; hrr-playback and its HIP dependency are gated +# inside playback/CMakeLists.txt on HRR_BUILD_PLAYBACK. +if((HRR_BUILD_PLAYBACK OR HRR_BUILD_TESTS) AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/playback/CMakeLists.txt") + add_subdirectory(playback) +endif() + +if(HRR_BUILD_TESTS AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tests/CMakeLists.txt") + enable_testing() + add_subdirectory(tests) +endif() diff --git a/projects/clr/hipamd/src/hrr/DESIGN.md b/projects/hrr/DESIGN.md similarity index 94% rename from projects/clr/hipamd/src/hrr/DESIGN.md rename to projects/hrr/DESIGN.md index 803cc3b49d98..bf79baa5f09d 100644 --- a/projects/clr/hipamd/src/hrr/DESIGN.md +++ b/projects/hrr/DESIGN.md @@ -45,7 +45,7 @@ production performance measurement while capture is enabled. Replay has its own cost (re-executing the workload on GPU plus D2H validation); see sync and progress options in [README.md](README.md). -### Capture Layer (`hipamd/src/hrr/`) +### Capture Layer (`projects/clr/hipamd/src/hrr/`) At HIP init time the capture layer snapshots the real `HipDispatchTable` and installs a parallel capture table with ~529 shim function pointers. Every HIP API call flows through one of these shims, which records a fixed-size `hrr_event_header` (32 bytes: type, sequence ID, timestamp, thread ID) followed by a variable-length payload of serialised arguments into a streaming `events.bin` file. Twenty-seven APIs require hand-written shims (`MANUAL_CAPTURE_APIS`): kernel launches (4 variants), host-to-device memcpy (4 variants), module load (3 variants), `__hipRegisterFatBinary`, host memory registration (`hipHostRegister`, `hipHostUnregister`), all `hipMemcpy3D` variants (4), array creation, VMM, stream/memory attribute APIs, and others where struct pointer serialisation requires custom handling. All others are code-generated by `gen_hrr_api_args.py` from `hip_api_trace.hpp`. Fat binaries registered before shim install (C++ static-init) are recovered retroactively via `ForEachFatBinaryBlob` at init. @@ -154,21 +154,25 @@ Handle-creating and handle-destroying events (malloc, free, stream/event/module | File | Contents | |------|----------| -| `hrr_api_args.h` | 529 `hrr_args_*` structs + `hrr_api_id_t` enum | -| `hip_capture_generated.cpp` | ~517 capture shims + `hip_capture_build_table()` | -| `hip_playback_generated.cpp` | ~504 playback shims + `hrr_playback_dispatch[]` | +| `projects/hrr/include/hrr/hrr_api_args.h` | 529 `hrr_args_*` structs + `hrr_api_id_t` enum | +| `projects/clr/hipamd/src/hrr/hip_capture_generated.cpp` | ~517 capture shims + `hip_capture_build_table()` | +| `projects/hrr/playback/hip_playback_generated.cpp` | ~504 playback shims + `hrr_playback_dispatch[]` | -Run from `hipamd/src/hrr/`: `python gen_hrr_api_args.py` +Run from any directory: `python3 projects/hrr/tools/gen_hrr_api_args.py` (the generator resolves its output paths relative to its own location). ### Build ```bash -# Configure the CLR/HIP build tree once (Ninja, single-config) +# 1. Capture runtime: compiled into amdhip64 as part of the CLR/HIP build tree cmake -S projects/clr -B build -GNinja -DCLR_BUILD_HIP=ON -DHIP_PLATFORM=amd \ -DCMAKE_BUILD_TYPE=Release +ninja -C build amdhip64 +# Output: build/hipamd/lib/libamdhip64.so* -# Build the capture runtime + playback tool (same tree) -ninja -C build amdhip64 hrr-playback -# Output: build/hipamd/lib/libamdhip64.so* and build/.../hrr/playback/hrr-playback +# 2. Playback tool: built standalone from projects/hrr against a capture-enabled prefix +cmake -S projects/hrr -B hrr-build -DROCM_PATH= -DCMAKE_PREFIX_PATH= \ + -DCMAKE_BUILD_TYPE=Release +cmake --build hrr-build --target hrr-playback +# Output: hrr-build/playback/hrr-playback (installs to /bin/hrr-playback) ``` ### Usage @@ -204,26 +208,17 @@ the dispatch table at init time, replacing the out-of-tree proxy entirely. ## Directory Structure ``` -hipamd/src/hrr/ +projects/hrr/ — standalone HRR project (portable layer) DESIGN.md — this file - gen_hrr_api_args.py — generator: produces hrr_api_args.h, - hip_capture_generated.cpp, - playback/hip_playback_generated.cpp - hrr_api_args.h — AUTO-GENERATED: format constants, hrr_event_header, + README.md — user-facing quick start + tools/ + gen_hrr_api_args.py — generator: produces hrr_api_args.h and + playback/hip_playback_generated.cpp under + projects/hrr, plus hip_capture_generated.cpp + under projects/clr/hipamd/src/hrr + include/hrr/ + hrr_api_args.h — AUTO-GENERATED: format constants, hrr_event_header, one hrr_args_* struct per HIP API, hrr_api_id_t enum - hip_capture.h — public API (init/shutdown) + Hash128 type - hip_capture.cpp — 27 manual shims (kernel launch ×4, memcpy H2D+D2H ×8, - module load ×3, fat binary, hipHostRegister/Unregister, - hipMemcpy3D variants ×4, hipArrayCreate, hipArray3DCreate, - hipStreamSetAttribute, hipMemGetAllocationGranularity, - hipMemPoolSetAccess, hipMemSetAccess, hipMemcpyWithStream) - + dispatch table install/uninstall - hip_capture_writer.h/.cpp — streaming event serialization to events.bin / blobs/ - hip_capture_handles.h/.cpp — stream/event/module ID maps (mutex-guarded) - hip_capture_generated.cpp — AUTO-GENERATED: ~502 capture shims + build_table() - CMakeLists.txt — adds hrr/ sources to amdhip64 target; - add_subdirectory(playback) to build tools - playback/ hrr_reader.h/.cpp — archive loader, v3 format hip_playback.h — PlaybackContext (11 handle maps + host_reg_bufs), PlaybackFn typedef @@ -233,13 +228,23 @@ hipamd/src/hrr/ hipArrayCreate, VMM APIs, and more) hip_playback_generated.cpp — AUTO-GENERATED: ~201 playback shims + dispatch table hrr_playback.cpp — hrr-playback tool (replay + D2H validation + --info) - CMakeLists.txt — child build: hrr_reader + hrr_playback_lib + hrr-playback exe + CMakeLists.txt — hrr_reader lib + hrr-playback exe + tests/ — HRR CPU unit + GPU capture/replay integration tests + CMakeLists.txt — top-level HRR project (interface header, playback, tests) -test/ (separate tree, not part of this PR) - hip_raw_trace.cpp — multi-threaded integration test workload - (threadFunc ×4 + graphFunc + pinnedFunc + hostRegisterFunc) - capture: HIP_HRR_CAPTURE_OUTPUT=out.hrr ./hip_raw_trace - replay: hrr-playback out.hrr +projects/clr/hipamd/src/hrr/ — in-tree capture layer (compiled into amdhip64) + hip_capture.h — public API (init/shutdown) + Hash128 type + hip_capture.cpp — 27 manual shims (kernel launch ×4, memcpy H2D+D2H ×8, + module load ×3, fat binary, hipHostRegister/Unregister, + hipMemcpy3D variants ×4, hipArrayCreate, hipArray3DCreate, + hipStreamSetAttribute, hipMemGetAllocationGranularity, + hipMemPoolSetAccess, hipMemSetAccess, hipMemcpyWithStream) + + dispatch table install/uninstall + hip_capture_metadata.h/.cpp — capture-side metadata helpers + hip_capture_writer.h/.cpp — streaming event serialization to events.bin / blobs/ + hip_capture_generated.cpp — AUTO-GENERATED: ~502 capture shims + build_table() + CMakeLists.txt — adds capture sources to the amdhip64 target; the shared + hrr_api_args.h wire format is included from projects/hrr/include ``` ## Core Mechanism @@ -269,13 +274,13 @@ A single Python script produces three files from `hip_api_trace.hpp`: | Output | Description | |--------|-------------| -| `hrr/hrr_api_args.h` | Shared header: format constants, `hrr_event_header`, one `hrr_args_*` struct per API, `hrr_api_id_t` enum, `hrr_api_names[]` | -| `hrr/hip_capture_generated.cpp` | ~502 capture shims for APIs not in `MANUAL_CAPTURE_APIS` | -| `hrr/playback/hip_playback_generated.cpp` | ~201 playback shims + dispatch table for APIs not in `MANUAL_PLAYBACK_APIS` | +| `projects/hrr/include/hrr/hrr_api_args.h` | Shared header: format constants, `hrr_event_header`, one `hrr_args_*` struct per API, `hrr_api_id_t` enum, `hrr_api_names[]` | +| `projects/clr/hipamd/src/hrr/hip_capture_generated.cpp` | ~502 capture shims for APIs not in `MANUAL_CAPTURE_APIS` | +| `projects/hrr/playback/hip_playback_generated.cpp` | ~201 playback shims + dispatch table for APIs not in `MANUAL_PLAYBACK_APIS` | -Script location: `hipamd/src/hrr/gen_hrr_api_args.py` +Script location: `projects/hrr/tools/gen_hrr_api_args.py` -Run from `hipamd/src/hrr/`: `python3 gen_hrr_api_args.py` +Run from any directory: `python3 projects/hrr/tools/gen_hrr_api_args.py` (output paths resolve relative to the script location). The generator classifies each API: - **`MANUAL_CAPTURE_APIS`** (27): kernel launches ×4, memcpy H2D+D2H ×8, module load ×3, `__hipRegisterFatBinary`, `hipHostRegister/Unregister`, `hipMemcpy3D` variants ×4, array creation ×2, VMM, stream/memory attribute APIs, `hipMemcpyWithStream` @@ -664,11 +669,13 @@ synchronisation between threads is not replicated — see Limitations section. ## Build System -The playback tools are built as part of the main `amdhip` CMake tree via -`add_subdirectory(playback)` in `hrr/CMakeLists.txt`. No separate CMake tree is needed. +The capture layer compiles into `amdhip64` through +`projects/clr/hipamd/src/hrr/CMakeLists.txt`. The playback tools build from the +standalone `projects/hrr` project (`projects/hrr/playback/CMakeLists.txt`, wired in +from `projects/hrr/CMakeLists.txt`) against a capture-enabled ROCm/HIP install prefix. Builds are Linux/Ninja (on Windows, build inside WSL — there is no native Windows build). -### Capture runtime + playback tool (combined) +### Capture runtime (amdhip64) ```bash # Configure once (Ninja, single-config). Point at the live ROCm install and the # matching HIP headers; CMAKE_BUILD_TYPE selects the config (no --config flag). @@ -678,10 +685,22 @@ cmake -S projects/clr -B build -GNinja \ -DCLR_BUILD_HIP=ON -DCLR_BUILD_OCL=OFF -DHIP_PLATFORM=amd \ -DCMAKE_BUILD_TYPE=Release -# Build both targets -ninja -C build amdhip64 hrr-playback -j"$(nproc)" +ninja -C build amdhip64 -j"$(nproc)" # Runtime: build/hipamd/lib/libamdhip64.so* -# Tool: build/.../hrr/playback/hrr-playback (locate via: find build -name hrr-playback -type f) +``` + +### Playback tool (standalone HRR project) +```bash +# Build hrr-playback from projects/hrr against a capture-enabled ROCm/HIP prefix +# (the prefix that provides hip::host / libamdhip64). +cmake -S projects/hrr -B hrr-build \ + -DROCM_PATH= \ + -DCMAKE_PREFIX_PATH= \ + -DCMAKE_BUILD_TYPE=Release + +cmake --build hrr-build --target hrr-playback -j"$(nproc)" +# Tool: hrr-build/playback/hrr-playback (locate via: find hrr-build -name hrr-playback -type f; +# installs to /bin/hrr-playback) ``` ### Deploy diff --git a/projects/clr/hipamd/src/hrr/README.md b/projects/hrr/README.md similarity index 95% rename from projects/clr/hipamd/src/hrr/README.md rename to projects/hrr/README.md index b654feb33d5c..2abb0a1c6d9d 100644 --- a/projects/clr/hipamd/src/hrr/README.md +++ b/projects/hrr/README.md @@ -25,19 +25,20 @@ HIP_HRR_CAPTURE_OUTPUT=./out.hrr ./my_hip_app ## Build `hrr-playback` -From the ROCm CLR tree (`projects/clr`): +`hrr-playback` builds standalone from `projects/hrr` against a capture-enabled +ROCm/HIP install prefix (the prefix that provides `hip::host` / `libamdhip64`): ```bash -cmake -S . -B build -GNinja \ - -DHIP_COMMON_DIR= \ +cmake -S projects/hrr -B \ -DROCM_PATH="${ROCM_PATH:-/opt/rocm}" \ - -DCLR_BUILD_HIP=ON -DCLR_BUILD_OCL=OFF -DHIP_PLATFORM=amd \ + -DCMAKE_PREFIX_PATH="${ROCM_PATH:-/opt/rocm}" \ -DCMAKE_BUILD_TYPE=Release -ninja -C build amdhip64 hrr-playback -j"$(nproc)" +cmake --build --target hrr-playback -j"$(nproc)" ``` -Locate the binary: `find build -name hrr-playback -type f` +Locate the binary: `find -name hrr-playback -type f` +(installed to `/bin/hrr-playback`). Details: [DESIGN.md § Build System](DESIGN.md#build-system). diff --git a/projects/clr/hipamd/src/hrr/hrr_api_args.h b/projects/hrr/include/hrr/hrr_api_args.h similarity index 89% rename from projects/clr/hipamd/src/hrr/hrr_api_args.h rename to projects/hrr/include/hrr/hrr_api_args.h index 7c0377011458..e70a155cad00 100644 --- a/projects/clr/hipamd/src/hrr/hrr_api_args.h +++ b/projects/hrr/include/hrr/hrr_api_args.h @@ -614,6 +614,15 @@ typedef struct { uint64_t /* enum hipLimit_t */ limit; } hrr_args_hipDeviceGetLimit; +/* hipError_t hipDeviceGetLuid(char* luid, unsigned int* deviceNodeMask, hipDevice_t device) */ +typedef struct { + hrr_event_header hdr; + int32_t ret; + uint64_t luid; + uint64_t deviceNodeMask; + uint64_t device; +} hrr_args_hipDeviceGetLuid; + /* hipError_t hipDeviceGetMemPool(hipMemPool_t* mem_pool, int device) */ typedef struct { hrr_event_header hdr; @@ -2007,6 +2016,15 @@ typedef struct { uint32_t flags; } hrr_args_hipInit; +/* hipError_t hipInitDevice(int device, unsigned int deviceFlags, unsigned int flags) */ +typedef struct { + hrr_event_header hdr; + int32_t ret; + int32_t device; + uint32_t deviceFlags; + uint32_t flags; +} hrr_args_hipInitDevice; + /* hipError_t hipIpcCloseMemHandle(void* devPtr) */ typedef struct { hrr_event_header hdr; @@ -5357,6 +5375,15 @@ typedef struct { uint64_t event; } hrr_args_hipExecutionCtxWaitEvent; +/* hipError_t hipMemGetDefaultMemPool(hipMemPool_t* memPool, hipMemLocation* location, hipMemAllocationType type) */ +typedef struct { + hrr_event_header hdr; + int32_t ret; + uint64_t memPool; + uint64_t location; + int32_t type; +} hrr_args_hipMemGetDefaultMemPool; + /* ---- API id enumeration ---- */ typedef enum hrr_api_id { HRR_API_HIPPOPCALLCONFIGURATION = 0, @@ -5415,501 +5442,504 @@ typedef enum hrr_api_id { HRR_API_HIPDEVICEGETDEFAULTMEMPOOL = 53, HRR_API_HIPDEVICEGETGRAPHMEMATTRIBUTE = 54, HRR_API_HIPDEVICEGETLIMIT = 55, - HRR_API_HIPDEVICEGETMEMPOOL = 56, - HRR_API_HIPDEVICEGETNAME = 57, - HRR_API_HIPDEVICEGETP2PATTRIBUTE = 58, - HRR_API_HIPDEVICEGETPCIBUSID = 59, - HRR_API_HIPDEVICEGETSHAREDMEMCONFIG = 60, - HRR_API_HIPDEVICEGETSTREAMPRIORITYRANGE = 61, - HRR_API_HIPDEVICEGETUUID = 62, - HRR_API_HIPDEVICEGRAPHMEMTRIM = 63, - HRR_API_HIPDEVICEPRIMARYCTXGETSTATE = 64, - HRR_API_HIPDEVICEPRIMARYCTXRELEASE = 65, - HRR_API_HIPDEVICEPRIMARYCTXRESET = 66, - HRR_API_HIPDEVICEPRIMARYCTXRETAIN = 67, - HRR_API_HIPDEVICEPRIMARYCTXSETFLAGS = 68, - HRR_API_HIPDEVICERESET = 69, - HRR_API_HIPDEVICESETCACHECONFIG = 70, - HRR_API_HIPDEVICESETGRAPHMEMATTRIBUTE = 71, - HRR_API_HIPDEVICESETLIMIT = 72, - HRR_API_HIPDEVICESETMEMPOOL = 73, - HRR_API_HIPDEVICESETSHAREDMEMCONFIG = 74, - HRR_API_HIPDEVICESYNCHRONIZE = 75, - HRR_API_HIPDEVICETOTALMEM = 76, - HRR_API_HIPDRIVERGETVERSION = 77, - HRR_API_HIPDRVGETERRORNAME = 78, - HRR_API_HIPDRVGETERRORSTRING = 79, - HRR_API_HIPDRVGRAPHADDMEMCPYNODE = 80, - HRR_API_HIPDRVMEMCPY2DUNALIGNED = 81, - HRR_API_HIPDRVMEMCPY3D = 82, - HRR_API_HIPDRVMEMCPY3DASYNC = 83, - HRR_API_HIPDRVPOINTERGETATTRIBUTES = 84, - HRR_API_HIPEVENTCREATE = 85, - HRR_API_HIPEVENTCREATEWITHFLAGS = 86, - HRR_API_HIPEVENTDESTROY = 87, - HRR_API_HIPEVENTELAPSEDTIME = 88, - HRR_API_HIPEVENTQUERY = 89, - HRR_API_HIPEVENTRECORD = 90, - HRR_API_HIPEVENTSYNCHRONIZE = 91, - HRR_API_HIPEXTGETLINKTYPEANDHOPCOUNT = 92, - HRR_API_HIPEXTLAUNCHKERNEL = 93, - HRR_API_HIPEXTLAUNCHMULTIKERNELMULTIDEVICE = 94, - HRR_API_HIPEXTMALLOCWITHFLAGS = 95, - HRR_API_HIPEXTSTREAMCREATEWITHCUMASK = 96, - HRR_API_HIPEXTSTREAMGETCUMASK = 97, - HRR_API_HIPEXTERNALMEMORYGETMAPPEDBUFFER = 98, - HRR_API_HIPFREE = 99, - HRR_API_HIPFREEARRAY = 100, - HRR_API_HIPFREEASYNC = 101, - HRR_API_HIPFREEHOST = 102, - HRR_API_HIPFREEMIPMAPPEDARRAY = 103, - HRR_API_HIPFUNCGETATTRIBUTE = 104, - HRR_API_HIPFUNCGETATTRIBUTES = 105, - HRR_API_HIPFUNCSETATTRIBUTE = 106, - HRR_API_HIPFUNCSETCACHECONFIG = 107, - HRR_API_HIPFUNCSETSHAREDMEMCONFIG = 108, - HRR_API_HIPGLGETDEVICES = 109, - HRR_API_HIPGETCHANNELDESC = 110, - HRR_API_HIPGETDEVICE = 111, - HRR_API_HIPGETDEVICECOUNT = 112, - HRR_API_HIPGETDEVICEFLAGS = 113, - HRR_API_HIPGETDEVICEPROPERTIESR0600 = 114, - HRR_API_HIPGETDEVICEPROPERTIESR0000 = 115, - HRR_API_HIPGETERRORNAME = 116, - HRR_API_HIPGETERRORSTRING = 117, - HRR_API_HIPGETLASTERROR = 118, - HRR_API_HIPGETMIPMAPPEDARRAYLEVEL = 119, - HRR_API_HIPGETSYMBOLADDRESS = 120, - HRR_API_HIPGETSYMBOLSIZE = 121, - HRR_API_HIPGETTEXTUREALIGNMENTOFFSET = 122, - HRR_API_HIPGETTEXTUREOBJECTRESOURCEDESC = 123, - HRR_API_HIPGETTEXTUREOBJECTRESOURCEVIEWDESC = 124, - HRR_API_HIPGETTEXTUREOBJECTTEXTUREDESC = 125, - HRR_API_HIPGETTEXTUREREFERENCE = 126, - HRR_API_HIPGRAPHADDCHILDGRAPHNODE = 127, - HRR_API_HIPGRAPHADDDEPENDENCIES = 128, - HRR_API_HIPGRAPHADDEMPTYNODE = 129, - HRR_API_HIPGRAPHADDEVENTRECORDNODE = 130, - HRR_API_HIPGRAPHADDEVENTWAITNODE = 131, - HRR_API_HIPGRAPHADDHOSTNODE = 132, - HRR_API_HIPGRAPHADDKERNELNODE = 133, - HRR_API_HIPGRAPHADDMEMALLOCNODE = 134, - HRR_API_HIPGRAPHADDMEMFREENODE = 135, - HRR_API_HIPGRAPHADDMEMCPYNODE = 136, - HRR_API_HIPGRAPHADDMEMCPYNODE1D = 137, - HRR_API_HIPGRAPHADDMEMCPYNODEFROMSYMBOL = 138, - HRR_API_HIPGRAPHADDMEMCPYNODETOSYMBOL = 139, - HRR_API_HIPGRAPHADDMEMSETNODE = 140, - HRR_API_HIPGRAPHCHILDGRAPHNODEGETGRAPH = 141, - HRR_API_HIPGRAPHCLONE = 142, - HRR_API_HIPGRAPHCREATE = 143, - HRR_API_HIPGRAPHDEBUGDOTPRINT = 144, - HRR_API_HIPGRAPHDESTROY = 145, - HRR_API_HIPGRAPHDESTROYNODE = 146, - HRR_API_HIPGRAPHEVENTRECORDNODEGETEVENT = 147, - HRR_API_HIPGRAPHEVENTRECORDNODESETEVENT = 148, - HRR_API_HIPGRAPHEVENTWAITNODEGETEVENT = 149, - HRR_API_HIPGRAPHEVENTWAITNODESETEVENT = 150, - HRR_API_HIPGRAPHEXECCHILDGRAPHNODESETPARAMS = 151, - HRR_API_HIPGRAPHEXECDESTROY = 152, - HRR_API_HIPGRAPHEXECEVENTRECORDNODESETEVENT = 153, - HRR_API_HIPGRAPHEXECEVENTWAITNODESETEVENT = 154, - HRR_API_HIPGRAPHEXECHOSTNODESETPARAMS = 155, - HRR_API_HIPGRAPHEXECKERNELNODESETPARAMS = 156, - HRR_API_HIPGRAPHEXECMEMCPYNODESETPARAMS = 157, - HRR_API_HIPGRAPHEXECMEMCPYNODESETPARAMS1D = 158, - HRR_API_HIPGRAPHEXECMEMCPYNODESETPARAMSFROMSYMBOL = 159, - HRR_API_HIPGRAPHEXECMEMCPYNODESETPARAMSTOSYMBOL = 160, - HRR_API_HIPGRAPHEXECMEMSETNODESETPARAMS = 161, - HRR_API_HIPGRAPHEXECUPDATE = 162, - HRR_API_HIPGRAPHGETEDGES = 163, - HRR_API_HIPGRAPHGETNODES = 164, - HRR_API_HIPGRAPHGETROOTNODES = 165, - HRR_API_HIPGRAPHHOSTNODEGETPARAMS = 166, - HRR_API_HIPGRAPHHOSTNODESETPARAMS = 167, - HRR_API_HIPGRAPHINSTANTIATE = 168, - HRR_API_HIPGRAPHINSTANTIATEWITHFLAGS = 169, - HRR_API_HIPGRAPHKERNELNODECOPYATTRIBUTES = 170, - HRR_API_HIPGRAPHKERNELNODEGETATTRIBUTE = 171, - HRR_API_HIPGRAPHKERNELNODEGETPARAMS = 172, - HRR_API_HIPGRAPHKERNELNODESETATTRIBUTE = 173, - HRR_API_HIPGRAPHKERNELNODESETPARAMS = 174, - HRR_API_HIPGRAPHLAUNCH = 175, - HRR_API_HIPGRAPHMEMALLOCNODEGETPARAMS = 176, - HRR_API_HIPGRAPHMEMFREENODEGETPARAMS = 177, - HRR_API_HIPGRAPHMEMCPYNODEGETPARAMS = 178, - HRR_API_HIPGRAPHMEMCPYNODESETPARAMS = 179, - HRR_API_HIPGRAPHMEMCPYNODESETPARAMS1D = 180, - HRR_API_HIPGRAPHMEMCPYNODESETPARAMSFROMSYMBOL = 181, - HRR_API_HIPGRAPHMEMCPYNODESETPARAMSTOSYMBOL = 182, - HRR_API_HIPGRAPHMEMSETNODEGETPARAMS = 183, - HRR_API_HIPGRAPHMEMSETNODESETPARAMS = 184, - HRR_API_HIPGRAPHNODEFINDINCLONE = 185, - HRR_API_HIPGRAPHNODEGETDEPENDENCIES = 186, - HRR_API_HIPGRAPHNODEGETDEPENDENTNODES = 187, - HRR_API_HIPGRAPHNODEGETENABLED = 188, - HRR_API_HIPGRAPHNODEGETTYPE = 189, - HRR_API_HIPGRAPHNODESETENABLED = 190, - HRR_API_HIPGRAPHRELEASEUSEROBJECT = 191, - HRR_API_HIPGRAPHREMOVEDEPENDENCIES = 192, - HRR_API_HIPGRAPHRETAINUSEROBJECT = 193, - HRR_API_HIPGRAPHUPLOAD = 194, - HRR_API_HIPGRAPHICSGLREGISTERBUFFER = 195, - HRR_API_HIPGRAPHICSGLREGISTERIMAGE = 196, - HRR_API_HIPGRAPHICSMAPRESOURCES = 197, - HRR_API_HIPGRAPHICSRESOURCEGETMAPPEDPOINTER = 198, - HRR_API_HIPGRAPHICSSUBRESOURCEGETMAPPEDARRAY = 199, - HRR_API_HIPGRAPHICSUNMAPRESOURCES = 200, - HRR_API_HIPGRAPHICSUNREGISTERRESOURCE = 201, - HRR_API_HIPHOSTALLOC = 202, - HRR_API_HIPHOSTFREE = 203, - HRR_API_HIPHOSTGETDEVICEPOINTER = 204, - HRR_API_HIPHOSTGETFLAGS = 205, - HRR_API_HIPHOSTMALLOC = 206, - HRR_API_HIPHOSTREGISTER = 207, - HRR_API_HIPHOSTUNREGISTER = 208, - HRR_API_HIPIMPORTEXTERNALMEMORY = 209, - HRR_API_HIPIMPORTEXTERNALSEMAPHORE = 210, - HRR_API_HIPINIT = 211, - HRR_API_HIPIPCCLOSEMEMHANDLE = 212, - HRR_API_HIPIPCGETEVENTHANDLE = 213, - HRR_API_HIPIPCGETMEMHANDLE = 214, - HRR_API_HIPIPCOPENEVENTHANDLE = 215, - HRR_API_HIPIPCOPENMEMHANDLE = 216, - HRR_API_HIPKERNELNAMEREF = 217, - HRR_API_HIPKERNELNAMEREFBYPTR = 218, - HRR_API_HIPLAUNCHBYPTR = 219, - HRR_API_HIPLAUNCHCOOPERATIVEKERNEL = 220, - HRR_API_HIPLAUNCHCOOPERATIVEKERNELMULTIDEVICE = 221, - HRR_API_HIPLAUNCHHOSTFUNC = 222, - HRR_API_HIPLAUNCHKERNEL = 223, - HRR_API_HIPMALLOC = 224, - HRR_API_HIPMALLOC3D = 225, - HRR_API_HIPMALLOC3DARRAY = 226, - HRR_API_HIPMALLOCARRAY = 227, - HRR_API_HIPMALLOCASYNC = 228, - HRR_API_HIPMALLOCFROMPOOLASYNC = 229, - HRR_API_HIPMALLOCHOST = 230, - HRR_API_HIPMALLOCMANAGED = 231, - HRR_API_HIPMALLOCMIPMAPPEDARRAY = 232, - HRR_API_HIPMALLOCPITCH = 233, - HRR_API_HIPMEMADDRESSFREE = 234, - HRR_API_HIPMEMADDRESSRESERVE = 235, - HRR_API_HIPMEMADVISE = 236, - HRR_API_HIPMEMADVISE_V2 = 237, - HRR_API_HIPMEMALLOCHOST = 238, - HRR_API_HIPMEMALLOCPITCH = 239, - HRR_API_HIPMEMCREATE = 240, - HRR_API_HIPMEMEXPORTTOSHAREABLEHANDLE = 241, - HRR_API_HIPMEMGETACCESS = 242, - HRR_API_HIPMEMGETADDRESSRANGE = 243, - HRR_API_HIPMEMGETALLOCATIONGRANULARITY = 244, - HRR_API_HIPMEMGETALLOCATIONPROPERTIESFROMHANDLE = 245, - HRR_API_HIPMEMGETINFO = 246, - HRR_API_HIPMEMIMPORTFROMSHAREABLEHANDLE = 247, - HRR_API_HIPMEMMAP = 248, - HRR_API_HIPMEMMAPARRAYASYNC = 249, - HRR_API_HIPMEMPOOLCREATE = 250, - HRR_API_HIPMEMPOOLDESTROY = 251, - HRR_API_HIPMEMPOOLEXPORTPOINTER = 252, - HRR_API_HIPMEMPOOLEXPORTTOSHAREABLEHANDLE = 253, - HRR_API_HIPMEMPOOLGETACCESS = 254, - HRR_API_HIPMEMPOOLGETATTRIBUTE = 255, - HRR_API_HIPMEMPOOLIMPORTFROMSHAREABLEHANDLE = 256, - HRR_API_HIPMEMPOOLIMPORTPOINTER = 257, - HRR_API_HIPMEMPOOLSETACCESS = 258, - HRR_API_HIPMEMPOOLSETATTRIBUTE = 259, - HRR_API_HIPMEMPOOLTRIMTO = 260, - HRR_API_HIPMEMPREFETCHASYNC = 261, - HRR_API_HIPMEMPREFETCHASYNC_V2 = 262, - HRR_API_HIPMEMPREFETCHBATCHASYNC = 263, - HRR_API_HIPMEMDISCARDBATCHASYNC = 264, - HRR_API_HIPDRVMEMDISCARDBATCHASYNC = 265, - HRR_API_HIPMEMDISCARDANDPREFETCHBATCHASYNC = 266, - HRR_API_HIPDRVMEMDISCARDANDPREFETCHBATCHASYNC = 267, - HRR_API_HIPMEMPTRGETINFO = 268, - HRR_API_HIPMEMRANGEGETATTRIBUTE = 269, - HRR_API_HIPMEMRANGEGETATTRIBUTES = 270, - HRR_API_HIPMEMRELEASE = 271, - HRR_API_HIPMEMRETAINALLOCATIONHANDLE = 272, - HRR_API_HIPMEMSETACCESS = 273, - HRR_API_HIPMEMUNMAP = 274, - HRR_API_HIPMEMCPY = 275, - HRR_API_HIPMEMCPY2D = 276, - HRR_API_HIPMEMCPY2DASYNC = 277, - HRR_API_HIPMEMCPY2DFROMARRAY = 278, - HRR_API_HIPMEMCPY2DFROMARRAYASYNC = 279, - HRR_API_HIPMEMCPY2DTOARRAY = 280, - HRR_API_HIPMEMCPY2DTOARRAYASYNC = 281, - HRR_API_HIPMEMCPY3D = 282, - HRR_API_HIPMEMCPY3DASYNC = 283, - HRR_API_HIPMEMCPYASYNC = 284, - HRR_API_HIPMEMCPYATOH = 285, - HRR_API_HIPMEMCPYDTOD = 286, - HRR_API_HIPMEMCPYDTODASYNC = 287, - HRR_API_HIPMEMCPYDTOH = 288, - HRR_API_HIPMEMCPYDTOHASYNC = 289, - HRR_API_HIPMEMCPYFROMARRAY = 290, - HRR_API_HIPMEMCPYFROMSYMBOL = 291, - HRR_API_HIPMEMCPYFROMSYMBOLASYNC = 292, - HRR_API_HIPMEMCPYHTOA = 293, - HRR_API_HIPMEMCPYHTOD = 294, - HRR_API_HIPMEMCPYHTODASYNC = 295, - HRR_API_HIPMEMCPYPARAM2D = 296, - HRR_API_HIPMEMCPYPARAM2DASYNC = 297, - HRR_API_HIPMEMCPYPEER = 298, - HRR_API_HIPMEMCPYPEERASYNC = 299, - HRR_API_HIPMEMCPYTOARRAY = 300, - HRR_API_HIPMEMCPYTOSYMBOL = 301, - HRR_API_HIPMEMCPYTOSYMBOLASYNC = 302, - HRR_API_HIPMEMCPYWITHSTREAM = 303, - HRR_API_HIPMEMSET = 304, - HRR_API_HIPMEMSET2D = 305, - HRR_API_HIPMEMSET2DASYNC = 306, - HRR_API_HIPMEMSET3D = 307, - HRR_API_HIPMEMSET3DASYNC = 308, - HRR_API_HIPMEMSETASYNC = 309, - HRR_API_HIPMEMSETD16 = 310, - HRR_API_HIPMEMSETD16ASYNC = 311, - HRR_API_HIPMEMSETD32 = 312, - HRR_API_HIPMEMSETD32ASYNC = 313, - HRR_API_HIPMEMSETD8 = 314, - HRR_API_HIPMEMSETD8ASYNC = 315, - HRR_API_HIPMIPMAPPEDARRAYCREATE = 316, - HRR_API_HIPMIPMAPPEDARRAYDESTROY = 317, - HRR_API_HIPMIPMAPPEDARRAYGETLEVEL = 318, - HRR_API_HIPMODULEGETFUNCTION = 319, - HRR_API_HIPMODULEGETFUNCTIONCOUNT = 320, - HRR_API_HIPMODULEGETGLOBAL = 321, - HRR_API_HIPMODULEGETTEXREF = 322, - HRR_API_HIPMODULELAUNCHCOOPERATIVEKERNEL = 323, - HRR_API_HIPMODULELAUNCHCOOPERATIVEKERNELMULTIDEVICE = 324, - HRR_API_HIPMODULELAUNCHKERNEL = 325, - HRR_API_HIPMODULELOAD = 326, - HRR_API_HIPMODULELOADDATA = 327, - HRR_API_HIPMODULELOADDATAEX = 328, - HRR_API_HIPLINKADDDATA = 329, - HRR_API_HIPLINKADDFILE = 330, - HRR_API_HIPLINKCOMPLETE = 331, - HRR_API_HIPLINKCREATE = 332, - HRR_API_HIPLINKDESTROY = 333, - HRR_API_HIPMODULEOCCUPANCYMAXACTIVEBLOCKSPERMULTIPROCESSOR = 334, - HRR_API_HIPMODULEOCCUPANCYMAXACTIVEBLOCKSPERMULTIPROCESSORWITHFLAGS = 335, - HRR_API_HIPMODULEOCCUPANCYMAXPOTENTIALBLOCKSIZE = 336, - HRR_API_HIPMODULEOCCUPANCYMAXPOTENTIALBLOCKSIZEWITHFLAGS = 337, - HRR_API_HIPMODULEUNLOAD = 338, - HRR_API_HIPOCCUPANCYAVAILABLEDYNAMICSMEMPERBLOCK = 339, - HRR_API_HIPOCCUPANCYMAXACTIVEBLOCKSPERMULTIPROCESSOR = 340, - HRR_API_HIPOCCUPANCYMAXACTIVEBLOCKSPERMULTIPROCESSORWITHFLAGS = 341, - HRR_API_HIPOCCUPANCYMAXPOTENTIALBLOCKSIZE = 342, - HRR_API_HIPOCCUPANCYMAXACTIVECLUSTERS = 343, - HRR_API_HIPOCCUPANCYMAXPOTENTIALCLUSTERSIZE = 344, - HRR_API_HIPPEEKATLASTERROR = 345, - HRR_API_HIPPOINTERGETATTRIBUTE = 346, - HRR_API_HIPPOINTERGETATTRIBUTES = 347, - HRR_API_HIPPOINTERSETATTRIBUTE = 348, - HRR_API_HIPPROFILERSTART = 349, - HRR_API_HIPPROFILERSTOP = 350, - HRR_API_HIPRUNTIMEGETVERSION = 351, - HRR_API_HIPSETDEVICE = 352, - HRR_API_HIPSETDEVICEFLAGS = 353, - HRR_API_HIPSETUPARGUMENT = 354, - HRR_API_HIPSIGNALEXTERNALSEMAPHORESASYNC = 355, - HRR_API_HIPSTREAMADDCALLBACK = 356, - HRR_API_HIPSTREAMATTACHMEMASYNC = 357, - HRR_API_HIPSTREAMBEGINCAPTURE = 358, - HRR_API_HIPSTREAMCOPYATTRIBUTES = 359, - HRR_API_HIPSTREAMCREATE = 360, - HRR_API_HIPSTREAMCREATEWITHFLAGS = 361, - HRR_API_HIPSTREAMCREATEWITHPRIORITY = 362, - HRR_API_HIPSTREAMDESTROY = 363, - HRR_API_HIPSTREAMENDCAPTURE = 364, - HRR_API_HIPSTREAMGETCAPTUREINFO = 365, - HRR_API_HIPSTREAMGETCAPTUREINFO_V2 = 366, - HRR_API_HIPSTREAMGETDEVICE = 367, - HRR_API_HIPSTREAMGETFLAGS = 368, - HRR_API_HIPSTREAMGETID = 369, - HRR_API_HIPSTREAMGETPRIORITY = 370, - HRR_API_HIPSTREAMISCAPTURING = 371, - HRR_API_HIPSTREAMQUERY = 372, - HRR_API_HIPSTREAMSYNCHRONIZE = 373, - HRR_API_HIPSTREAMUPDATECAPTUREDEPENDENCIES = 374, - HRR_API_HIPSTREAMWAITEVENT = 375, - HRR_API_HIPSTREAMWAITVALUE32 = 376, - HRR_API_HIPSTREAMWAITVALUE64 = 377, - HRR_API_HIPSTREAMWRITEVALUE32 = 378, - HRR_API_HIPSTREAMWRITEVALUE64 = 379, - HRR_API_HIPSTREAMBATCHMEMOP = 380, - HRR_API_HIPTEXOBJECTCREATE = 381, - HRR_API_HIPTEXOBJECTDESTROY = 382, - HRR_API_HIPTEXOBJECTGETRESOURCEDESC = 383, - HRR_API_HIPTEXOBJECTGETRESOURCEVIEWDESC = 384, - HRR_API_HIPTEXOBJECTGETTEXTUREDESC = 385, - HRR_API_HIPTEXREFGETADDRESS = 386, - HRR_API_HIPTEXREFGETADDRESSMODE = 387, - HRR_API_HIPTEXREFGETFILTERMODE = 388, - HRR_API_HIPTEXREFGETFLAGS = 389, - HRR_API_HIPTEXREFGETFORMAT = 390, - HRR_API_HIPTEXREFGETMAXANISOTROPY = 391, - HRR_API_HIPTEXREFGETMIPMAPPEDARRAY = 392, - HRR_API_HIPTEXREFGETMIPMAPFILTERMODE = 393, - HRR_API_HIPTEXREFGETMIPMAPLEVELBIAS = 394, - HRR_API_HIPTEXREFGETMIPMAPLEVELCLAMP = 395, - HRR_API_HIPTEXREFSETADDRESS = 396, - HRR_API_HIPTEXREFSETADDRESS2D = 397, - HRR_API_HIPTEXREFSETADDRESSMODE = 398, - HRR_API_HIPTEXREFSETARRAY = 399, - HRR_API_HIPTEXREFSETBORDERCOLOR = 400, - HRR_API_HIPTEXREFSETFILTERMODE = 401, - HRR_API_HIPTEXREFSETFLAGS = 402, - HRR_API_HIPTEXREFSETFORMAT = 403, - HRR_API_HIPTEXREFSETMAXANISOTROPY = 404, - HRR_API_HIPTEXREFSETMIPMAPFILTERMODE = 405, - HRR_API_HIPTEXREFSETMIPMAPLEVELBIAS = 406, - HRR_API_HIPTEXREFSETMIPMAPLEVELCLAMP = 407, - HRR_API_HIPTEXREFSETMIPMAPPEDARRAY = 408, - HRR_API_HIPTHREADEXCHANGESTREAMCAPTUREMODE = 409, - HRR_API_HIPUNBINDTEXTURE = 410, - HRR_API_HIPUSEROBJECTCREATE = 411, - HRR_API_HIPUSEROBJECTRELEASE = 412, - HRR_API_HIPUSEROBJECTRETAIN = 413, - HRR_API_HIPWAITEXTERNALSEMAPHORESASYNC = 414, - HRR_API_HIPMEMCPY_SPT = 415, - HRR_API_HIPMEMCPYTOSYMBOL_SPT = 416, - HRR_API_HIPMEMCPYFROMSYMBOL_SPT = 417, - HRR_API_HIPMEMCPY2D_SPT = 418, - HRR_API_HIPMEMCPY2DFROMARRAY_SPT = 419, - HRR_API_HIPMEMCPY3D_SPT = 420, - HRR_API_HIPMEMSET_SPT = 421, - HRR_API_HIPMEMSETASYNC_SPT = 422, - HRR_API_HIPMEMSET2D_SPT = 423, - HRR_API_HIPMEMSET2DASYNC_SPT = 424, - HRR_API_HIPMEMSET3DASYNC_SPT = 425, - HRR_API_HIPMEMSET3D_SPT = 426, - HRR_API_HIPMEMCPYASYNC_SPT = 427, - HRR_API_HIPMEMCPY3DASYNC_SPT = 428, - HRR_API_HIPMEMCPY2DASYNC_SPT = 429, - HRR_API_HIPMEMCPYFROMSYMBOLASYNC_SPT = 430, - HRR_API_HIPMEMCPYTOSYMBOLASYNC_SPT = 431, - HRR_API_HIPMEMCPYFROMARRAY_SPT = 432, - HRR_API_HIPMEMCPY2DTOARRAY_SPT = 433, - HRR_API_HIPMEMCPY2DFROMARRAYASYNC_SPT = 434, - HRR_API_HIPMEMCPY2DTOARRAYASYNC_SPT = 435, - HRR_API_HIPSTREAMQUERY_SPT = 436, - HRR_API_HIPSTREAMSYNCHRONIZE_SPT = 437, - HRR_API_HIPSTREAMGETPRIORITY_SPT = 438, - HRR_API_HIPSTREAMWAITEVENT_SPT = 439, - HRR_API_HIPSTREAMGETFLAGS_SPT = 440, - HRR_API_HIPSTREAMADDCALLBACK_SPT = 441, - HRR_API_HIPEVENTRECORD_SPT = 442, - HRR_API_HIPLAUNCHCOOPERATIVEKERNEL_SPT = 443, - HRR_API_HIPLAUNCHKERNEL_SPT = 444, - HRR_API_HIPGRAPHLAUNCH_SPT = 445, - HRR_API_HIPSTREAMBEGINCAPTURE_SPT = 446, - HRR_API_HIPSTREAMENDCAPTURE_SPT = 447, - HRR_API_HIPSTREAMISCAPTURING_SPT = 448, - HRR_API_HIPSTREAMGETCAPTUREINFO_SPT = 449, - HRR_API_HIPSTREAMGETCAPTUREINFO_V2_SPT = 450, - HRR_API_HIPLAUNCHHOSTFUNC_SPT = 451, - HRR_API_HIPCREATECHANNELDESC = 452, - HRR_API_HIPEXTMODULELAUNCHKERNEL = 453, - HRR_API_HIPHCCMODULELAUNCHKERNEL = 454, - HRR_API_HIPGETSTREAMDEVICEID = 455, - HRR_API_HIPDRVGRAPHADDMEMSETNODE = 456, - HRR_API_HIPGRAPHADDEXTERNALSEMAPHORESWAITNODE = 457, - HRR_API_HIPGRAPHADDEXTERNALSEMAPHORESSIGNALNODE = 458, - HRR_API_HIPGRAPHEXTERNALSEMAPHORESSIGNALNODESETPARAMS = 459, - HRR_API_HIPGRAPHEXTERNALSEMAPHORESWAITNODESETPARAMS = 460, - HRR_API_HIPGRAPHEXTERNALSEMAPHORESSIGNALNODEGETPARAMS = 461, - HRR_API_HIPGRAPHEXTERNALSEMAPHORESWAITNODEGETPARAMS = 462, - HRR_API_HIPGRAPHEXECEXTERNALSEMAPHORESSIGNALNODESETPARAMS = 463, - HRR_API_HIPGRAPHEXECEXTERNALSEMAPHORESWAITNODESETPARAMS = 464, - HRR_API_HIPGRAPHADDNODE = 465, - HRR_API_HIPGRAPHINSTANTIATEWITHPARAMS = 466, - HRR_API_HIPEXTGETLASTERROR = 467, - HRR_API_HIPTEXREFGETBORDERCOLOR = 468, - HRR_API_HIPTEXREFGETARRAY = 469, - HRR_API_HIPGETPROCADDRESS = 470, - HRR_API_HIPSTREAMBEGINCAPTURETOGRAPH = 471, - HRR_API_HIPGETFUNCBYSYMBOL = 472, - HRR_API_HIPDRVGRAPHADDMEMFREENODE = 473, - HRR_API_HIPDRVGRAPHEXECMEMCPYNODESETPARAMS = 474, - HRR_API_HIPDRVGRAPHEXECMEMSETNODESETPARAMS = 475, - HRR_API_HIPSETVALIDDEVICES = 476, - HRR_API_HIPMEMCPYATOD = 477, - HRR_API_HIPMEMCPYDTOA = 478, - HRR_API_HIPMEMCPYATOA = 479, - HRR_API_HIPMEMCPYATOHASYNC = 480, - HRR_API_HIPMEMCPYHTOAASYNC = 481, - HRR_API_HIPMEMCPY2DARRAYTOARRAY = 482, - HRR_API_HIPGRAPHEXECGETFLAGS = 483, - HRR_API_HIPGRAPHNODESETPARAMS = 484, - HRR_API_HIPGRAPHEXECNODESETPARAMS = 485, - HRR_API_HIPEXTERNALMEMORYGETMAPPEDMIPMAPPEDARRAY = 486, - HRR_API_HIPDRVGRAPHMEMCPYNODEGETPARAMS = 487, - HRR_API_HIPDRVGRAPHMEMCPYNODESETPARAMS = 488, - HRR_API_HIPEXTHOSTALLOC = 489, - HRR_API_HIPDEVICEGETTEXTURE1DLINEARMAXWIDTH = 490, - HRR_API_HIPGRAPHADDBATCHMEMOPNODE = 491, - HRR_API_HIPGRAPHBATCHMEMOPNODEGETPARAMS = 492, - HRR_API_HIPGRAPHBATCHMEMOPNODESETPARAMS = 493, - HRR_API_HIPGRAPHEXECBATCHMEMOPNODESETPARAMS = 494, - HRR_API_HIPEVENTRECORDWITHFLAGS = 495, - HRR_API_HIPLAUNCHKERNELEXC = 496, - HRR_API_HIPDRVLAUNCHKERNELEX = 497, - HRR_API_HIPMEMGETHANDLEFORADDRESSRANGE = 498, - HRR_API_HIPMEMSETD2D8 = 499, - HRR_API_HIPMEMSETD2D8ASYNC = 500, - HRR_API_HIPMEMSETD2D16 = 501, - HRR_API_HIPMEMSETD2D16ASYNC = 502, - HRR_API_HIPMEMSETD2D32 = 503, - HRR_API_HIPMEMSETD2D32ASYNC = 504, - HRR_API_HIPSTREAMSETATTRIBUTE = 505, - HRR_API_HIPSTREAMGETATTRIBUTE = 506, - HRR_API_HIPMODULELOADFATBINARY = 507, - HRR_API_HIPMEMCPYBATCHASYNC = 508, - HRR_API_HIPMEMCPY3DBATCHASYNC = 509, - HRR_API_HIPMEMCPY3DPEER = 510, - HRR_API_HIPMEMCPY3DPEERASYNC = 511, - HRR_API_HIPGETDRIVERENTRYPOINT = 512, - HRR_API_HIPGETDRIVERENTRYPOINT_SPT = 513, - HRR_API_HIPLIBRARYLOADDATA = 514, - HRR_API_HIPLIBRARYLOADFROMFILE = 515, - HRR_API_HIPLIBRARYUNLOAD = 516, - HRR_API_HIPLIBRARYGETKERNEL = 517, - HRR_API_HIPLIBRARYGETKERNELCOUNT = 518, - HRR_API_HIPLIBRARYGETGLOBAL = 519, - HRR_API_HIPLIBRARYGETMANAGED = 520, - HRR_API_HIPLIBRARYENUMERATEKERNELS = 521, - HRR_API_HIPKERNELGETLIBRARY = 522, - HRR_API_HIPKERNELGETNAME = 523, - HRR_API_HIPGETPROCADDRESS_SPT = 524, - HRR_API_HIPEXTDISABLELOGGING = 525, - HRR_API_HIPEXTENABLELOGGING = 526, - HRR_API_HIPEXTSETLOGGINGPARAMS = 527, - HRR_API_HIPKERNELGETATTRIBUTE = 528, - HRR_API_HIPKERNELSETATTRIBUTE = 529, - HRR_API_HIPKERNELGETFUNCTION = 530, - HRR_API_HIPKERNELGETPARAMINFO = 531, - HRR_API_HIPMEMSETMEMPOOL = 532, - HRR_API_HIPMEMGETMEMPOOL = 533, - HRR_API_HIPMIPMAPPEDARRAYGETMEMORYREQUIREMENTS = 534, - HRR_API_HIPGREENCTXCREATE = 535, - HRR_API_HIPEXECUTIONCTXDESTROY = 536, - HRR_API_HIPEXECUTIONCTXSTREAMCREATE = 537, - HRR_API_HIPDEVICEGETDEVRESOURCE = 538, - HRR_API_HIPDEVSMRESOURCESPLITBYCOUNT = 539, - HRR_API_HIPDEVSMRESOURCESPLIT = 540, - HRR_API_HIPDEVRESOURCEGENERATEDESC = 541, - HRR_API_HIPDEVICEGETEXECUTIONCTX = 542, - HRR_API_HIPEXECUTIONCTXGETDEVRESOURCE = 543, - HRR_API_HIPEXECUTIONCTXGETDEVICE = 544, - HRR_API_HIPEXECUTIONCTXGETID = 545, - HRR_API_HIPSTREAMGETDEVRESOURCE = 546, - HRR_API_HIPEXECUTIONCTXRECORDEVENT = 547, - HRR_API_HIPEXECUTIONCTXSYNCHRONIZE = 548, - HRR_API_HIPEXECUTIONCTXWAITEVENT = 549, - HRR_API_COUNT = 550 + HRR_API_HIPDEVICEGETLUID = 56, + HRR_API_HIPDEVICEGETMEMPOOL = 57, + HRR_API_HIPDEVICEGETNAME = 58, + HRR_API_HIPDEVICEGETP2PATTRIBUTE = 59, + HRR_API_HIPDEVICEGETPCIBUSID = 60, + HRR_API_HIPDEVICEGETSHAREDMEMCONFIG = 61, + HRR_API_HIPDEVICEGETSTREAMPRIORITYRANGE = 62, + HRR_API_HIPDEVICEGETUUID = 63, + HRR_API_HIPDEVICEGRAPHMEMTRIM = 64, + HRR_API_HIPDEVICEPRIMARYCTXGETSTATE = 65, + HRR_API_HIPDEVICEPRIMARYCTXRELEASE = 66, + HRR_API_HIPDEVICEPRIMARYCTXRESET = 67, + HRR_API_HIPDEVICEPRIMARYCTXRETAIN = 68, + HRR_API_HIPDEVICEPRIMARYCTXSETFLAGS = 69, + HRR_API_HIPDEVICERESET = 70, + HRR_API_HIPDEVICESETCACHECONFIG = 71, + HRR_API_HIPDEVICESETGRAPHMEMATTRIBUTE = 72, + HRR_API_HIPDEVICESETLIMIT = 73, + HRR_API_HIPDEVICESETMEMPOOL = 74, + HRR_API_HIPDEVICESETSHAREDMEMCONFIG = 75, + HRR_API_HIPDEVICESYNCHRONIZE = 76, + HRR_API_HIPDEVICETOTALMEM = 77, + HRR_API_HIPDRIVERGETVERSION = 78, + HRR_API_HIPDRVGETERRORNAME = 79, + HRR_API_HIPDRVGETERRORSTRING = 80, + HRR_API_HIPDRVGRAPHADDMEMCPYNODE = 81, + HRR_API_HIPDRVMEMCPY2DUNALIGNED = 82, + HRR_API_HIPDRVMEMCPY3D = 83, + HRR_API_HIPDRVMEMCPY3DASYNC = 84, + HRR_API_HIPDRVPOINTERGETATTRIBUTES = 85, + HRR_API_HIPEVENTCREATE = 86, + HRR_API_HIPEVENTCREATEWITHFLAGS = 87, + HRR_API_HIPEVENTDESTROY = 88, + HRR_API_HIPEVENTELAPSEDTIME = 89, + HRR_API_HIPEVENTQUERY = 90, + HRR_API_HIPEVENTRECORD = 91, + HRR_API_HIPEVENTSYNCHRONIZE = 92, + HRR_API_HIPEXTGETLINKTYPEANDHOPCOUNT = 93, + HRR_API_HIPEXTLAUNCHKERNEL = 94, + HRR_API_HIPEXTLAUNCHMULTIKERNELMULTIDEVICE = 95, + HRR_API_HIPEXTMALLOCWITHFLAGS = 96, + HRR_API_HIPEXTSTREAMCREATEWITHCUMASK = 97, + HRR_API_HIPEXTSTREAMGETCUMASK = 98, + HRR_API_HIPEXTERNALMEMORYGETMAPPEDBUFFER = 99, + HRR_API_HIPFREE = 100, + HRR_API_HIPFREEARRAY = 101, + HRR_API_HIPFREEASYNC = 102, + HRR_API_HIPFREEHOST = 103, + HRR_API_HIPFREEMIPMAPPEDARRAY = 104, + HRR_API_HIPFUNCGETATTRIBUTE = 105, + HRR_API_HIPFUNCGETATTRIBUTES = 106, + HRR_API_HIPFUNCSETATTRIBUTE = 107, + HRR_API_HIPFUNCSETCACHECONFIG = 108, + HRR_API_HIPFUNCSETSHAREDMEMCONFIG = 109, + HRR_API_HIPGLGETDEVICES = 110, + HRR_API_HIPGETCHANNELDESC = 111, + HRR_API_HIPGETDEVICE = 112, + HRR_API_HIPGETDEVICECOUNT = 113, + HRR_API_HIPGETDEVICEFLAGS = 114, + HRR_API_HIPGETDEVICEPROPERTIESR0600 = 115, + HRR_API_HIPGETDEVICEPROPERTIESR0000 = 116, + HRR_API_HIPGETERRORNAME = 117, + HRR_API_HIPGETERRORSTRING = 118, + HRR_API_HIPGETLASTERROR = 119, + HRR_API_HIPGETMIPMAPPEDARRAYLEVEL = 120, + HRR_API_HIPGETSYMBOLADDRESS = 121, + HRR_API_HIPGETSYMBOLSIZE = 122, + HRR_API_HIPGETTEXTUREALIGNMENTOFFSET = 123, + HRR_API_HIPGETTEXTUREOBJECTRESOURCEDESC = 124, + HRR_API_HIPGETTEXTUREOBJECTRESOURCEVIEWDESC = 125, + HRR_API_HIPGETTEXTUREOBJECTTEXTUREDESC = 126, + HRR_API_HIPGETTEXTUREREFERENCE = 127, + HRR_API_HIPGRAPHADDCHILDGRAPHNODE = 128, + HRR_API_HIPGRAPHADDDEPENDENCIES = 129, + HRR_API_HIPGRAPHADDEMPTYNODE = 130, + HRR_API_HIPGRAPHADDEVENTRECORDNODE = 131, + HRR_API_HIPGRAPHADDEVENTWAITNODE = 132, + HRR_API_HIPGRAPHADDHOSTNODE = 133, + HRR_API_HIPGRAPHADDKERNELNODE = 134, + HRR_API_HIPGRAPHADDMEMALLOCNODE = 135, + HRR_API_HIPGRAPHADDMEMFREENODE = 136, + HRR_API_HIPGRAPHADDMEMCPYNODE = 137, + HRR_API_HIPGRAPHADDMEMCPYNODE1D = 138, + HRR_API_HIPGRAPHADDMEMCPYNODEFROMSYMBOL = 139, + HRR_API_HIPGRAPHADDMEMCPYNODETOSYMBOL = 140, + HRR_API_HIPGRAPHADDMEMSETNODE = 141, + HRR_API_HIPGRAPHCHILDGRAPHNODEGETGRAPH = 142, + HRR_API_HIPGRAPHCLONE = 143, + HRR_API_HIPGRAPHCREATE = 144, + HRR_API_HIPGRAPHDEBUGDOTPRINT = 145, + HRR_API_HIPGRAPHDESTROY = 146, + HRR_API_HIPGRAPHDESTROYNODE = 147, + HRR_API_HIPGRAPHEVENTRECORDNODEGETEVENT = 148, + HRR_API_HIPGRAPHEVENTRECORDNODESETEVENT = 149, + HRR_API_HIPGRAPHEVENTWAITNODEGETEVENT = 150, + HRR_API_HIPGRAPHEVENTWAITNODESETEVENT = 151, + HRR_API_HIPGRAPHEXECCHILDGRAPHNODESETPARAMS = 152, + HRR_API_HIPGRAPHEXECDESTROY = 153, + HRR_API_HIPGRAPHEXECEVENTRECORDNODESETEVENT = 154, + HRR_API_HIPGRAPHEXECEVENTWAITNODESETEVENT = 155, + HRR_API_HIPGRAPHEXECHOSTNODESETPARAMS = 156, + HRR_API_HIPGRAPHEXECKERNELNODESETPARAMS = 157, + HRR_API_HIPGRAPHEXECMEMCPYNODESETPARAMS = 158, + HRR_API_HIPGRAPHEXECMEMCPYNODESETPARAMS1D = 159, + HRR_API_HIPGRAPHEXECMEMCPYNODESETPARAMSFROMSYMBOL = 160, + HRR_API_HIPGRAPHEXECMEMCPYNODESETPARAMSTOSYMBOL = 161, + HRR_API_HIPGRAPHEXECMEMSETNODESETPARAMS = 162, + HRR_API_HIPGRAPHEXECUPDATE = 163, + HRR_API_HIPGRAPHGETEDGES = 164, + HRR_API_HIPGRAPHGETNODES = 165, + HRR_API_HIPGRAPHGETROOTNODES = 166, + HRR_API_HIPGRAPHHOSTNODEGETPARAMS = 167, + HRR_API_HIPGRAPHHOSTNODESETPARAMS = 168, + HRR_API_HIPGRAPHINSTANTIATE = 169, + HRR_API_HIPGRAPHINSTANTIATEWITHFLAGS = 170, + HRR_API_HIPGRAPHKERNELNODECOPYATTRIBUTES = 171, + HRR_API_HIPGRAPHKERNELNODEGETATTRIBUTE = 172, + HRR_API_HIPGRAPHKERNELNODEGETPARAMS = 173, + HRR_API_HIPGRAPHKERNELNODESETATTRIBUTE = 174, + HRR_API_HIPGRAPHKERNELNODESETPARAMS = 175, + HRR_API_HIPGRAPHLAUNCH = 176, + HRR_API_HIPGRAPHMEMALLOCNODEGETPARAMS = 177, + HRR_API_HIPGRAPHMEMFREENODEGETPARAMS = 178, + HRR_API_HIPGRAPHMEMCPYNODEGETPARAMS = 179, + HRR_API_HIPGRAPHMEMCPYNODESETPARAMS = 180, + HRR_API_HIPGRAPHMEMCPYNODESETPARAMS1D = 181, + HRR_API_HIPGRAPHMEMCPYNODESETPARAMSFROMSYMBOL = 182, + HRR_API_HIPGRAPHMEMCPYNODESETPARAMSTOSYMBOL = 183, + HRR_API_HIPGRAPHMEMSETNODEGETPARAMS = 184, + HRR_API_HIPGRAPHMEMSETNODESETPARAMS = 185, + HRR_API_HIPGRAPHNODEFINDINCLONE = 186, + HRR_API_HIPGRAPHNODEGETDEPENDENCIES = 187, + HRR_API_HIPGRAPHNODEGETDEPENDENTNODES = 188, + HRR_API_HIPGRAPHNODEGETENABLED = 189, + HRR_API_HIPGRAPHNODEGETTYPE = 190, + HRR_API_HIPGRAPHNODESETENABLED = 191, + HRR_API_HIPGRAPHRELEASEUSEROBJECT = 192, + HRR_API_HIPGRAPHREMOVEDEPENDENCIES = 193, + HRR_API_HIPGRAPHRETAINUSEROBJECT = 194, + HRR_API_HIPGRAPHUPLOAD = 195, + HRR_API_HIPGRAPHICSGLREGISTERBUFFER = 196, + HRR_API_HIPGRAPHICSGLREGISTERIMAGE = 197, + HRR_API_HIPGRAPHICSMAPRESOURCES = 198, + HRR_API_HIPGRAPHICSRESOURCEGETMAPPEDPOINTER = 199, + HRR_API_HIPGRAPHICSSUBRESOURCEGETMAPPEDARRAY = 200, + HRR_API_HIPGRAPHICSUNMAPRESOURCES = 201, + HRR_API_HIPGRAPHICSUNREGISTERRESOURCE = 202, + HRR_API_HIPHOSTALLOC = 203, + HRR_API_HIPHOSTFREE = 204, + HRR_API_HIPHOSTGETDEVICEPOINTER = 205, + HRR_API_HIPHOSTGETFLAGS = 206, + HRR_API_HIPHOSTMALLOC = 207, + HRR_API_HIPHOSTREGISTER = 208, + HRR_API_HIPHOSTUNREGISTER = 209, + HRR_API_HIPIMPORTEXTERNALMEMORY = 210, + HRR_API_HIPIMPORTEXTERNALSEMAPHORE = 211, + HRR_API_HIPINIT = 212, + HRR_API_HIPINITDEVICE = 213, + HRR_API_HIPIPCCLOSEMEMHANDLE = 214, + HRR_API_HIPIPCGETEVENTHANDLE = 215, + HRR_API_HIPIPCGETMEMHANDLE = 216, + HRR_API_HIPIPCOPENEVENTHANDLE = 217, + HRR_API_HIPIPCOPENMEMHANDLE = 218, + HRR_API_HIPKERNELNAMEREF = 219, + HRR_API_HIPKERNELNAMEREFBYPTR = 220, + HRR_API_HIPLAUNCHBYPTR = 221, + HRR_API_HIPLAUNCHCOOPERATIVEKERNEL = 222, + HRR_API_HIPLAUNCHCOOPERATIVEKERNELMULTIDEVICE = 223, + HRR_API_HIPLAUNCHHOSTFUNC = 224, + HRR_API_HIPLAUNCHKERNEL = 225, + HRR_API_HIPMALLOC = 226, + HRR_API_HIPMALLOC3D = 227, + HRR_API_HIPMALLOC3DARRAY = 228, + HRR_API_HIPMALLOCARRAY = 229, + HRR_API_HIPMALLOCASYNC = 230, + HRR_API_HIPMALLOCFROMPOOLASYNC = 231, + HRR_API_HIPMALLOCHOST = 232, + HRR_API_HIPMALLOCMANAGED = 233, + HRR_API_HIPMALLOCMIPMAPPEDARRAY = 234, + HRR_API_HIPMALLOCPITCH = 235, + HRR_API_HIPMEMADDRESSFREE = 236, + HRR_API_HIPMEMADDRESSRESERVE = 237, + HRR_API_HIPMEMADVISE = 238, + HRR_API_HIPMEMADVISE_V2 = 239, + HRR_API_HIPMEMALLOCHOST = 240, + HRR_API_HIPMEMALLOCPITCH = 241, + HRR_API_HIPMEMCREATE = 242, + HRR_API_HIPMEMEXPORTTOSHAREABLEHANDLE = 243, + HRR_API_HIPMEMGETACCESS = 244, + HRR_API_HIPMEMGETADDRESSRANGE = 245, + HRR_API_HIPMEMGETALLOCATIONGRANULARITY = 246, + HRR_API_HIPMEMGETALLOCATIONPROPERTIESFROMHANDLE = 247, + HRR_API_HIPMEMGETINFO = 248, + HRR_API_HIPMEMIMPORTFROMSHAREABLEHANDLE = 249, + HRR_API_HIPMEMMAP = 250, + HRR_API_HIPMEMMAPARRAYASYNC = 251, + HRR_API_HIPMEMPOOLCREATE = 252, + HRR_API_HIPMEMPOOLDESTROY = 253, + HRR_API_HIPMEMPOOLEXPORTPOINTER = 254, + HRR_API_HIPMEMPOOLEXPORTTOSHAREABLEHANDLE = 255, + HRR_API_HIPMEMPOOLGETACCESS = 256, + HRR_API_HIPMEMPOOLGETATTRIBUTE = 257, + HRR_API_HIPMEMPOOLIMPORTFROMSHAREABLEHANDLE = 258, + HRR_API_HIPMEMPOOLIMPORTPOINTER = 259, + HRR_API_HIPMEMPOOLSETACCESS = 260, + HRR_API_HIPMEMPOOLSETATTRIBUTE = 261, + HRR_API_HIPMEMPOOLTRIMTO = 262, + HRR_API_HIPMEMPREFETCHASYNC = 263, + HRR_API_HIPMEMPREFETCHASYNC_V2 = 264, + HRR_API_HIPMEMPREFETCHBATCHASYNC = 265, + HRR_API_HIPMEMDISCARDBATCHASYNC = 266, + HRR_API_HIPDRVMEMDISCARDBATCHASYNC = 267, + HRR_API_HIPMEMDISCARDANDPREFETCHBATCHASYNC = 268, + HRR_API_HIPDRVMEMDISCARDANDPREFETCHBATCHASYNC = 269, + HRR_API_HIPMEMPTRGETINFO = 270, + HRR_API_HIPMEMRANGEGETATTRIBUTE = 271, + HRR_API_HIPMEMRANGEGETATTRIBUTES = 272, + HRR_API_HIPMEMRELEASE = 273, + HRR_API_HIPMEMRETAINALLOCATIONHANDLE = 274, + HRR_API_HIPMEMSETACCESS = 275, + HRR_API_HIPMEMUNMAP = 276, + HRR_API_HIPMEMCPY = 277, + HRR_API_HIPMEMCPY2D = 278, + HRR_API_HIPMEMCPY2DASYNC = 279, + HRR_API_HIPMEMCPY2DFROMARRAY = 280, + HRR_API_HIPMEMCPY2DFROMARRAYASYNC = 281, + HRR_API_HIPMEMCPY2DTOARRAY = 282, + HRR_API_HIPMEMCPY2DTOARRAYASYNC = 283, + HRR_API_HIPMEMCPY3D = 284, + HRR_API_HIPMEMCPY3DASYNC = 285, + HRR_API_HIPMEMCPYASYNC = 286, + HRR_API_HIPMEMCPYATOH = 287, + HRR_API_HIPMEMCPYDTOD = 288, + HRR_API_HIPMEMCPYDTODASYNC = 289, + HRR_API_HIPMEMCPYDTOH = 290, + HRR_API_HIPMEMCPYDTOHASYNC = 291, + HRR_API_HIPMEMCPYFROMARRAY = 292, + HRR_API_HIPMEMCPYFROMSYMBOL = 293, + HRR_API_HIPMEMCPYFROMSYMBOLASYNC = 294, + HRR_API_HIPMEMCPYHTOA = 295, + HRR_API_HIPMEMCPYHTOD = 296, + HRR_API_HIPMEMCPYHTODASYNC = 297, + HRR_API_HIPMEMCPYPARAM2D = 298, + HRR_API_HIPMEMCPYPARAM2DASYNC = 299, + HRR_API_HIPMEMCPYPEER = 300, + HRR_API_HIPMEMCPYPEERASYNC = 301, + HRR_API_HIPMEMCPYTOARRAY = 302, + HRR_API_HIPMEMCPYTOSYMBOL = 303, + HRR_API_HIPMEMCPYTOSYMBOLASYNC = 304, + HRR_API_HIPMEMCPYWITHSTREAM = 305, + HRR_API_HIPMEMSET = 306, + HRR_API_HIPMEMSET2D = 307, + HRR_API_HIPMEMSET2DASYNC = 308, + HRR_API_HIPMEMSET3D = 309, + HRR_API_HIPMEMSET3DASYNC = 310, + HRR_API_HIPMEMSETASYNC = 311, + HRR_API_HIPMEMSETD16 = 312, + HRR_API_HIPMEMSETD16ASYNC = 313, + HRR_API_HIPMEMSETD32 = 314, + HRR_API_HIPMEMSETD32ASYNC = 315, + HRR_API_HIPMEMSETD8 = 316, + HRR_API_HIPMEMSETD8ASYNC = 317, + HRR_API_HIPMIPMAPPEDARRAYCREATE = 318, + HRR_API_HIPMIPMAPPEDARRAYDESTROY = 319, + HRR_API_HIPMIPMAPPEDARRAYGETLEVEL = 320, + HRR_API_HIPMODULEGETFUNCTION = 321, + HRR_API_HIPMODULEGETFUNCTIONCOUNT = 322, + HRR_API_HIPMODULEGETGLOBAL = 323, + HRR_API_HIPMODULEGETTEXREF = 324, + HRR_API_HIPMODULELAUNCHCOOPERATIVEKERNEL = 325, + HRR_API_HIPMODULELAUNCHCOOPERATIVEKERNELMULTIDEVICE = 326, + HRR_API_HIPMODULELAUNCHKERNEL = 327, + HRR_API_HIPMODULELOAD = 328, + HRR_API_HIPMODULELOADDATA = 329, + HRR_API_HIPMODULELOADDATAEX = 330, + HRR_API_HIPLINKADDDATA = 331, + HRR_API_HIPLINKADDFILE = 332, + HRR_API_HIPLINKCOMPLETE = 333, + HRR_API_HIPLINKCREATE = 334, + HRR_API_HIPLINKDESTROY = 335, + HRR_API_HIPMODULEOCCUPANCYMAXACTIVEBLOCKSPERMULTIPROCESSOR = 336, + HRR_API_HIPMODULEOCCUPANCYMAXACTIVEBLOCKSPERMULTIPROCESSORWITHFLAGS = 337, + HRR_API_HIPMODULEOCCUPANCYMAXPOTENTIALBLOCKSIZE = 338, + HRR_API_HIPMODULEOCCUPANCYMAXPOTENTIALBLOCKSIZEWITHFLAGS = 339, + HRR_API_HIPMODULEUNLOAD = 340, + HRR_API_HIPOCCUPANCYAVAILABLEDYNAMICSMEMPERBLOCK = 341, + HRR_API_HIPOCCUPANCYMAXACTIVEBLOCKSPERMULTIPROCESSOR = 342, + HRR_API_HIPOCCUPANCYMAXACTIVEBLOCKSPERMULTIPROCESSORWITHFLAGS = 343, + HRR_API_HIPOCCUPANCYMAXPOTENTIALBLOCKSIZE = 344, + HRR_API_HIPOCCUPANCYMAXACTIVECLUSTERS = 345, + HRR_API_HIPOCCUPANCYMAXPOTENTIALCLUSTERSIZE = 346, + HRR_API_HIPPEEKATLASTERROR = 347, + HRR_API_HIPPOINTERGETATTRIBUTE = 348, + HRR_API_HIPPOINTERGETATTRIBUTES = 349, + HRR_API_HIPPOINTERSETATTRIBUTE = 350, + HRR_API_HIPPROFILERSTART = 351, + HRR_API_HIPPROFILERSTOP = 352, + HRR_API_HIPRUNTIMEGETVERSION = 353, + HRR_API_HIPSETDEVICE = 354, + HRR_API_HIPSETDEVICEFLAGS = 355, + HRR_API_HIPSETUPARGUMENT = 356, + HRR_API_HIPSIGNALEXTERNALSEMAPHORESASYNC = 357, + HRR_API_HIPSTREAMADDCALLBACK = 358, + HRR_API_HIPSTREAMATTACHMEMASYNC = 359, + HRR_API_HIPSTREAMBEGINCAPTURE = 360, + HRR_API_HIPSTREAMCOPYATTRIBUTES = 361, + HRR_API_HIPSTREAMCREATE = 362, + HRR_API_HIPSTREAMCREATEWITHFLAGS = 363, + HRR_API_HIPSTREAMCREATEWITHPRIORITY = 364, + HRR_API_HIPSTREAMDESTROY = 365, + HRR_API_HIPSTREAMENDCAPTURE = 366, + HRR_API_HIPSTREAMGETCAPTUREINFO = 367, + HRR_API_HIPSTREAMGETCAPTUREINFO_V2 = 368, + HRR_API_HIPSTREAMGETDEVICE = 369, + HRR_API_HIPSTREAMGETFLAGS = 370, + HRR_API_HIPSTREAMGETID = 371, + HRR_API_HIPSTREAMGETPRIORITY = 372, + HRR_API_HIPSTREAMISCAPTURING = 373, + HRR_API_HIPSTREAMQUERY = 374, + HRR_API_HIPSTREAMSYNCHRONIZE = 375, + HRR_API_HIPSTREAMUPDATECAPTUREDEPENDENCIES = 376, + HRR_API_HIPSTREAMWAITEVENT = 377, + HRR_API_HIPSTREAMWAITVALUE32 = 378, + HRR_API_HIPSTREAMWAITVALUE64 = 379, + HRR_API_HIPSTREAMWRITEVALUE32 = 380, + HRR_API_HIPSTREAMWRITEVALUE64 = 381, + HRR_API_HIPSTREAMBATCHMEMOP = 382, + HRR_API_HIPTEXOBJECTCREATE = 383, + HRR_API_HIPTEXOBJECTDESTROY = 384, + HRR_API_HIPTEXOBJECTGETRESOURCEDESC = 385, + HRR_API_HIPTEXOBJECTGETRESOURCEVIEWDESC = 386, + HRR_API_HIPTEXOBJECTGETTEXTUREDESC = 387, + HRR_API_HIPTEXREFGETADDRESS = 388, + HRR_API_HIPTEXREFGETADDRESSMODE = 389, + HRR_API_HIPTEXREFGETFILTERMODE = 390, + HRR_API_HIPTEXREFGETFLAGS = 391, + HRR_API_HIPTEXREFGETFORMAT = 392, + HRR_API_HIPTEXREFGETMAXANISOTROPY = 393, + HRR_API_HIPTEXREFGETMIPMAPPEDARRAY = 394, + HRR_API_HIPTEXREFGETMIPMAPFILTERMODE = 395, + HRR_API_HIPTEXREFGETMIPMAPLEVELBIAS = 396, + HRR_API_HIPTEXREFGETMIPMAPLEVELCLAMP = 397, + HRR_API_HIPTEXREFSETADDRESS = 398, + HRR_API_HIPTEXREFSETADDRESS2D = 399, + HRR_API_HIPTEXREFSETADDRESSMODE = 400, + HRR_API_HIPTEXREFSETARRAY = 401, + HRR_API_HIPTEXREFSETBORDERCOLOR = 402, + HRR_API_HIPTEXREFSETFILTERMODE = 403, + HRR_API_HIPTEXREFSETFLAGS = 404, + HRR_API_HIPTEXREFSETFORMAT = 405, + HRR_API_HIPTEXREFSETMAXANISOTROPY = 406, + HRR_API_HIPTEXREFSETMIPMAPFILTERMODE = 407, + HRR_API_HIPTEXREFSETMIPMAPLEVELBIAS = 408, + HRR_API_HIPTEXREFSETMIPMAPLEVELCLAMP = 409, + HRR_API_HIPTEXREFSETMIPMAPPEDARRAY = 410, + HRR_API_HIPTHREADEXCHANGESTREAMCAPTUREMODE = 411, + HRR_API_HIPUNBINDTEXTURE = 412, + HRR_API_HIPUSEROBJECTCREATE = 413, + HRR_API_HIPUSEROBJECTRELEASE = 414, + HRR_API_HIPUSEROBJECTRETAIN = 415, + HRR_API_HIPWAITEXTERNALSEMAPHORESASYNC = 416, + HRR_API_HIPMEMCPY_SPT = 417, + HRR_API_HIPMEMCPYTOSYMBOL_SPT = 418, + HRR_API_HIPMEMCPYFROMSYMBOL_SPT = 419, + HRR_API_HIPMEMCPY2D_SPT = 420, + HRR_API_HIPMEMCPY2DFROMARRAY_SPT = 421, + HRR_API_HIPMEMCPY3D_SPT = 422, + HRR_API_HIPMEMSET_SPT = 423, + HRR_API_HIPMEMSETASYNC_SPT = 424, + HRR_API_HIPMEMSET2D_SPT = 425, + HRR_API_HIPMEMSET2DASYNC_SPT = 426, + HRR_API_HIPMEMSET3DASYNC_SPT = 427, + HRR_API_HIPMEMSET3D_SPT = 428, + HRR_API_HIPMEMCPYASYNC_SPT = 429, + HRR_API_HIPMEMCPY3DASYNC_SPT = 430, + HRR_API_HIPMEMCPY2DASYNC_SPT = 431, + HRR_API_HIPMEMCPYFROMSYMBOLASYNC_SPT = 432, + HRR_API_HIPMEMCPYTOSYMBOLASYNC_SPT = 433, + HRR_API_HIPMEMCPYFROMARRAY_SPT = 434, + HRR_API_HIPMEMCPY2DTOARRAY_SPT = 435, + HRR_API_HIPMEMCPY2DFROMARRAYASYNC_SPT = 436, + HRR_API_HIPMEMCPY2DTOARRAYASYNC_SPT = 437, + HRR_API_HIPSTREAMQUERY_SPT = 438, + HRR_API_HIPSTREAMSYNCHRONIZE_SPT = 439, + HRR_API_HIPSTREAMGETPRIORITY_SPT = 440, + HRR_API_HIPSTREAMWAITEVENT_SPT = 441, + HRR_API_HIPSTREAMGETFLAGS_SPT = 442, + HRR_API_HIPSTREAMADDCALLBACK_SPT = 443, + HRR_API_HIPEVENTRECORD_SPT = 444, + HRR_API_HIPLAUNCHCOOPERATIVEKERNEL_SPT = 445, + HRR_API_HIPLAUNCHKERNEL_SPT = 446, + HRR_API_HIPGRAPHLAUNCH_SPT = 447, + HRR_API_HIPSTREAMBEGINCAPTURE_SPT = 448, + HRR_API_HIPSTREAMENDCAPTURE_SPT = 449, + HRR_API_HIPSTREAMISCAPTURING_SPT = 450, + HRR_API_HIPSTREAMGETCAPTUREINFO_SPT = 451, + HRR_API_HIPSTREAMGETCAPTUREINFO_V2_SPT = 452, + HRR_API_HIPLAUNCHHOSTFUNC_SPT = 453, + HRR_API_HIPCREATECHANNELDESC = 454, + HRR_API_HIPEXTMODULELAUNCHKERNEL = 455, + HRR_API_HIPHCCMODULELAUNCHKERNEL = 456, + HRR_API_HIPGETSTREAMDEVICEID = 457, + HRR_API_HIPDRVGRAPHADDMEMSETNODE = 458, + HRR_API_HIPGRAPHADDEXTERNALSEMAPHORESWAITNODE = 459, + HRR_API_HIPGRAPHADDEXTERNALSEMAPHORESSIGNALNODE = 460, + HRR_API_HIPGRAPHEXTERNALSEMAPHORESSIGNALNODESETPARAMS = 461, + HRR_API_HIPGRAPHEXTERNALSEMAPHORESWAITNODESETPARAMS = 462, + HRR_API_HIPGRAPHEXTERNALSEMAPHORESSIGNALNODEGETPARAMS = 463, + HRR_API_HIPGRAPHEXTERNALSEMAPHORESWAITNODEGETPARAMS = 464, + HRR_API_HIPGRAPHEXECEXTERNALSEMAPHORESSIGNALNODESETPARAMS = 465, + HRR_API_HIPGRAPHEXECEXTERNALSEMAPHORESWAITNODESETPARAMS = 466, + HRR_API_HIPGRAPHADDNODE = 467, + HRR_API_HIPGRAPHINSTANTIATEWITHPARAMS = 468, + HRR_API_HIPEXTGETLASTERROR = 469, + HRR_API_HIPTEXREFGETBORDERCOLOR = 470, + HRR_API_HIPTEXREFGETARRAY = 471, + HRR_API_HIPGETPROCADDRESS = 472, + HRR_API_HIPSTREAMBEGINCAPTURETOGRAPH = 473, + HRR_API_HIPGETFUNCBYSYMBOL = 474, + HRR_API_HIPDRVGRAPHADDMEMFREENODE = 475, + HRR_API_HIPDRVGRAPHEXECMEMCPYNODESETPARAMS = 476, + HRR_API_HIPDRVGRAPHEXECMEMSETNODESETPARAMS = 477, + HRR_API_HIPSETVALIDDEVICES = 478, + HRR_API_HIPMEMCPYATOD = 479, + HRR_API_HIPMEMCPYDTOA = 480, + HRR_API_HIPMEMCPYATOA = 481, + HRR_API_HIPMEMCPYATOHASYNC = 482, + HRR_API_HIPMEMCPYHTOAASYNC = 483, + HRR_API_HIPMEMCPY2DARRAYTOARRAY = 484, + HRR_API_HIPGRAPHEXECGETFLAGS = 485, + HRR_API_HIPGRAPHNODESETPARAMS = 486, + HRR_API_HIPGRAPHEXECNODESETPARAMS = 487, + HRR_API_HIPEXTERNALMEMORYGETMAPPEDMIPMAPPEDARRAY = 488, + HRR_API_HIPDRVGRAPHMEMCPYNODEGETPARAMS = 489, + HRR_API_HIPDRVGRAPHMEMCPYNODESETPARAMS = 490, + HRR_API_HIPEXTHOSTALLOC = 491, + HRR_API_HIPDEVICEGETTEXTURE1DLINEARMAXWIDTH = 492, + HRR_API_HIPGRAPHADDBATCHMEMOPNODE = 493, + HRR_API_HIPGRAPHBATCHMEMOPNODEGETPARAMS = 494, + HRR_API_HIPGRAPHBATCHMEMOPNODESETPARAMS = 495, + HRR_API_HIPGRAPHEXECBATCHMEMOPNODESETPARAMS = 496, + HRR_API_HIPEVENTRECORDWITHFLAGS = 497, + HRR_API_HIPLAUNCHKERNELEXC = 498, + HRR_API_HIPDRVLAUNCHKERNELEX = 499, + HRR_API_HIPMEMGETHANDLEFORADDRESSRANGE = 500, + HRR_API_HIPMEMSETD2D8 = 501, + HRR_API_HIPMEMSETD2D8ASYNC = 502, + HRR_API_HIPMEMSETD2D16 = 503, + HRR_API_HIPMEMSETD2D16ASYNC = 504, + HRR_API_HIPMEMSETD2D32 = 505, + HRR_API_HIPMEMSETD2D32ASYNC = 506, + HRR_API_HIPSTREAMSETATTRIBUTE = 507, + HRR_API_HIPSTREAMGETATTRIBUTE = 508, + HRR_API_HIPMODULELOADFATBINARY = 509, + HRR_API_HIPMEMCPYBATCHASYNC = 510, + HRR_API_HIPMEMCPY3DBATCHASYNC = 511, + HRR_API_HIPMEMCPY3DPEER = 512, + HRR_API_HIPMEMCPY3DPEERASYNC = 513, + HRR_API_HIPGETDRIVERENTRYPOINT = 514, + HRR_API_HIPGETDRIVERENTRYPOINT_SPT = 515, + HRR_API_HIPLIBRARYLOADDATA = 516, + HRR_API_HIPLIBRARYLOADFROMFILE = 517, + HRR_API_HIPLIBRARYUNLOAD = 518, + HRR_API_HIPLIBRARYGETKERNEL = 519, + HRR_API_HIPLIBRARYGETKERNELCOUNT = 520, + HRR_API_HIPLIBRARYGETGLOBAL = 521, + HRR_API_HIPLIBRARYGETMANAGED = 522, + HRR_API_HIPLIBRARYENUMERATEKERNELS = 523, + HRR_API_HIPKERNELGETLIBRARY = 524, + HRR_API_HIPKERNELGETNAME = 525, + HRR_API_HIPGETPROCADDRESS_SPT = 526, + HRR_API_HIPEXTDISABLELOGGING = 527, + HRR_API_HIPEXTENABLELOGGING = 528, + HRR_API_HIPEXTSETLOGGINGPARAMS = 529, + HRR_API_HIPKERNELGETATTRIBUTE = 530, + HRR_API_HIPKERNELSETATTRIBUTE = 531, + HRR_API_HIPKERNELGETFUNCTION = 532, + HRR_API_HIPKERNELGETPARAMINFO = 533, + HRR_API_HIPMEMSETMEMPOOL = 534, + HRR_API_HIPMEMGETMEMPOOL = 535, + HRR_API_HIPMIPMAPPEDARRAYGETMEMORYREQUIREMENTS = 536, + HRR_API_HIPGREENCTXCREATE = 537, + HRR_API_HIPEXECUTIONCTXDESTROY = 538, + HRR_API_HIPEXECUTIONCTXSTREAMCREATE = 539, + HRR_API_HIPDEVICEGETDEVRESOURCE = 540, + HRR_API_HIPDEVSMRESOURCESPLITBYCOUNT = 541, + HRR_API_HIPDEVSMRESOURCESPLIT = 542, + HRR_API_HIPDEVRESOURCEGENERATEDESC = 543, + HRR_API_HIPDEVICEGETEXECUTIONCTX = 544, + HRR_API_HIPEXECUTIONCTXGETDEVRESOURCE = 545, + HRR_API_HIPEXECUTIONCTXGETDEVICE = 546, + HRR_API_HIPEXECUTIONCTXGETID = 547, + HRR_API_HIPSTREAMGETDEVRESOURCE = 548, + HRR_API_HIPEXECUTIONCTXRECORDEVENT = 549, + HRR_API_HIPEXECUTIONCTXSYNCHRONIZE = 550, + HRR_API_HIPEXECUTIONCTXWAITEVENT = 551, + HRR_API_HIPMEMGETDEFAULTMEMPOOL = 552, + HRR_API_COUNT = 553 } hrr_api_id_t; /* Array of API names indexed by hrr_api_id_t */ @@ -5971,6 +6001,7 @@ const char* const hrr_api_names[HRR_API_COUNT] = { "hipDeviceGetDefaultMemPool", "hipDeviceGetGraphMemAttribute", "hipDeviceGetLimit", + "hipDeviceGetLuid", "hipDeviceGetMemPool", "hipDeviceGetName", "hipDeviceGetP2PAttribute", @@ -6127,6 +6158,7 @@ const char* const hrr_api_names[HRR_API_COUNT] = { "hipImportExternalMemory", "hipImportExternalSemaphore", "hipInit", + "hipInitDevice", "hipIpcCloseMemHandle", "hipIpcGetEventHandle", "hipIpcGetMemHandle", @@ -6465,6 +6497,7 @@ const char* const hrr_api_names[HRR_API_COUNT] = { "hipExecutionCtxRecordEvent", "hipExecutionCtxSynchronize", "hipExecutionCtxWaitEvent", + "hipMemGetDefaultMemPool", }; #else extern const char* const hrr_api_names[HRR_API_COUNT]; diff --git a/projects/hrr/playback/CMakeLists.txt b/projects/hrr/playback/CMakeLists.txt new file mode 100644 index 000000000000..3839d9c7ac11 --- /dev/null +++ b/projects/hrr/playback/CMakeLists.txt @@ -0,0 +1,65 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT + +# HRR Playback Tools +# Built as part of the standalone projects/hrr CMake tree. HIP runtime linkage +# comes from the public HIP CMake package (hip::host), not from CLR internals. + +# C++20 on Windows (MSVC requires it for some std features), C++17 on Linux. +if(WIN32) + set(HRR_CXX_STANDARD 20) +else() + set(HRR_CXX_STANDARD 17) +endif() + +# --------------------------------------------------------------------------- +# hrr_reader — archive loader (STATIC) +# +# CPU-only: depends solely on the header-only wire format (hrr::api_args) and the +# C++ standard library. It is defined unconditionally so the unit tests can link +# it even when the HIP-dependent playback tool is not built +# (HRR_BUILD_PLAYBACK=OFF); it must not gain a HIP dependency. +# --------------------------------------------------------------------------- +add_library(hrr_reader STATIC hrr_reader.cpp) +add_library(hrr::reader ALIAS hrr_reader) +set_target_properties(hrr_reader PROPERTIES + CXX_STANDARD ${HRR_CXX_STANDARD} + CXX_STANDARD_REQUIRED ON) +target_link_libraries(hrr_reader PUBLIC hrr::api_args) +target_include_directories(hrr_reader PUBLIC + $ + $ +) +target_compile_definitions(hrr_reader PRIVATE + HRR_API_ARGS_IMPLEMENTATION + $<$:NOMINMAX WIN32_LEAN_AND_MEAN> +) + +# --------------------------------------------------------------------------- +# hrr-playback — full replay tool (requires HIP) +# --------------------------------------------------------------------------- +if(HRR_BUILD_PLAYBACK) + find_package(Threads REQUIRED) + find_package(hip CONFIG REQUIRED) + + add_executable(hrr-playback + hrr_playback.cpp + hip_playback.cpp + hip_playback_generated.cpp + ) + set_target_properties(hrr-playback PROPERTIES + CXX_STANDARD ${HRR_CXX_STANDARD} + CXX_STANDARD_REQUIRED ON) + target_include_directories(hrr-playback PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ) + target_compile_definitions(hrr-playback PRIVATE + __HIP_PLATFORM_AMD__ + $<$:NOMINMAX WIN32_LEAN_AND_MEAN> + ) + target_link_libraries(hrr-playback PRIVATE hrr::reader hip::host Threads::Threads) + + install(TARGETS hrr-playback RUNTIME DESTINATION bin) + install(FILES hrr_reader.h hip_playback.h DESTINATION include/hrr/playback) +endif() diff --git a/projects/clr/hipamd/src/hrr/playback/hip_playback.cpp b/projects/hrr/playback/hip_playback.cpp similarity index 99% rename from projects/clr/hipamd/src/hrr/playback/hip_playback.cpp rename to projects/hrr/playback/hip_playback.cpp index 04c5bc055ca2..bd07839adae7 100644 --- a/projects/clr/hipamd/src/hrr/playback/hip_playback.cpp +++ b/projects/hrr/playback/hip_playback.cpp @@ -12,7 +12,7 @@ // load_module. #include "hip_playback.h" -#include "hrr_api_args.h" +#include "hrr/hrr_api_args.h" #include "hrr_reader.h" // hrr::hash_hex #include diff --git a/projects/clr/hipamd/src/hrr/playback/hip_playback.h b/projects/hrr/playback/hip_playback.h similarity index 99% rename from projects/clr/hipamd/src/hrr/playback/hip_playback.h rename to projects/hrr/playback/hip_playback.h index 0f135e548964..8d603c8257da 100644 --- a/projects/clr/hipamd/src/hrr/playback/hip_playback.h +++ b/projects/hrr/playback/hip_playback.h @@ -17,7 +17,7 @@ #include #include -#include "hrr_api_args.h" // for HRR_API_COUNT, hrr_api_id_t +#include "hrr/hrr_api_args.h" // for HRR_API_COUNT, hrr_api_id_t // Whether a replayed H2D blob restore must be drained before subsequent // replay work. Draining is skipped while a stream graph capture is active, diff --git a/projects/clr/hipamd/src/hrr/playback/hip_playback_generated.cpp b/projects/hrr/playback/hip_playback_generated.cpp similarity index 81% rename from projects/clr/hipamd/src/hrr/playback/hip_playback_generated.cpp rename to projects/hrr/playback/hip_playback_generated.cpp index 1a2e5ed64a96..e364b95ca762 100644 --- a/projects/clr/hipamd/src/hrr/playback/hip_playback_generated.cpp +++ b/projects/hrr/playback/hip_playback_generated.cpp @@ -16,7 +16,7 @@ * ============================================================================ */ #include "hip_playback.h" -#include "hrr_api_args.h" +#include "hrr/hrr_api_args.h" #include #include @@ -482,6 +482,17 @@ static hipError_t playback_hipDeviceGetLimit(PlaybackContext& ctx, const uint8_t return _r; } +static hipError_t playback_hipDeviceGetLuid(PlaybackContext& ctx, const uint8_t* payload) { + (void)ctx; (void)payload; + static bool warned = false; + if (!warned) { + warned = true; + fprintf(stderr, "[HRR] NOOP playback handler called for hipDeviceGetLuid — " + "this API is not replayed; results may differ from capture.\n"); + } + return hipSuccess; +} + static hipError_t playback_hipDeviceGetMemPool(PlaybackContext& ctx, const uint8_t* payload) { const auto* a = reinterpret_cast(payload); hipMemPool_t _out_mem_pool = nullptr; @@ -1920,6 +1931,17 @@ static hipError_t playback_hipInit(PlaybackContext& ctx, const uint8_t* payload) return _r; } +static hipError_t playback_hipInitDevice(PlaybackContext& ctx, const uint8_t* payload) { + (void)ctx; (void)payload; + static bool warned = false; + if (!warned) { + warned = true; + fprintf(stderr, "[HRR] NOOP playback handler called for hipInitDevice — " + "this API is not replayed; results may differ from capture.\n"); + } + return hipSuccess; +} + static hipError_t playback_hipIpcCloseMemHandle(PlaybackContext& ctx, const uint8_t* payload) { const auto* a = reinterpret_cast(payload); hipError_t _r = (hipError_t)hipIpcCloseMemHandle(ctx.translate_ptr(a->devPtr)); @@ -4724,6 +4746,14 @@ static hipError_t playback_hipExecutionCtxWaitEvent(PlaybackContext& ctx, const return _r; } +static hipError_t playback_hipMemGetDefaultMemPool(PlaybackContext& ctx, const uint8_t* payload) { + const auto* a = reinterpret_cast(payload); + hipMemPool_t _out_memPool = nullptr; + hipMemLocation* _s_location{}; + hipError_t _r = (hipError_t)hipMemGetDefaultMemPool(&_out_memPool, _s_location, (hipMemAllocationType)a->type); + return _r; +} + // ============================================================ // Minimum payload size per event type — indexed by hrr_api_id_t @@ -4787,500 +4817,503 @@ const uint32_t hrr_api_min_payload_size[HRR_API_COUNT] = { static_cast(sizeof(hrr_args_hipDeviceGetDefaultMemPool)), // [53] HRR_API_HIPDEVICEGETDEFAULTMEMPOOL static_cast(sizeof(hrr_args_hipDeviceGetGraphMemAttribute)), // [54] HRR_API_HIPDEVICEGETGRAPHMEMATTRIBUTE static_cast(sizeof(hrr_args_hipDeviceGetLimit)), // [55] HRR_API_HIPDEVICEGETLIMIT - static_cast(sizeof(hrr_args_hipDeviceGetMemPool)), // [56] HRR_API_HIPDEVICEGETMEMPOOL - static_cast(sizeof(hrr_args_hipDeviceGetName)), // [57] HRR_API_HIPDEVICEGETNAME - static_cast(sizeof(hrr_args_hipDeviceGetP2PAttribute)), // [58] HRR_API_HIPDEVICEGETP2PATTRIBUTE - static_cast(sizeof(hrr_args_hipDeviceGetPCIBusId)), // [59] HRR_API_HIPDEVICEGETPCIBUSID - static_cast(sizeof(hrr_args_hipDeviceGetSharedMemConfig)), // [60] HRR_API_HIPDEVICEGETSHAREDMEMCONFIG - static_cast(sizeof(hrr_args_hipDeviceGetStreamPriorityRange)), // [61] HRR_API_HIPDEVICEGETSTREAMPRIORITYRANGE - static_cast(sizeof(hrr_args_hipDeviceGetUuid)), // [62] HRR_API_HIPDEVICEGETUUID - static_cast(sizeof(hrr_args_hipDeviceGraphMemTrim)), // [63] HRR_API_HIPDEVICEGRAPHMEMTRIM - static_cast(sizeof(hrr_args_hipDevicePrimaryCtxGetState)), // [64] HRR_API_HIPDEVICEPRIMARYCTXGETSTATE - static_cast(sizeof(hrr_args_hipDevicePrimaryCtxRelease)), // [65] HRR_API_HIPDEVICEPRIMARYCTXRELEASE - static_cast(sizeof(hrr_args_hipDevicePrimaryCtxReset)), // [66] HRR_API_HIPDEVICEPRIMARYCTXRESET - static_cast(sizeof(hrr_args_hipDevicePrimaryCtxRetain)), // [67] HRR_API_HIPDEVICEPRIMARYCTXRETAIN - static_cast(sizeof(hrr_args_hipDevicePrimaryCtxSetFlags)), // [68] HRR_API_HIPDEVICEPRIMARYCTXSETFLAGS - static_cast(sizeof(hrr_args_hipDeviceReset)), // [69] HRR_API_HIPDEVICERESET - static_cast(sizeof(hrr_args_hipDeviceSetCacheConfig)), // [70] HRR_API_HIPDEVICESETCACHECONFIG - static_cast(sizeof(hrr_args_hipDeviceSetGraphMemAttribute)), // [71] HRR_API_HIPDEVICESETGRAPHMEMATTRIBUTE - static_cast(sizeof(hrr_args_hipDeviceSetLimit)), // [72] HRR_API_HIPDEVICESETLIMIT - static_cast(sizeof(hrr_args_hipDeviceSetMemPool)), // [73] HRR_API_HIPDEVICESETMEMPOOL - static_cast(sizeof(hrr_args_hipDeviceSetSharedMemConfig)), // [74] HRR_API_HIPDEVICESETSHAREDMEMCONFIG - static_cast(sizeof(hrr_args_hipDeviceSynchronize)), // [75] HRR_API_HIPDEVICESYNCHRONIZE - static_cast(sizeof(hrr_args_hipDeviceTotalMem)), // [76] HRR_API_HIPDEVICETOTALMEM - static_cast(sizeof(hrr_args_hipDriverGetVersion)), // [77] HRR_API_HIPDRIVERGETVERSION - static_cast(sizeof(hrr_args_hipDrvGetErrorName)), // [78] HRR_API_HIPDRVGETERRORNAME - static_cast(sizeof(hrr_args_hipDrvGetErrorString)), // [79] HRR_API_HIPDRVGETERRORSTRING - static_cast(sizeof(hrr_args_hipDrvGraphAddMemcpyNode)), // [80] HRR_API_HIPDRVGRAPHADDMEMCPYNODE - static_cast(sizeof(hrr_args_hipDrvMemcpy2DUnaligned)), // [81] HRR_API_HIPDRVMEMCPY2DUNALIGNED - static_cast(sizeof(hrr_args_hipDrvMemcpy3D)), // [82] HRR_API_HIPDRVMEMCPY3D - static_cast(sizeof(hrr_args_hipDrvMemcpy3DAsync)), // [83] HRR_API_HIPDRVMEMCPY3DASYNC - static_cast(sizeof(hrr_args_hipDrvPointerGetAttributes)), // [84] HRR_API_HIPDRVPOINTERGETATTRIBUTES - static_cast(sizeof(hrr_args_hipEventCreate)), // [85] HRR_API_HIPEVENTCREATE - static_cast(sizeof(hrr_args_hipEventCreateWithFlags)), // [86] HRR_API_HIPEVENTCREATEWITHFLAGS - static_cast(sizeof(hrr_args_hipEventDestroy)), // [87] HRR_API_HIPEVENTDESTROY - static_cast(sizeof(hrr_args_hipEventElapsedTime)), // [88] HRR_API_HIPEVENTELAPSEDTIME - static_cast(sizeof(hrr_args_hipEventQuery)), // [89] HRR_API_HIPEVENTQUERY - static_cast(sizeof(hrr_args_hipEventRecord)), // [90] HRR_API_HIPEVENTRECORD - static_cast(sizeof(hrr_args_hipEventSynchronize)), // [91] HRR_API_HIPEVENTSYNCHRONIZE - static_cast(sizeof(hrr_args_hipExtGetLinkTypeAndHopCount)), // [92] HRR_API_HIPEXTGETLINKTYPEANDHOPCOUNT - static_cast(sizeof(hrr_args_hipExtLaunchKernel)), // [93] HRR_API_HIPEXTLAUNCHKERNEL - static_cast(sizeof(hrr_args_hipExtLaunchMultiKernelMultiDevice)), // [94] HRR_API_HIPEXTLAUNCHMULTIKERNELMULTIDEVICE - static_cast(sizeof(hrr_args_hipExtMallocWithFlags)), // [95] HRR_API_HIPEXTMALLOCWITHFLAGS - static_cast(sizeof(hrr_args_hipExtStreamCreateWithCUMask)), // [96] HRR_API_HIPEXTSTREAMCREATEWITHCUMASK - static_cast(sizeof(hrr_args_hipExtStreamGetCUMask)), // [97] HRR_API_HIPEXTSTREAMGETCUMASK - static_cast(sizeof(hrr_args_hipExternalMemoryGetMappedBuffer)), // [98] HRR_API_HIPEXTERNALMEMORYGETMAPPEDBUFFER - static_cast(sizeof(hrr_args_hipFree)), // [99] HRR_API_HIPFREE - static_cast(sizeof(hrr_args_hipFreeArray)), // [100] HRR_API_HIPFREEARRAY - static_cast(sizeof(hrr_args_hipFreeAsync)), // [101] HRR_API_HIPFREEASYNC - static_cast(sizeof(hrr_args_hipFreeHost)), // [102] HRR_API_HIPFREEHOST - static_cast(sizeof(hrr_args_hipFreeMipmappedArray)), // [103] HRR_API_HIPFREEMIPMAPPEDARRAY - static_cast(sizeof(hrr_args_hipFuncGetAttribute)), // [104] HRR_API_HIPFUNCGETATTRIBUTE - static_cast(sizeof(hrr_args_hipFuncGetAttributes)), // [105] HRR_API_HIPFUNCGETATTRIBUTES - static_cast(sizeof(hrr_args_hipFuncSetAttribute)), // [106] HRR_API_HIPFUNCSETATTRIBUTE - static_cast(sizeof(hrr_args_hipFuncSetCacheConfig)), // [107] HRR_API_HIPFUNCSETCACHECONFIG - static_cast(sizeof(hrr_args_hipFuncSetSharedMemConfig)), // [108] HRR_API_HIPFUNCSETSHAREDMEMCONFIG - static_cast(sizeof(hrr_args_hipGLGetDevices)), // [109] HRR_API_HIPGLGETDEVICES - static_cast(sizeof(hrr_args_hipGetChannelDesc)), // [110] HRR_API_HIPGETCHANNELDESC - static_cast(sizeof(hrr_args_hipGetDevice)), // [111] HRR_API_HIPGETDEVICE - static_cast(sizeof(hrr_args_hipGetDeviceCount)), // [112] HRR_API_HIPGETDEVICECOUNT - static_cast(sizeof(hrr_args_hipGetDeviceFlags)), // [113] HRR_API_HIPGETDEVICEFLAGS - static_cast(sizeof(hrr_args_hipGetDevicePropertiesR0600)), // [114] HRR_API_HIPGETDEVICEPROPERTIESR0600 - static_cast(sizeof(hrr_args_hipGetDevicePropertiesR0000)), // [115] HRR_API_HIPGETDEVICEPROPERTIESR0000 - static_cast(sizeof(hrr_args_hipGetErrorName)), // [116] HRR_API_HIPGETERRORNAME - static_cast(sizeof(hrr_args_hipGetErrorString)), // [117] HRR_API_HIPGETERRORSTRING - static_cast(sizeof(hrr_args_hipGetLastError)), // [118] HRR_API_HIPGETLASTERROR - static_cast(sizeof(hrr_args_hipGetMipmappedArrayLevel)), // [119] HRR_API_HIPGETMIPMAPPEDARRAYLEVEL - static_cast(sizeof(hrr_args_hipGetSymbolAddress)), // [120] HRR_API_HIPGETSYMBOLADDRESS - static_cast(sizeof(hrr_args_hipGetSymbolSize)), // [121] HRR_API_HIPGETSYMBOLSIZE - static_cast(sizeof(hrr_args_hipGetTextureAlignmentOffset)), // [122] HRR_API_HIPGETTEXTUREALIGNMENTOFFSET - static_cast(sizeof(hrr_args_hipGetTextureObjectResourceDesc)), // [123] HRR_API_HIPGETTEXTUREOBJECTRESOURCEDESC - static_cast(sizeof(hrr_args_hipGetTextureObjectResourceViewDesc)), // [124] HRR_API_HIPGETTEXTUREOBJECTRESOURCEVIEWDESC - static_cast(sizeof(hrr_args_hipGetTextureObjectTextureDesc)), // [125] HRR_API_HIPGETTEXTUREOBJECTTEXTUREDESC - static_cast(sizeof(hrr_args_hipGetTextureReference)), // [126] HRR_API_HIPGETTEXTUREREFERENCE - static_cast(sizeof(hrr_args_hipGraphAddChildGraphNode)), // [127] HRR_API_HIPGRAPHADDCHILDGRAPHNODE - static_cast(sizeof(hrr_args_hipGraphAddDependencies)), // [128] HRR_API_HIPGRAPHADDDEPENDENCIES - static_cast(sizeof(hrr_args_hipGraphAddEmptyNode)), // [129] HRR_API_HIPGRAPHADDEMPTYNODE - static_cast(sizeof(hrr_args_hipGraphAddEventRecordNode)), // [130] HRR_API_HIPGRAPHADDEVENTRECORDNODE - static_cast(sizeof(hrr_args_hipGraphAddEventWaitNode)), // [131] HRR_API_HIPGRAPHADDEVENTWAITNODE - static_cast(sizeof(hrr_args_hipGraphAddHostNode)), // [132] HRR_API_HIPGRAPHADDHOSTNODE - static_cast(sizeof(hrr_args_hipGraphAddKernelNode)), // [133] HRR_API_HIPGRAPHADDKERNELNODE - static_cast(sizeof(hrr_args_hipGraphAddMemAllocNode)), // [134] HRR_API_HIPGRAPHADDMEMALLOCNODE - static_cast(sizeof(hrr_args_hipGraphAddMemFreeNode)), // [135] HRR_API_HIPGRAPHADDMEMFREENODE - static_cast(sizeof(hrr_args_hipGraphAddMemcpyNode)), // [136] HRR_API_HIPGRAPHADDMEMCPYNODE - static_cast(sizeof(hrr_args_hipGraphAddMemcpyNode1D)), // [137] HRR_API_HIPGRAPHADDMEMCPYNODE1D - static_cast(sizeof(hrr_args_hipGraphAddMemcpyNodeFromSymbol)), // [138] HRR_API_HIPGRAPHADDMEMCPYNODEFROMSYMBOL - static_cast(sizeof(hrr_args_hipGraphAddMemcpyNodeToSymbol)), // [139] HRR_API_HIPGRAPHADDMEMCPYNODETOSYMBOL - static_cast(sizeof(hrr_args_hipGraphAddMemsetNode)), // [140] HRR_API_HIPGRAPHADDMEMSETNODE - static_cast(sizeof(hrr_args_hipGraphChildGraphNodeGetGraph)), // [141] HRR_API_HIPGRAPHCHILDGRAPHNODEGETGRAPH - static_cast(sizeof(hrr_args_hipGraphClone)), // [142] HRR_API_HIPGRAPHCLONE - static_cast(sizeof(hrr_args_hipGraphCreate)), // [143] HRR_API_HIPGRAPHCREATE - static_cast(sizeof(hrr_args_hipGraphDebugDotPrint)), // [144] HRR_API_HIPGRAPHDEBUGDOTPRINT - static_cast(sizeof(hrr_args_hipGraphDestroy)), // [145] HRR_API_HIPGRAPHDESTROY - static_cast(sizeof(hrr_args_hipGraphDestroyNode)), // [146] HRR_API_HIPGRAPHDESTROYNODE - static_cast(sizeof(hrr_args_hipGraphEventRecordNodeGetEvent)), // [147] HRR_API_HIPGRAPHEVENTRECORDNODEGETEVENT - static_cast(sizeof(hrr_args_hipGraphEventRecordNodeSetEvent)), // [148] HRR_API_HIPGRAPHEVENTRECORDNODESETEVENT - static_cast(sizeof(hrr_args_hipGraphEventWaitNodeGetEvent)), // [149] HRR_API_HIPGRAPHEVENTWAITNODEGETEVENT - static_cast(sizeof(hrr_args_hipGraphEventWaitNodeSetEvent)), // [150] HRR_API_HIPGRAPHEVENTWAITNODESETEVENT - static_cast(sizeof(hrr_args_hipGraphExecChildGraphNodeSetParams)), // [151] HRR_API_HIPGRAPHEXECCHILDGRAPHNODESETPARAMS - static_cast(sizeof(hrr_args_hipGraphExecDestroy)), // [152] HRR_API_HIPGRAPHEXECDESTROY - static_cast(sizeof(hrr_args_hipGraphExecEventRecordNodeSetEvent)), // [153] HRR_API_HIPGRAPHEXECEVENTRECORDNODESETEVENT - static_cast(sizeof(hrr_args_hipGraphExecEventWaitNodeSetEvent)), // [154] HRR_API_HIPGRAPHEXECEVENTWAITNODESETEVENT - static_cast(sizeof(hrr_args_hipGraphExecHostNodeSetParams)), // [155] HRR_API_HIPGRAPHEXECHOSTNODESETPARAMS - static_cast(sizeof(hrr_args_hipGraphExecKernelNodeSetParams)), // [156] HRR_API_HIPGRAPHEXECKERNELNODESETPARAMS - static_cast(sizeof(hrr_args_hipGraphExecMemcpyNodeSetParams)), // [157] HRR_API_HIPGRAPHEXECMEMCPYNODESETPARAMS - static_cast(sizeof(hrr_args_hipGraphExecMemcpyNodeSetParams1D)), // [158] HRR_API_HIPGRAPHEXECMEMCPYNODESETPARAMS1D - static_cast(sizeof(hrr_args_hipGraphExecMemcpyNodeSetParamsFromSymbol)), // [159] HRR_API_HIPGRAPHEXECMEMCPYNODESETPARAMSFROMSYMBOL - static_cast(sizeof(hrr_args_hipGraphExecMemcpyNodeSetParamsToSymbol)), // [160] HRR_API_HIPGRAPHEXECMEMCPYNODESETPARAMSTOSYMBOL - static_cast(sizeof(hrr_args_hipGraphExecMemsetNodeSetParams)), // [161] HRR_API_HIPGRAPHEXECMEMSETNODESETPARAMS - static_cast(sizeof(hrr_args_hipGraphExecUpdate)), // [162] HRR_API_HIPGRAPHEXECUPDATE - static_cast(sizeof(hrr_args_hipGraphGetEdges)), // [163] HRR_API_HIPGRAPHGETEDGES - static_cast(sizeof(hrr_args_hipGraphGetNodes)), // [164] HRR_API_HIPGRAPHGETNODES - static_cast(sizeof(hrr_args_hipGraphGetRootNodes)), // [165] HRR_API_HIPGRAPHGETROOTNODES - static_cast(sizeof(hrr_args_hipGraphHostNodeGetParams)), // [166] HRR_API_HIPGRAPHHOSTNODEGETPARAMS - static_cast(sizeof(hrr_args_hipGraphHostNodeSetParams)), // [167] HRR_API_HIPGRAPHHOSTNODESETPARAMS - static_cast(sizeof(hrr_args_hipGraphInstantiate)), // [168] HRR_API_HIPGRAPHINSTANTIATE - static_cast(sizeof(hrr_args_hipGraphInstantiateWithFlags)), // [169] HRR_API_HIPGRAPHINSTANTIATEWITHFLAGS - static_cast(sizeof(hrr_args_hipGraphKernelNodeCopyAttributes)), // [170] HRR_API_HIPGRAPHKERNELNODECOPYATTRIBUTES - static_cast(sizeof(hrr_args_hipGraphKernelNodeGetAttribute)), // [171] HRR_API_HIPGRAPHKERNELNODEGETATTRIBUTE - static_cast(sizeof(hrr_args_hipGraphKernelNodeGetParams)), // [172] HRR_API_HIPGRAPHKERNELNODEGETPARAMS - static_cast(sizeof(hrr_args_hipGraphKernelNodeSetAttribute)), // [173] HRR_API_HIPGRAPHKERNELNODESETATTRIBUTE - static_cast(sizeof(hrr_args_hipGraphKernelNodeSetParams)), // [174] HRR_API_HIPGRAPHKERNELNODESETPARAMS - static_cast(sizeof(hrr_args_hipGraphLaunch)), // [175] HRR_API_HIPGRAPHLAUNCH - static_cast(sizeof(hrr_args_hipGraphMemAllocNodeGetParams)), // [176] HRR_API_HIPGRAPHMEMALLOCNODEGETPARAMS - static_cast(sizeof(hrr_args_hipGraphMemFreeNodeGetParams)), // [177] HRR_API_HIPGRAPHMEMFREENODEGETPARAMS - static_cast(sizeof(hrr_args_hipGraphMemcpyNodeGetParams)), // [178] HRR_API_HIPGRAPHMEMCPYNODEGETPARAMS - static_cast(sizeof(hrr_args_hipGraphMemcpyNodeSetParams)), // [179] HRR_API_HIPGRAPHMEMCPYNODESETPARAMS - static_cast(sizeof(hrr_args_hipGraphMemcpyNodeSetParams1D)), // [180] HRR_API_HIPGRAPHMEMCPYNODESETPARAMS1D - static_cast(sizeof(hrr_args_hipGraphMemcpyNodeSetParamsFromSymbol)), // [181] HRR_API_HIPGRAPHMEMCPYNODESETPARAMSFROMSYMBOL - static_cast(sizeof(hrr_args_hipGraphMemcpyNodeSetParamsToSymbol)), // [182] HRR_API_HIPGRAPHMEMCPYNODESETPARAMSTOSYMBOL - static_cast(sizeof(hrr_args_hipGraphMemsetNodeGetParams)), // [183] HRR_API_HIPGRAPHMEMSETNODEGETPARAMS - static_cast(sizeof(hrr_args_hipGraphMemsetNodeSetParams)), // [184] HRR_API_HIPGRAPHMEMSETNODESETPARAMS - static_cast(sizeof(hrr_args_hipGraphNodeFindInClone)), // [185] HRR_API_HIPGRAPHNODEFINDINCLONE - static_cast(sizeof(hrr_args_hipGraphNodeGetDependencies)), // [186] HRR_API_HIPGRAPHNODEGETDEPENDENCIES - static_cast(sizeof(hrr_args_hipGraphNodeGetDependentNodes)), // [187] HRR_API_HIPGRAPHNODEGETDEPENDENTNODES - static_cast(sizeof(hrr_args_hipGraphNodeGetEnabled)), // [188] HRR_API_HIPGRAPHNODEGETENABLED - static_cast(sizeof(hrr_args_hipGraphNodeGetType)), // [189] HRR_API_HIPGRAPHNODEGETTYPE - static_cast(sizeof(hrr_args_hipGraphNodeSetEnabled)), // [190] HRR_API_HIPGRAPHNODESETENABLED - static_cast(sizeof(hrr_args_hipGraphReleaseUserObject)), // [191] HRR_API_HIPGRAPHRELEASEUSEROBJECT - static_cast(sizeof(hrr_args_hipGraphRemoveDependencies)), // [192] HRR_API_HIPGRAPHREMOVEDEPENDENCIES - static_cast(sizeof(hrr_args_hipGraphRetainUserObject)), // [193] HRR_API_HIPGRAPHRETAINUSEROBJECT - static_cast(sizeof(hrr_args_hipGraphUpload)), // [194] HRR_API_HIPGRAPHUPLOAD - static_cast(sizeof(hrr_args_hipGraphicsGLRegisterBuffer)), // [195] HRR_API_HIPGRAPHICSGLREGISTERBUFFER - static_cast(sizeof(hrr_args_hipGraphicsGLRegisterImage)), // [196] HRR_API_HIPGRAPHICSGLREGISTERIMAGE - static_cast(sizeof(hrr_args_hipGraphicsMapResources)), // [197] HRR_API_HIPGRAPHICSMAPRESOURCES - static_cast(sizeof(hrr_args_hipGraphicsResourceGetMappedPointer)), // [198] HRR_API_HIPGRAPHICSRESOURCEGETMAPPEDPOINTER - static_cast(sizeof(hrr_args_hipGraphicsSubResourceGetMappedArray)), // [199] HRR_API_HIPGRAPHICSSUBRESOURCEGETMAPPEDARRAY - static_cast(sizeof(hrr_args_hipGraphicsUnmapResources)), // [200] HRR_API_HIPGRAPHICSUNMAPRESOURCES - static_cast(sizeof(hrr_args_hipGraphicsUnregisterResource)), // [201] HRR_API_HIPGRAPHICSUNREGISTERRESOURCE - static_cast(sizeof(hrr_args_hipHostAlloc)), // [202] HRR_API_HIPHOSTALLOC - static_cast(sizeof(hrr_args_hipHostFree)), // [203] HRR_API_HIPHOSTFREE - static_cast(sizeof(hrr_args_hipHostGetDevicePointer)), // [204] HRR_API_HIPHOSTGETDEVICEPOINTER - static_cast(sizeof(hrr_args_hipHostGetFlags)), // [205] HRR_API_HIPHOSTGETFLAGS - static_cast(sizeof(hrr_args_hipHostMalloc)), // [206] HRR_API_HIPHOSTMALLOC - static_cast(sizeof(hrr_args_hipHostRegister)), // [207] HRR_API_HIPHOSTREGISTER - static_cast(sizeof(hrr_args_hipHostUnregister)), // [208] HRR_API_HIPHOSTUNREGISTER - static_cast(sizeof(hrr_args_hipImportExternalMemory)), // [209] HRR_API_HIPIMPORTEXTERNALMEMORY - static_cast(sizeof(hrr_args_hipImportExternalSemaphore)), // [210] HRR_API_HIPIMPORTEXTERNALSEMAPHORE - static_cast(sizeof(hrr_args_hipInit)), // [211] HRR_API_HIPINIT - static_cast(sizeof(hrr_args_hipIpcCloseMemHandle)), // [212] HRR_API_HIPIPCCLOSEMEMHANDLE - static_cast(sizeof(hrr_args_hipIpcGetEventHandle)), // [213] HRR_API_HIPIPCGETEVENTHANDLE - static_cast(sizeof(hrr_args_hipIpcGetMemHandle)), // [214] HRR_API_HIPIPCGETMEMHANDLE - static_cast(sizeof(hrr_args_hipIpcOpenEventHandle)), // [215] HRR_API_HIPIPCOPENEVENTHANDLE - static_cast(sizeof(hrr_args_hipIpcOpenMemHandle)), // [216] HRR_API_HIPIPCOPENMEMHANDLE - static_cast(sizeof(hrr_args_hipKernelNameRef)), // [217] HRR_API_HIPKERNELNAMEREF - static_cast(sizeof(hrr_args_hipKernelNameRefByPtr)), // [218] HRR_API_HIPKERNELNAMEREFBYPTR - static_cast(sizeof(hrr_event_header) + 8u + 2u + 16u + 12u + 12u + 4u + 2u + 2u), // [219] variable-length kernel launch - static_cast(sizeof(hrr_args_hipLaunchCooperativeKernel)), // [220] HRR_API_HIPLAUNCHCOOPERATIVEKERNEL - static_cast(sizeof(hrr_args_hipLaunchCooperativeKernelMultiDevice)), // [221] HRR_API_HIPLAUNCHCOOPERATIVEKERNELMULTIDEVICE - static_cast(sizeof(hrr_args_hipLaunchHostFunc)), // [222] HRR_API_HIPLAUNCHHOSTFUNC - static_cast(sizeof(hrr_event_header) + 8u + 2u + 16u + 12u + 12u + 4u + 2u + 2u), // [223] variable-length kernel launch - static_cast(sizeof(hrr_args_hipMalloc)), // [224] HRR_API_HIPMALLOC - static_cast(sizeof(hrr_args_hipMalloc3D)), // [225] HRR_API_HIPMALLOC3D - static_cast(sizeof(hrr_args_hipMalloc3DArray)), // [226] HRR_API_HIPMALLOC3DARRAY - static_cast(sizeof(hrr_args_hipMallocArray)), // [227] HRR_API_HIPMALLOCARRAY - static_cast(sizeof(hrr_args_hipMallocAsync)), // [228] HRR_API_HIPMALLOCASYNC - static_cast(sizeof(hrr_args_hipMallocFromPoolAsync)), // [229] HRR_API_HIPMALLOCFROMPOOLASYNC - static_cast(sizeof(hrr_args_hipMallocHost)), // [230] HRR_API_HIPMALLOCHOST - static_cast(sizeof(hrr_args_hipMallocManaged)), // [231] HRR_API_HIPMALLOCMANAGED - static_cast(sizeof(hrr_args_hipMallocMipmappedArray)), // [232] HRR_API_HIPMALLOCMIPMAPPEDARRAY - static_cast(sizeof(hrr_args_hipMallocPitch)), // [233] HRR_API_HIPMALLOCPITCH - static_cast(sizeof(hrr_args_hipMemAddressFree)), // [234] HRR_API_HIPMEMADDRESSFREE - static_cast(sizeof(hrr_args_hipMemAddressReserve)), // [235] HRR_API_HIPMEMADDRESSRESERVE - static_cast(sizeof(hrr_args_hipMemAdvise)), // [236] HRR_API_HIPMEMADVISE - static_cast(sizeof(hrr_args_hipMemAdvise_v2)), // [237] HRR_API_HIPMEMADVISE_V2 - static_cast(sizeof(hrr_args_hipMemAllocHost)), // [238] HRR_API_HIPMEMALLOCHOST - static_cast(sizeof(hrr_args_hipMemAllocPitch)), // [239] HRR_API_HIPMEMALLOCPITCH - static_cast(sizeof(hrr_args_hipMemCreate)), // [240] HRR_API_HIPMEMCREATE - static_cast(sizeof(hrr_args_hipMemExportToShareableHandle)), // [241] HRR_API_HIPMEMEXPORTTOSHAREABLEHANDLE - static_cast(sizeof(hrr_args_hipMemGetAccess)), // [242] HRR_API_HIPMEMGETACCESS - static_cast(sizeof(hrr_args_hipMemGetAddressRange)), // [243] HRR_API_HIPMEMGETADDRESSRANGE - static_cast(sizeof(hrr_args_hipMemGetAllocationGranularity)), // [244] HRR_API_HIPMEMGETALLOCATIONGRANULARITY - static_cast(sizeof(hrr_args_hipMemGetAllocationPropertiesFromHandle)), // [245] HRR_API_HIPMEMGETALLOCATIONPROPERTIESFROMHANDLE - static_cast(sizeof(hrr_args_hipMemGetInfo)), // [246] HRR_API_HIPMEMGETINFO - static_cast(sizeof(hrr_args_hipMemImportFromShareableHandle)), // [247] HRR_API_HIPMEMIMPORTFROMSHAREABLEHANDLE - static_cast(sizeof(hrr_args_hipMemMap)), // [248] HRR_API_HIPMEMMAP - static_cast(sizeof(hrr_args_hipMemMapArrayAsync)), // [249] HRR_API_HIPMEMMAPARRAYASYNC - static_cast(sizeof(hrr_args_hipMemPoolCreate)), // [250] HRR_API_HIPMEMPOOLCREATE - static_cast(sizeof(hrr_args_hipMemPoolDestroy)), // [251] HRR_API_HIPMEMPOOLDESTROY - static_cast(sizeof(hrr_args_hipMemPoolExportPointer)), // [252] HRR_API_HIPMEMPOOLEXPORTPOINTER - static_cast(sizeof(hrr_args_hipMemPoolExportToShareableHandle)), // [253] HRR_API_HIPMEMPOOLEXPORTTOSHAREABLEHANDLE - static_cast(sizeof(hrr_args_hipMemPoolGetAccess)), // [254] HRR_API_HIPMEMPOOLGETACCESS - static_cast(sizeof(hrr_args_hipMemPoolGetAttribute)), // [255] HRR_API_HIPMEMPOOLGETATTRIBUTE - static_cast(sizeof(hrr_args_hipMemPoolImportFromShareableHandle)), // [256] HRR_API_HIPMEMPOOLIMPORTFROMSHAREABLEHANDLE - static_cast(sizeof(hrr_args_hipMemPoolImportPointer)), // [257] HRR_API_HIPMEMPOOLIMPORTPOINTER - static_cast(sizeof(hrr_args_hipMemPoolSetAccess)), // [258] HRR_API_HIPMEMPOOLSETACCESS - static_cast(sizeof(hrr_args_hipMemPoolSetAttribute)), // [259] HRR_API_HIPMEMPOOLSETATTRIBUTE - static_cast(sizeof(hrr_args_hipMemPoolTrimTo)), // [260] HRR_API_HIPMEMPOOLTRIMTO - static_cast(sizeof(hrr_args_hipMemPrefetchAsync)), // [261] HRR_API_HIPMEMPREFETCHASYNC - static_cast(sizeof(hrr_args_hipMemPrefetchAsync_v2)), // [262] HRR_API_HIPMEMPREFETCHASYNC_V2 - static_cast(sizeof(hrr_args_hipMemPrefetchBatchAsync)), // [263] HRR_API_HIPMEMPREFETCHBATCHASYNC - static_cast(sizeof(hrr_args_hipMemDiscardBatchAsync)), // [264] HRR_API_HIPMEMDISCARDBATCHASYNC - static_cast(sizeof(hrr_args_hipDrvMemDiscardBatchAsync)), // [265] HRR_API_HIPDRVMEMDISCARDBATCHASYNC - static_cast(sizeof(hrr_args_hipMemDiscardAndPrefetchBatchAsync)), // [266] HRR_API_HIPMEMDISCARDANDPREFETCHBATCHASYNC - static_cast(sizeof(hrr_args_hipDrvMemDiscardAndPrefetchBatchAsync)), // [267] HRR_API_HIPDRVMEMDISCARDANDPREFETCHBATCHASYNC - static_cast(sizeof(hrr_args_hipMemPtrGetInfo)), // [268] HRR_API_HIPMEMPTRGETINFO - static_cast(sizeof(hrr_args_hipMemRangeGetAttribute)), // [269] HRR_API_HIPMEMRANGEGETATTRIBUTE - static_cast(sizeof(hrr_args_hipMemRangeGetAttributes)), // [270] HRR_API_HIPMEMRANGEGETATTRIBUTES - static_cast(sizeof(hrr_args_hipMemRelease)), // [271] HRR_API_HIPMEMRELEASE - static_cast(sizeof(hrr_args_hipMemRetainAllocationHandle)), // [272] HRR_API_HIPMEMRETAINALLOCATIONHANDLE - static_cast(sizeof(hrr_args_hipMemSetAccess)), // [273] HRR_API_HIPMEMSETACCESS - static_cast(sizeof(hrr_args_hipMemUnmap)), // [274] HRR_API_HIPMEMUNMAP - static_cast(sizeof(hrr_args_hipMemcpy)), // [275] HRR_API_HIPMEMCPY - static_cast(sizeof(hrr_args_hipMemcpy2D)), // [276] HRR_API_HIPMEMCPY2D - static_cast(sizeof(hrr_args_hipMemcpy2DAsync)), // [277] HRR_API_HIPMEMCPY2DASYNC - static_cast(sizeof(hrr_args_hipMemcpy2DFromArray)), // [278] HRR_API_HIPMEMCPY2DFROMARRAY - static_cast(sizeof(hrr_args_hipMemcpy2DFromArrayAsync)), // [279] HRR_API_HIPMEMCPY2DFROMARRAYASYNC - static_cast(sizeof(hrr_args_hipMemcpy2DToArray)), // [280] HRR_API_HIPMEMCPY2DTOARRAY - static_cast(sizeof(hrr_args_hipMemcpy2DToArrayAsync)), // [281] HRR_API_HIPMEMCPY2DTOARRAYASYNC - static_cast(sizeof(hrr_args_hipMemcpy3D)), // [282] HRR_API_HIPMEMCPY3D - static_cast(sizeof(hrr_args_hipMemcpy3DAsync)), // [283] HRR_API_HIPMEMCPY3DASYNC - static_cast(sizeof(hrr_args_hipMemcpyAsync)), // [284] HRR_API_HIPMEMCPYASYNC - static_cast(sizeof(hrr_args_hipMemcpyAtoH)), // [285] HRR_API_HIPMEMCPYATOH - static_cast(sizeof(hrr_args_hipMemcpyDtoD)), // [286] HRR_API_HIPMEMCPYDTOD - static_cast(sizeof(hrr_args_hipMemcpyDtoDAsync)), // [287] HRR_API_HIPMEMCPYDTODASYNC - static_cast(sizeof(hrr_args_hipMemcpyDtoH)), // [288] HRR_API_HIPMEMCPYDTOH - static_cast(sizeof(hrr_args_hipMemcpyDtoHAsync)), // [289] HRR_API_HIPMEMCPYDTOHASYNC - static_cast(sizeof(hrr_args_hipMemcpyFromArray)), // [290] HRR_API_HIPMEMCPYFROMARRAY - static_cast(sizeof(hrr_args_hipMemcpyFromSymbol)), // [291] HRR_API_HIPMEMCPYFROMSYMBOL - static_cast(sizeof(hrr_args_hipMemcpyFromSymbolAsync)), // [292] HRR_API_HIPMEMCPYFROMSYMBOLASYNC - static_cast(sizeof(hrr_args_hipMemcpyHtoA)), // [293] HRR_API_HIPMEMCPYHTOA - static_cast(sizeof(hrr_args_hipMemcpyHtoD)), // [294] HRR_API_HIPMEMCPYHTOD - static_cast(sizeof(hrr_args_hipMemcpyHtoDAsync)), // [295] HRR_API_HIPMEMCPYHTODASYNC - static_cast(sizeof(hrr_args_hipMemcpyParam2D)), // [296] HRR_API_HIPMEMCPYPARAM2D - static_cast(sizeof(hrr_args_hipMemcpyParam2DAsync)), // [297] HRR_API_HIPMEMCPYPARAM2DASYNC - static_cast(sizeof(hrr_args_hipMemcpyPeer)), // [298] HRR_API_HIPMEMCPYPEER - static_cast(sizeof(hrr_args_hipMemcpyPeerAsync)), // [299] HRR_API_HIPMEMCPYPEERASYNC - static_cast(sizeof(hrr_args_hipMemcpyToArray)), // [300] HRR_API_HIPMEMCPYTOARRAY - static_cast(sizeof(hrr_args_hipMemcpyToSymbol)), // [301] HRR_API_HIPMEMCPYTOSYMBOL - static_cast(sizeof(hrr_args_hipMemcpyToSymbolAsync)), // [302] HRR_API_HIPMEMCPYTOSYMBOLASYNC - static_cast(sizeof(hrr_args_hipMemcpyWithStream)), // [303] HRR_API_HIPMEMCPYWITHSTREAM - static_cast(sizeof(hrr_args_hipMemset)), // [304] HRR_API_HIPMEMSET - static_cast(sizeof(hrr_args_hipMemset2D)), // [305] HRR_API_HIPMEMSET2D - static_cast(sizeof(hrr_args_hipMemset2DAsync)), // [306] HRR_API_HIPMEMSET2DASYNC - static_cast(sizeof(hrr_args_hipMemset3D)), // [307] HRR_API_HIPMEMSET3D - static_cast(sizeof(hrr_args_hipMemset3DAsync)), // [308] HRR_API_HIPMEMSET3DASYNC - static_cast(sizeof(hrr_args_hipMemsetAsync)), // [309] HRR_API_HIPMEMSETASYNC - static_cast(sizeof(hrr_args_hipMemsetD16)), // [310] HRR_API_HIPMEMSETD16 - static_cast(sizeof(hrr_args_hipMemsetD16Async)), // [311] HRR_API_HIPMEMSETD16ASYNC - static_cast(sizeof(hrr_args_hipMemsetD32)), // [312] HRR_API_HIPMEMSETD32 - static_cast(sizeof(hrr_args_hipMemsetD32Async)), // [313] HRR_API_HIPMEMSETD32ASYNC - static_cast(sizeof(hrr_args_hipMemsetD8)), // [314] HRR_API_HIPMEMSETD8 - static_cast(sizeof(hrr_args_hipMemsetD8Async)), // [315] HRR_API_HIPMEMSETD8ASYNC - static_cast(sizeof(hrr_args_hipMipmappedArrayCreate)), // [316] HRR_API_HIPMIPMAPPEDARRAYCREATE - static_cast(sizeof(hrr_args_hipMipmappedArrayDestroy)), // [317] HRR_API_HIPMIPMAPPEDARRAYDESTROY - static_cast(sizeof(hrr_args_hipMipmappedArrayGetLevel)), // [318] HRR_API_HIPMIPMAPPEDARRAYGETLEVEL - static_cast(sizeof(hrr_args_hipModuleGetFunction)), // [319] HRR_API_HIPMODULEGETFUNCTION - static_cast(sizeof(hrr_args_hipModuleGetFunctionCount)), // [320] HRR_API_HIPMODULEGETFUNCTIONCOUNT - static_cast(sizeof(hrr_args_hipModuleGetGlobal)), // [321] HRR_API_HIPMODULEGETGLOBAL - static_cast(sizeof(hrr_args_hipModuleGetTexRef)), // [322] HRR_API_HIPMODULEGETTEXREF - static_cast(sizeof(hrr_args_hipModuleLaunchCooperativeKernel)), // [323] HRR_API_HIPMODULELAUNCHCOOPERATIVEKERNEL - static_cast(sizeof(hrr_args_hipModuleLaunchCooperativeKernelMultiDevice)), // [324] HRR_API_HIPMODULELAUNCHCOOPERATIVEKERNELMULTIDEVICE - static_cast(sizeof(hrr_event_header) + 8u + 2u + 16u + 12u + 12u + 4u + 2u + 2u), // [325] variable-length kernel launch - static_cast(sizeof(hrr_args_hipModuleLoad)), // [326] HRR_API_HIPMODULELOAD - static_cast(sizeof(hrr_args_hipModuleLoadData)), // [327] HRR_API_HIPMODULELOADDATA - static_cast(sizeof(hrr_args_hipModuleLoadDataEx)), // [328] HRR_API_HIPMODULELOADDATAEX - static_cast(sizeof(hrr_args_hipLinkAddData)), // [329] HRR_API_HIPLINKADDDATA - static_cast(sizeof(hrr_args_hipLinkAddFile)), // [330] HRR_API_HIPLINKADDFILE - static_cast(sizeof(hrr_args_hipLinkComplete)), // [331] HRR_API_HIPLINKCOMPLETE - static_cast(sizeof(hrr_args_hipLinkCreate)), // [332] HRR_API_HIPLINKCREATE - static_cast(sizeof(hrr_args_hipLinkDestroy)), // [333] HRR_API_HIPLINKDESTROY - static_cast(sizeof(hrr_args_hipModuleOccupancyMaxActiveBlocksPerMultiprocessor)), // [334] HRR_API_HIPMODULEOCCUPANCYMAXACTIVEBLOCKSPERMULTIPROCESSOR - static_cast(sizeof(hrr_args_hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags)), // [335] HRR_API_HIPMODULEOCCUPANCYMAXACTIVEBLOCKSPERMULTIPROCESSORWITHFLAGS - static_cast(sizeof(hrr_args_hipModuleOccupancyMaxPotentialBlockSize)), // [336] HRR_API_HIPMODULEOCCUPANCYMAXPOTENTIALBLOCKSIZE - static_cast(sizeof(hrr_args_hipModuleOccupancyMaxPotentialBlockSizeWithFlags)), // [337] HRR_API_HIPMODULEOCCUPANCYMAXPOTENTIALBLOCKSIZEWITHFLAGS - static_cast(sizeof(hrr_args_hipModuleUnload)), // [338] HRR_API_HIPMODULEUNLOAD - static_cast(sizeof(hrr_args_hipOccupancyAvailableDynamicSMemPerBlock)), // [339] HRR_API_HIPOCCUPANCYAVAILABLEDYNAMICSMEMPERBLOCK - static_cast(sizeof(hrr_args_hipOccupancyMaxActiveBlocksPerMultiprocessor)), // [340] HRR_API_HIPOCCUPANCYMAXACTIVEBLOCKSPERMULTIPROCESSOR - static_cast(sizeof(hrr_args_hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags)), // [341] HRR_API_HIPOCCUPANCYMAXACTIVEBLOCKSPERMULTIPROCESSORWITHFLAGS - static_cast(sizeof(hrr_args_hipOccupancyMaxPotentialBlockSize)), // [342] HRR_API_HIPOCCUPANCYMAXPOTENTIALBLOCKSIZE - static_cast(sizeof(hrr_args_hipOccupancyMaxActiveClusters)), // [343] HRR_API_HIPOCCUPANCYMAXACTIVECLUSTERS - static_cast(sizeof(hrr_args_hipOccupancyMaxPotentialClusterSize)), // [344] HRR_API_HIPOCCUPANCYMAXPOTENTIALCLUSTERSIZE - static_cast(sizeof(hrr_args_hipPeekAtLastError)), // [345] HRR_API_HIPPEEKATLASTERROR - static_cast(sizeof(hrr_args_hipPointerGetAttribute)), // [346] HRR_API_HIPPOINTERGETATTRIBUTE - static_cast(sizeof(hrr_args_hipPointerGetAttributes)), // [347] HRR_API_HIPPOINTERGETATTRIBUTES - static_cast(sizeof(hrr_args_hipPointerSetAttribute)), // [348] HRR_API_HIPPOINTERSETATTRIBUTE - static_cast(sizeof(hrr_args_hipProfilerStart)), // [349] HRR_API_HIPPROFILERSTART - static_cast(sizeof(hrr_args_hipProfilerStop)), // [350] HRR_API_HIPPROFILERSTOP - static_cast(sizeof(hrr_args_hipRuntimeGetVersion)), // [351] HRR_API_HIPRUNTIMEGETVERSION - static_cast(sizeof(hrr_args_hipSetDevice)), // [352] HRR_API_HIPSETDEVICE - static_cast(sizeof(hrr_args_hipSetDeviceFlags)), // [353] HRR_API_HIPSETDEVICEFLAGS - static_cast(sizeof(hrr_args_hipSetupArgument)), // [354] HRR_API_HIPSETUPARGUMENT - static_cast(sizeof(hrr_args_hipSignalExternalSemaphoresAsync)), // [355] HRR_API_HIPSIGNALEXTERNALSEMAPHORESASYNC - static_cast(sizeof(hrr_args_hipStreamAddCallback)), // [356] HRR_API_HIPSTREAMADDCALLBACK - static_cast(sizeof(hrr_args_hipStreamAttachMemAsync)), // [357] HRR_API_HIPSTREAMATTACHMEMASYNC - static_cast(sizeof(hrr_args_hipStreamBeginCapture)), // [358] HRR_API_HIPSTREAMBEGINCAPTURE - static_cast(sizeof(hrr_args_hipStreamCopyAttributes)), // [359] HRR_API_HIPSTREAMCOPYATTRIBUTES - static_cast(sizeof(hrr_args_hipStreamCreate)), // [360] HRR_API_HIPSTREAMCREATE - static_cast(sizeof(hrr_args_hipStreamCreateWithFlags)), // [361] HRR_API_HIPSTREAMCREATEWITHFLAGS - static_cast(sizeof(hrr_args_hipStreamCreateWithPriority)), // [362] HRR_API_HIPSTREAMCREATEWITHPRIORITY - static_cast(sizeof(hrr_args_hipStreamDestroy)), // [363] HRR_API_HIPSTREAMDESTROY - static_cast(sizeof(hrr_args_hipStreamEndCapture)), // [364] HRR_API_HIPSTREAMENDCAPTURE - static_cast(sizeof(hrr_args_hipStreamGetCaptureInfo)), // [365] HRR_API_HIPSTREAMGETCAPTUREINFO - static_cast(sizeof(hrr_args_hipStreamGetCaptureInfo_v2)), // [366] HRR_API_HIPSTREAMGETCAPTUREINFO_V2 - static_cast(sizeof(hrr_args_hipStreamGetDevice)), // [367] HRR_API_HIPSTREAMGETDEVICE - static_cast(sizeof(hrr_args_hipStreamGetFlags)), // [368] HRR_API_HIPSTREAMGETFLAGS - static_cast(sizeof(hrr_args_hipStreamGetId)), // [369] HRR_API_HIPSTREAMGETID - static_cast(sizeof(hrr_args_hipStreamGetPriority)), // [370] HRR_API_HIPSTREAMGETPRIORITY - static_cast(sizeof(hrr_args_hipStreamIsCapturing)), // [371] HRR_API_HIPSTREAMISCAPTURING - static_cast(sizeof(hrr_args_hipStreamQuery)), // [372] HRR_API_HIPSTREAMQUERY - static_cast(sizeof(hrr_args_hipStreamSynchronize)), // [373] HRR_API_HIPSTREAMSYNCHRONIZE - static_cast(sizeof(hrr_args_hipStreamUpdateCaptureDependencies)), // [374] HRR_API_HIPSTREAMUPDATECAPTUREDEPENDENCIES - static_cast(sizeof(hrr_args_hipStreamWaitEvent)), // [375] HRR_API_HIPSTREAMWAITEVENT - static_cast(sizeof(hrr_args_hipStreamWaitValue32)), // [376] HRR_API_HIPSTREAMWAITVALUE32 - static_cast(sizeof(hrr_args_hipStreamWaitValue64)), // [377] HRR_API_HIPSTREAMWAITVALUE64 - static_cast(sizeof(hrr_args_hipStreamWriteValue32)), // [378] HRR_API_HIPSTREAMWRITEVALUE32 - static_cast(sizeof(hrr_args_hipStreamWriteValue64)), // [379] HRR_API_HIPSTREAMWRITEVALUE64 - static_cast(sizeof(hrr_args_hipStreamBatchMemOp)), // [380] HRR_API_HIPSTREAMBATCHMEMOP - static_cast(sizeof(hrr_args_hipTexObjectCreate)), // [381] HRR_API_HIPTEXOBJECTCREATE - static_cast(sizeof(hrr_args_hipTexObjectDestroy)), // [382] HRR_API_HIPTEXOBJECTDESTROY - static_cast(sizeof(hrr_args_hipTexObjectGetResourceDesc)), // [383] HRR_API_HIPTEXOBJECTGETRESOURCEDESC - static_cast(sizeof(hrr_args_hipTexObjectGetResourceViewDesc)), // [384] HRR_API_HIPTEXOBJECTGETRESOURCEVIEWDESC - static_cast(sizeof(hrr_args_hipTexObjectGetTextureDesc)), // [385] HRR_API_HIPTEXOBJECTGETTEXTUREDESC - static_cast(sizeof(hrr_args_hipTexRefGetAddress)), // [386] HRR_API_HIPTEXREFGETADDRESS - static_cast(sizeof(hrr_args_hipTexRefGetAddressMode)), // [387] HRR_API_HIPTEXREFGETADDRESSMODE - static_cast(sizeof(hrr_args_hipTexRefGetFilterMode)), // [388] HRR_API_HIPTEXREFGETFILTERMODE - static_cast(sizeof(hrr_args_hipTexRefGetFlags)), // [389] HRR_API_HIPTEXREFGETFLAGS - static_cast(sizeof(hrr_args_hipTexRefGetFormat)), // [390] HRR_API_HIPTEXREFGETFORMAT - static_cast(sizeof(hrr_args_hipTexRefGetMaxAnisotropy)), // [391] HRR_API_HIPTEXREFGETMAXANISOTROPY - static_cast(sizeof(hrr_args_hipTexRefGetMipMappedArray)), // [392] HRR_API_HIPTEXREFGETMIPMAPPEDARRAY - static_cast(sizeof(hrr_args_hipTexRefGetMipmapFilterMode)), // [393] HRR_API_HIPTEXREFGETMIPMAPFILTERMODE - static_cast(sizeof(hrr_args_hipTexRefGetMipmapLevelBias)), // [394] HRR_API_HIPTEXREFGETMIPMAPLEVELBIAS - static_cast(sizeof(hrr_args_hipTexRefGetMipmapLevelClamp)), // [395] HRR_API_HIPTEXREFGETMIPMAPLEVELCLAMP - static_cast(sizeof(hrr_args_hipTexRefSetAddress)), // [396] HRR_API_HIPTEXREFSETADDRESS - static_cast(sizeof(hrr_args_hipTexRefSetAddress2D)), // [397] HRR_API_HIPTEXREFSETADDRESS2D - static_cast(sizeof(hrr_args_hipTexRefSetAddressMode)), // [398] HRR_API_HIPTEXREFSETADDRESSMODE - static_cast(sizeof(hrr_args_hipTexRefSetArray)), // [399] HRR_API_HIPTEXREFSETARRAY - static_cast(sizeof(hrr_args_hipTexRefSetBorderColor)), // [400] HRR_API_HIPTEXREFSETBORDERCOLOR - static_cast(sizeof(hrr_args_hipTexRefSetFilterMode)), // [401] HRR_API_HIPTEXREFSETFILTERMODE - static_cast(sizeof(hrr_args_hipTexRefSetFlags)), // [402] HRR_API_HIPTEXREFSETFLAGS - static_cast(sizeof(hrr_args_hipTexRefSetFormat)), // [403] HRR_API_HIPTEXREFSETFORMAT - static_cast(sizeof(hrr_args_hipTexRefSetMaxAnisotropy)), // [404] HRR_API_HIPTEXREFSETMAXANISOTROPY - static_cast(sizeof(hrr_args_hipTexRefSetMipmapFilterMode)), // [405] HRR_API_HIPTEXREFSETMIPMAPFILTERMODE - static_cast(sizeof(hrr_args_hipTexRefSetMipmapLevelBias)), // [406] HRR_API_HIPTEXREFSETMIPMAPLEVELBIAS - static_cast(sizeof(hrr_args_hipTexRefSetMipmapLevelClamp)), // [407] HRR_API_HIPTEXREFSETMIPMAPLEVELCLAMP - static_cast(sizeof(hrr_args_hipTexRefSetMipmappedArray)), // [408] HRR_API_HIPTEXREFSETMIPMAPPEDARRAY - static_cast(sizeof(hrr_args_hipThreadExchangeStreamCaptureMode)), // [409] HRR_API_HIPTHREADEXCHANGESTREAMCAPTUREMODE - static_cast(sizeof(hrr_args_hipUnbindTexture)), // [410] HRR_API_HIPUNBINDTEXTURE - static_cast(sizeof(hrr_args_hipUserObjectCreate)), // [411] HRR_API_HIPUSEROBJECTCREATE - static_cast(sizeof(hrr_args_hipUserObjectRelease)), // [412] HRR_API_HIPUSEROBJECTRELEASE - static_cast(sizeof(hrr_args_hipUserObjectRetain)), // [413] HRR_API_HIPUSEROBJECTRETAIN - static_cast(sizeof(hrr_args_hipWaitExternalSemaphoresAsync)), // [414] HRR_API_HIPWAITEXTERNALSEMAPHORESASYNC - static_cast(sizeof(hrr_args_hipMemcpy_spt)), // [415] HRR_API_HIPMEMCPY_SPT - static_cast(sizeof(hrr_args_hipMemcpyToSymbol_spt)), // [416] HRR_API_HIPMEMCPYTOSYMBOL_SPT - static_cast(sizeof(hrr_args_hipMemcpyFromSymbol_spt)), // [417] HRR_API_HIPMEMCPYFROMSYMBOL_SPT - static_cast(sizeof(hrr_args_hipMemcpy2D_spt)), // [418] HRR_API_HIPMEMCPY2D_SPT - static_cast(sizeof(hrr_args_hipMemcpy2DFromArray_spt)), // [419] HRR_API_HIPMEMCPY2DFROMARRAY_SPT - static_cast(sizeof(hrr_args_hipMemcpy3D_spt)), // [420] HRR_API_HIPMEMCPY3D_SPT - static_cast(sizeof(hrr_args_hipMemset_spt)), // [421] HRR_API_HIPMEMSET_SPT - static_cast(sizeof(hrr_args_hipMemsetAsync_spt)), // [422] HRR_API_HIPMEMSETASYNC_SPT - static_cast(sizeof(hrr_args_hipMemset2D_spt)), // [423] HRR_API_HIPMEMSET2D_SPT - static_cast(sizeof(hrr_args_hipMemset2DAsync_spt)), // [424] HRR_API_HIPMEMSET2DASYNC_SPT - static_cast(sizeof(hrr_args_hipMemset3DAsync_spt)), // [425] HRR_API_HIPMEMSET3DASYNC_SPT - static_cast(sizeof(hrr_args_hipMemset3D_spt)), // [426] HRR_API_HIPMEMSET3D_SPT - static_cast(sizeof(hrr_args_hipMemcpyAsync_spt)), // [427] HRR_API_HIPMEMCPYASYNC_SPT - static_cast(sizeof(hrr_args_hipMemcpy3DAsync_spt)), // [428] HRR_API_HIPMEMCPY3DASYNC_SPT - static_cast(sizeof(hrr_args_hipMemcpy2DAsync_spt)), // [429] HRR_API_HIPMEMCPY2DASYNC_SPT - static_cast(sizeof(hrr_args_hipMemcpyFromSymbolAsync_spt)), // [430] HRR_API_HIPMEMCPYFROMSYMBOLASYNC_SPT - static_cast(sizeof(hrr_args_hipMemcpyToSymbolAsync_spt)), // [431] HRR_API_HIPMEMCPYTOSYMBOLASYNC_SPT - static_cast(sizeof(hrr_args_hipMemcpyFromArray_spt)), // [432] HRR_API_HIPMEMCPYFROMARRAY_SPT - static_cast(sizeof(hrr_args_hipMemcpy2DToArray_spt)), // [433] HRR_API_HIPMEMCPY2DTOARRAY_SPT - static_cast(sizeof(hrr_args_hipMemcpy2DFromArrayAsync_spt)), // [434] HRR_API_HIPMEMCPY2DFROMARRAYASYNC_SPT - static_cast(sizeof(hrr_args_hipMemcpy2DToArrayAsync_spt)), // [435] HRR_API_HIPMEMCPY2DTOARRAYASYNC_SPT - static_cast(sizeof(hrr_args_hipStreamQuery_spt)), // [436] HRR_API_HIPSTREAMQUERY_SPT - static_cast(sizeof(hrr_args_hipStreamSynchronize_spt)), // [437] HRR_API_HIPSTREAMSYNCHRONIZE_SPT - static_cast(sizeof(hrr_args_hipStreamGetPriority_spt)), // [438] HRR_API_HIPSTREAMGETPRIORITY_SPT - static_cast(sizeof(hrr_args_hipStreamWaitEvent_spt)), // [439] HRR_API_HIPSTREAMWAITEVENT_SPT - static_cast(sizeof(hrr_args_hipStreamGetFlags_spt)), // [440] HRR_API_HIPSTREAMGETFLAGS_SPT - static_cast(sizeof(hrr_args_hipStreamAddCallback_spt)), // [441] HRR_API_HIPSTREAMADDCALLBACK_SPT - static_cast(sizeof(hrr_args_hipEventRecord_spt)), // [442] HRR_API_HIPEVENTRECORD_SPT - static_cast(sizeof(hrr_args_hipLaunchCooperativeKernel_spt)), // [443] HRR_API_HIPLAUNCHCOOPERATIVEKERNEL_SPT - static_cast(sizeof(hrr_args_hipLaunchKernel_spt)), // [444] HRR_API_HIPLAUNCHKERNEL_SPT - static_cast(sizeof(hrr_args_hipGraphLaunch_spt)), // [445] HRR_API_HIPGRAPHLAUNCH_SPT - static_cast(sizeof(hrr_args_hipStreamBeginCapture_spt)), // [446] HRR_API_HIPSTREAMBEGINCAPTURE_SPT - static_cast(sizeof(hrr_args_hipStreamEndCapture_spt)), // [447] HRR_API_HIPSTREAMENDCAPTURE_SPT - static_cast(sizeof(hrr_args_hipStreamIsCapturing_spt)), // [448] HRR_API_HIPSTREAMISCAPTURING_SPT - static_cast(sizeof(hrr_args_hipStreamGetCaptureInfo_spt)), // [449] HRR_API_HIPSTREAMGETCAPTUREINFO_SPT - static_cast(sizeof(hrr_args_hipStreamGetCaptureInfo_v2_spt)), // [450] HRR_API_HIPSTREAMGETCAPTUREINFO_V2_SPT - static_cast(sizeof(hrr_args_hipLaunchHostFunc_spt)), // [451] HRR_API_HIPLAUNCHHOSTFUNC_SPT - static_cast(sizeof(hrr_args_hipCreateChannelDesc)), // [452] HRR_API_HIPCREATECHANNELDESC - static_cast(sizeof(hrr_event_header) + 8u + 2u + 16u + 12u + 12u + 4u + 2u + 2u), // [453] variable-length kernel launch - static_cast(sizeof(hrr_args_hipHccModuleLaunchKernel)), // [454] HRR_API_HIPHCCMODULELAUNCHKERNEL - static_cast(sizeof(hrr_args_hipGetStreamDeviceId)), // [455] HRR_API_HIPGETSTREAMDEVICEID - static_cast(sizeof(hrr_args_hipDrvGraphAddMemsetNode)), // [456] HRR_API_HIPDRVGRAPHADDMEMSETNODE - static_cast(sizeof(hrr_args_hipGraphAddExternalSemaphoresWaitNode)), // [457] HRR_API_HIPGRAPHADDEXTERNALSEMAPHORESWAITNODE - static_cast(sizeof(hrr_args_hipGraphAddExternalSemaphoresSignalNode)), // [458] HRR_API_HIPGRAPHADDEXTERNALSEMAPHORESSIGNALNODE - static_cast(sizeof(hrr_args_hipGraphExternalSemaphoresSignalNodeSetParams)), // [459] HRR_API_HIPGRAPHEXTERNALSEMAPHORESSIGNALNODESETPARAMS - static_cast(sizeof(hrr_args_hipGraphExternalSemaphoresWaitNodeSetParams)), // [460] HRR_API_HIPGRAPHEXTERNALSEMAPHORESWAITNODESETPARAMS - static_cast(sizeof(hrr_args_hipGraphExternalSemaphoresSignalNodeGetParams)), // [461] HRR_API_HIPGRAPHEXTERNALSEMAPHORESSIGNALNODEGETPARAMS - static_cast(sizeof(hrr_args_hipGraphExternalSemaphoresWaitNodeGetParams)), // [462] HRR_API_HIPGRAPHEXTERNALSEMAPHORESWAITNODEGETPARAMS - static_cast(sizeof(hrr_args_hipGraphExecExternalSemaphoresSignalNodeSetParams)), // [463] HRR_API_HIPGRAPHEXECEXTERNALSEMAPHORESSIGNALNODESETPARAMS - static_cast(sizeof(hrr_args_hipGraphExecExternalSemaphoresWaitNodeSetParams)), // [464] HRR_API_HIPGRAPHEXECEXTERNALSEMAPHORESWAITNODESETPARAMS - static_cast(sizeof(hrr_args_hipGraphAddNode)), // [465] HRR_API_HIPGRAPHADDNODE - static_cast(sizeof(hrr_args_hipGraphInstantiateWithParams)), // [466] HRR_API_HIPGRAPHINSTANTIATEWITHPARAMS - static_cast(sizeof(hrr_args_hipExtGetLastError)), // [467] HRR_API_HIPEXTGETLASTERROR - static_cast(sizeof(hrr_args_hipTexRefGetBorderColor)), // [468] HRR_API_HIPTEXREFGETBORDERCOLOR - static_cast(sizeof(hrr_args_hipTexRefGetArray)), // [469] HRR_API_HIPTEXREFGETARRAY - static_cast(sizeof(hrr_args_hipGetProcAddress)), // [470] HRR_API_HIPGETPROCADDRESS - static_cast(sizeof(hrr_args_hipStreamBeginCaptureToGraph)), // [471] HRR_API_HIPSTREAMBEGINCAPTURETOGRAPH - static_cast(sizeof(hrr_args_hipGetFuncBySymbol)), // [472] HRR_API_HIPGETFUNCBYSYMBOL - static_cast(sizeof(hrr_args_hipDrvGraphAddMemFreeNode)), // [473] HRR_API_HIPDRVGRAPHADDMEMFREENODE - static_cast(sizeof(hrr_args_hipDrvGraphExecMemcpyNodeSetParams)), // [474] HRR_API_HIPDRVGRAPHEXECMEMCPYNODESETPARAMS - static_cast(sizeof(hrr_args_hipDrvGraphExecMemsetNodeSetParams)), // [475] HRR_API_HIPDRVGRAPHEXECMEMSETNODESETPARAMS - static_cast(sizeof(hrr_args_hipSetValidDevices)), // [476] HRR_API_HIPSETVALIDDEVICES - static_cast(sizeof(hrr_args_hipMemcpyAtoD)), // [477] HRR_API_HIPMEMCPYATOD - static_cast(sizeof(hrr_args_hipMemcpyDtoA)), // [478] HRR_API_HIPMEMCPYDTOA - static_cast(sizeof(hrr_args_hipMemcpyAtoA)), // [479] HRR_API_HIPMEMCPYATOA - static_cast(sizeof(hrr_args_hipMemcpyAtoHAsync)), // [480] HRR_API_HIPMEMCPYATOHASYNC - static_cast(sizeof(hrr_args_hipMemcpyHtoAAsync)), // [481] HRR_API_HIPMEMCPYHTOAASYNC - static_cast(sizeof(hrr_args_hipMemcpy2DArrayToArray)), // [482] HRR_API_HIPMEMCPY2DARRAYTOARRAY - static_cast(sizeof(hrr_args_hipGraphExecGetFlags)), // [483] HRR_API_HIPGRAPHEXECGETFLAGS - static_cast(sizeof(hrr_args_hipGraphNodeSetParams)), // [484] HRR_API_HIPGRAPHNODESETPARAMS - static_cast(sizeof(hrr_args_hipGraphExecNodeSetParams)), // [485] HRR_API_HIPGRAPHEXECNODESETPARAMS - static_cast(sizeof(hrr_args_hipExternalMemoryGetMappedMipmappedArray)), // [486] HRR_API_HIPEXTERNALMEMORYGETMAPPEDMIPMAPPEDARRAY - static_cast(sizeof(hrr_args_hipDrvGraphMemcpyNodeGetParams)), // [487] HRR_API_HIPDRVGRAPHMEMCPYNODEGETPARAMS - static_cast(sizeof(hrr_args_hipDrvGraphMemcpyNodeSetParams)), // [488] HRR_API_HIPDRVGRAPHMEMCPYNODESETPARAMS - static_cast(sizeof(hrr_args_hipExtHostAlloc)), // [489] HRR_API_HIPEXTHOSTALLOC - static_cast(sizeof(hrr_args_hipDeviceGetTexture1DLinearMaxWidth)), // [490] HRR_API_HIPDEVICEGETTEXTURE1DLINEARMAXWIDTH - static_cast(sizeof(hrr_args_hipGraphAddBatchMemOpNode)), // [491] HRR_API_HIPGRAPHADDBATCHMEMOPNODE - static_cast(sizeof(hrr_args_hipGraphBatchMemOpNodeGetParams)), // [492] HRR_API_HIPGRAPHBATCHMEMOPNODEGETPARAMS - static_cast(sizeof(hrr_args_hipGraphBatchMemOpNodeSetParams)), // [493] HRR_API_HIPGRAPHBATCHMEMOPNODESETPARAMS - static_cast(sizeof(hrr_args_hipGraphExecBatchMemOpNodeSetParams)), // [494] HRR_API_HIPGRAPHEXECBATCHMEMOPNODESETPARAMS - static_cast(sizeof(hrr_args_hipEventRecordWithFlags)), // [495] HRR_API_HIPEVENTRECORDWITHFLAGS - static_cast(sizeof(hrr_args_hipLaunchKernelExC)), // [496] HRR_API_HIPLAUNCHKERNELEXC - static_cast(sizeof(hrr_args_hipDrvLaunchKernelEx)), // [497] HRR_API_HIPDRVLAUNCHKERNELEX - static_cast(sizeof(hrr_args_hipMemGetHandleForAddressRange)), // [498] HRR_API_HIPMEMGETHANDLEFORADDRESSRANGE - static_cast(sizeof(hrr_args_hipMemsetD2D8)), // [499] HRR_API_HIPMEMSETD2D8 - static_cast(sizeof(hrr_args_hipMemsetD2D8Async)), // [500] HRR_API_HIPMEMSETD2D8ASYNC - static_cast(sizeof(hrr_args_hipMemsetD2D16)), // [501] HRR_API_HIPMEMSETD2D16 - static_cast(sizeof(hrr_args_hipMemsetD2D16Async)), // [502] HRR_API_HIPMEMSETD2D16ASYNC - static_cast(sizeof(hrr_args_hipMemsetD2D32)), // [503] HRR_API_HIPMEMSETD2D32 - static_cast(sizeof(hrr_args_hipMemsetD2D32Async)), // [504] HRR_API_HIPMEMSETD2D32ASYNC - static_cast(sizeof(hrr_args_hipStreamSetAttribute)), // [505] HRR_API_HIPSTREAMSETATTRIBUTE - static_cast(sizeof(hrr_args_hipStreamGetAttribute)), // [506] HRR_API_HIPSTREAMGETATTRIBUTE - static_cast(sizeof(hrr_args_hipModuleLoadFatBinary)), // [507] HRR_API_HIPMODULELOADFATBINARY - static_cast(sizeof(hrr_args_hipMemcpyBatchAsync)), // [508] HRR_API_HIPMEMCPYBATCHASYNC - static_cast(sizeof(hrr_args_hipMemcpy3DBatchAsync)), // [509] HRR_API_HIPMEMCPY3DBATCHASYNC - static_cast(sizeof(hrr_args_hipMemcpy3DPeer)), // [510] HRR_API_HIPMEMCPY3DPEER - static_cast(sizeof(hrr_args_hipMemcpy3DPeerAsync)), // [511] HRR_API_HIPMEMCPY3DPEERASYNC - static_cast(sizeof(hrr_args_hipGetDriverEntryPoint)), // [512] HRR_API_HIPGETDRIVERENTRYPOINT - static_cast(sizeof(hrr_args_hipGetDriverEntryPoint_spt)), // [513] HRR_API_HIPGETDRIVERENTRYPOINT_SPT - static_cast(sizeof(hrr_args_hipLibraryLoadData)), // [514] HRR_API_HIPLIBRARYLOADDATA - static_cast(sizeof(hrr_args_hipLibraryLoadFromFile)), // [515] HRR_API_HIPLIBRARYLOADFROMFILE - static_cast(sizeof(hrr_args_hipLibraryUnload)), // [516] HRR_API_HIPLIBRARYUNLOAD - static_cast(sizeof(hrr_args_hipLibraryGetKernel)), // [517] HRR_API_HIPLIBRARYGETKERNEL - static_cast(sizeof(hrr_args_hipLibraryGetKernelCount)), // [518] HRR_API_HIPLIBRARYGETKERNELCOUNT - static_cast(sizeof(hrr_args_hipLibraryGetGlobal)), // [519] HRR_API_HIPLIBRARYGETGLOBAL - static_cast(sizeof(hrr_args_hipLibraryGetManaged)), // [520] HRR_API_HIPLIBRARYGETMANAGED - static_cast(sizeof(hrr_args_hipLibraryEnumerateKernels)), // [521] HRR_API_HIPLIBRARYENUMERATEKERNELS - static_cast(sizeof(hrr_args_hipKernelGetLibrary)), // [522] HRR_API_HIPKERNELGETLIBRARY - static_cast(sizeof(hrr_args_hipKernelGetName)), // [523] HRR_API_HIPKERNELGETNAME - static_cast(sizeof(hrr_args_hipGetProcAddress_spt)), // [524] HRR_API_HIPGETPROCADDRESS_SPT - static_cast(sizeof(hrr_args_hipExtDisableLogging)), // [525] HRR_API_HIPEXTDISABLELOGGING - static_cast(sizeof(hrr_args_hipExtEnableLogging)), // [526] HRR_API_HIPEXTENABLELOGGING - static_cast(sizeof(hrr_args_hipExtSetLoggingParams)), // [527] HRR_API_HIPEXTSETLOGGINGPARAMS - static_cast(sizeof(hrr_args_hipKernelGetAttribute)), // [528] HRR_API_HIPKERNELGETATTRIBUTE - static_cast(sizeof(hrr_args_hipKernelSetAttribute)), // [529] HRR_API_HIPKERNELSETATTRIBUTE - static_cast(sizeof(hrr_args_hipKernelGetFunction)), // [530] HRR_API_HIPKERNELGETFUNCTION - static_cast(sizeof(hrr_args_hipKernelGetParamInfo)), // [531] HRR_API_HIPKERNELGETPARAMINFO - static_cast(sizeof(hrr_args_hipMemSetMemPool)), // [532] HRR_API_HIPMEMSETMEMPOOL - static_cast(sizeof(hrr_args_hipMemGetMemPool)), // [533] HRR_API_HIPMEMGETMEMPOOL - static_cast(sizeof(hrr_args_hipMipmappedArrayGetMemoryRequirements)), // [534] HRR_API_HIPMIPMAPPEDARRAYGETMEMORYREQUIREMENTS - static_cast(sizeof(hrr_args_hipGreenCtxCreate)), // [535] HRR_API_HIPGREENCTXCREATE - static_cast(sizeof(hrr_args_hipExecutionCtxDestroy)), // [536] HRR_API_HIPEXECUTIONCTXDESTROY - static_cast(sizeof(hrr_args_hipExecutionCtxStreamCreate)), // [537] HRR_API_HIPEXECUTIONCTXSTREAMCREATE - static_cast(sizeof(hrr_args_hipDeviceGetDevResource)), // [538] HRR_API_HIPDEVICEGETDEVRESOURCE - static_cast(sizeof(hrr_args_hipDevSmResourceSplitByCount)), // [539] HRR_API_HIPDEVSMRESOURCESPLITBYCOUNT - static_cast(sizeof(hrr_args_hipDevSmResourceSplit)), // [540] HRR_API_HIPDEVSMRESOURCESPLIT - static_cast(sizeof(hrr_args_hipDevResourceGenerateDesc)), // [541] HRR_API_HIPDEVRESOURCEGENERATEDESC - static_cast(sizeof(hrr_args_hipDeviceGetExecutionCtx)), // [542] HRR_API_HIPDEVICEGETEXECUTIONCTX - static_cast(sizeof(hrr_args_hipExecutionCtxGetDevResource)), // [543] HRR_API_HIPEXECUTIONCTXGETDEVRESOURCE - static_cast(sizeof(hrr_args_hipExecutionCtxGetDevice)), // [544] HRR_API_HIPEXECUTIONCTXGETDEVICE - static_cast(sizeof(hrr_args_hipExecutionCtxGetId)), // [545] HRR_API_HIPEXECUTIONCTXGETID - static_cast(sizeof(hrr_args_hipStreamGetDevResource)), // [546] HRR_API_HIPSTREAMGETDEVRESOURCE - static_cast(sizeof(hrr_args_hipExecutionCtxRecordEvent)), // [547] HRR_API_HIPEXECUTIONCTXRECORDEVENT - static_cast(sizeof(hrr_args_hipExecutionCtxSynchronize)), // [548] HRR_API_HIPEXECUTIONCTXSYNCHRONIZE - static_cast(sizeof(hrr_args_hipExecutionCtxWaitEvent)), // [549] HRR_API_HIPEXECUTIONCTXWAITEVENT + static_cast(sizeof(hrr_args_hipDeviceGetLuid)), // [56] HRR_API_HIPDEVICEGETLUID + static_cast(sizeof(hrr_args_hipDeviceGetMemPool)), // [57] HRR_API_HIPDEVICEGETMEMPOOL + static_cast(sizeof(hrr_args_hipDeviceGetName)), // [58] HRR_API_HIPDEVICEGETNAME + static_cast(sizeof(hrr_args_hipDeviceGetP2PAttribute)), // [59] HRR_API_HIPDEVICEGETP2PATTRIBUTE + static_cast(sizeof(hrr_args_hipDeviceGetPCIBusId)), // [60] HRR_API_HIPDEVICEGETPCIBUSID + static_cast(sizeof(hrr_args_hipDeviceGetSharedMemConfig)), // [61] HRR_API_HIPDEVICEGETSHAREDMEMCONFIG + static_cast(sizeof(hrr_args_hipDeviceGetStreamPriorityRange)), // [62] HRR_API_HIPDEVICEGETSTREAMPRIORITYRANGE + static_cast(sizeof(hrr_args_hipDeviceGetUuid)), // [63] HRR_API_HIPDEVICEGETUUID + static_cast(sizeof(hrr_args_hipDeviceGraphMemTrim)), // [64] HRR_API_HIPDEVICEGRAPHMEMTRIM + static_cast(sizeof(hrr_args_hipDevicePrimaryCtxGetState)), // [65] HRR_API_HIPDEVICEPRIMARYCTXGETSTATE + static_cast(sizeof(hrr_args_hipDevicePrimaryCtxRelease)), // [66] HRR_API_HIPDEVICEPRIMARYCTXRELEASE + static_cast(sizeof(hrr_args_hipDevicePrimaryCtxReset)), // [67] HRR_API_HIPDEVICEPRIMARYCTXRESET + static_cast(sizeof(hrr_args_hipDevicePrimaryCtxRetain)), // [68] HRR_API_HIPDEVICEPRIMARYCTXRETAIN + static_cast(sizeof(hrr_args_hipDevicePrimaryCtxSetFlags)), // [69] HRR_API_HIPDEVICEPRIMARYCTXSETFLAGS + static_cast(sizeof(hrr_args_hipDeviceReset)), // [70] HRR_API_HIPDEVICERESET + static_cast(sizeof(hrr_args_hipDeviceSetCacheConfig)), // [71] HRR_API_HIPDEVICESETCACHECONFIG + static_cast(sizeof(hrr_args_hipDeviceSetGraphMemAttribute)), // [72] HRR_API_HIPDEVICESETGRAPHMEMATTRIBUTE + static_cast(sizeof(hrr_args_hipDeviceSetLimit)), // [73] HRR_API_HIPDEVICESETLIMIT + static_cast(sizeof(hrr_args_hipDeviceSetMemPool)), // [74] HRR_API_HIPDEVICESETMEMPOOL + static_cast(sizeof(hrr_args_hipDeviceSetSharedMemConfig)), // [75] HRR_API_HIPDEVICESETSHAREDMEMCONFIG + static_cast(sizeof(hrr_args_hipDeviceSynchronize)), // [76] HRR_API_HIPDEVICESYNCHRONIZE + static_cast(sizeof(hrr_args_hipDeviceTotalMem)), // [77] HRR_API_HIPDEVICETOTALMEM + static_cast(sizeof(hrr_args_hipDriverGetVersion)), // [78] HRR_API_HIPDRIVERGETVERSION + static_cast(sizeof(hrr_args_hipDrvGetErrorName)), // [79] HRR_API_HIPDRVGETERRORNAME + static_cast(sizeof(hrr_args_hipDrvGetErrorString)), // [80] HRR_API_HIPDRVGETERRORSTRING + static_cast(sizeof(hrr_args_hipDrvGraphAddMemcpyNode)), // [81] HRR_API_HIPDRVGRAPHADDMEMCPYNODE + static_cast(sizeof(hrr_args_hipDrvMemcpy2DUnaligned)), // [82] HRR_API_HIPDRVMEMCPY2DUNALIGNED + static_cast(sizeof(hrr_args_hipDrvMemcpy3D)), // [83] HRR_API_HIPDRVMEMCPY3D + static_cast(sizeof(hrr_args_hipDrvMemcpy3DAsync)), // [84] HRR_API_HIPDRVMEMCPY3DASYNC + static_cast(sizeof(hrr_args_hipDrvPointerGetAttributes)), // [85] HRR_API_HIPDRVPOINTERGETATTRIBUTES + static_cast(sizeof(hrr_args_hipEventCreate)), // [86] HRR_API_HIPEVENTCREATE + static_cast(sizeof(hrr_args_hipEventCreateWithFlags)), // [87] HRR_API_HIPEVENTCREATEWITHFLAGS + static_cast(sizeof(hrr_args_hipEventDestroy)), // [88] HRR_API_HIPEVENTDESTROY + static_cast(sizeof(hrr_args_hipEventElapsedTime)), // [89] HRR_API_HIPEVENTELAPSEDTIME + static_cast(sizeof(hrr_args_hipEventQuery)), // [90] HRR_API_HIPEVENTQUERY + static_cast(sizeof(hrr_args_hipEventRecord)), // [91] HRR_API_HIPEVENTRECORD + static_cast(sizeof(hrr_args_hipEventSynchronize)), // [92] HRR_API_HIPEVENTSYNCHRONIZE + static_cast(sizeof(hrr_args_hipExtGetLinkTypeAndHopCount)), // [93] HRR_API_HIPEXTGETLINKTYPEANDHOPCOUNT + static_cast(sizeof(hrr_args_hipExtLaunchKernel)), // [94] HRR_API_HIPEXTLAUNCHKERNEL + static_cast(sizeof(hrr_args_hipExtLaunchMultiKernelMultiDevice)), // [95] HRR_API_HIPEXTLAUNCHMULTIKERNELMULTIDEVICE + static_cast(sizeof(hrr_args_hipExtMallocWithFlags)), // [96] HRR_API_HIPEXTMALLOCWITHFLAGS + static_cast(sizeof(hrr_args_hipExtStreamCreateWithCUMask)), // [97] HRR_API_HIPEXTSTREAMCREATEWITHCUMASK + static_cast(sizeof(hrr_args_hipExtStreamGetCUMask)), // [98] HRR_API_HIPEXTSTREAMGETCUMASK + static_cast(sizeof(hrr_args_hipExternalMemoryGetMappedBuffer)), // [99] HRR_API_HIPEXTERNALMEMORYGETMAPPEDBUFFER + static_cast(sizeof(hrr_args_hipFree)), // [100] HRR_API_HIPFREE + static_cast(sizeof(hrr_args_hipFreeArray)), // [101] HRR_API_HIPFREEARRAY + static_cast(sizeof(hrr_args_hipFreeAsync)), // [102] HRR_API_HIPFREEASYNC + static_cast(sizeof(hrr_args_hipFreeHost)), // [103] HRR_API_HIPFREEHOST + static_cast(sizeof(hrr_args_hipFreeMipmappedArray)), // [104] HRR_API_HIPFREEMIPMAPPEDARRAY + static_cast(sizeof(hrr_args_hipFuncGetAttribute)), // [105] HRR_API_HIPFUNCGETATTRIBUTE + static_cast(sizeof(hrr_args_hipFuncGetAttributes)), // [106] HRR_API_HIPFUNCGETATTRIBUTES + static_cast(sizeof(hrr_args_hipFuncSetAttribute)), // [107] HRR_API_HIPFUNCSETATTRIBUTE + static_cast(sizeof(hrr_args_hipFuncSetCacheConfig)), // [108] HRR_API_HIPFUNCSETCACHECONFIG + static_cast(sizeof(hrr_args_hipFuncSetSharedMemConfig)), // [109] HRR_API_HIPFUNCSETSHAREDMEMCONFIG + static_cast(sizeof(hrr_args_hipGLGetDevices)), // [110] HRR_API_HIPGLGETDEVICES + static_cast(sizeof(hrr_args_hipGetChannelDesc)), // [111] HRR_API_HIPGETCHANNELDESC + static_cast(sizeof(hrr_args_hipGetDevice)), // [112] HRR_API_HIPGETDEVICE + static_cast(sizeof(hrr_args_hipGetDeviceCount)), // [113] HRR_API_HIPGETDEVICECOUNT + static_cast(sizeof(hrr_args_hipGetDeviceFlags)), // [114] HRR_API_HIPGETDEVICEFLAGS + static_cast(sizeof(hrr_args_hipGetDevicePropertiesR0600)), // [115] HRR_API_HIPGETDEVICEPROPERTIESR0600 + static_cast(sizeof(hrr_args_hipGetDevicePropertiesR0000)), // [116] HRR_API_HIPGETDEVICEPROPERTIESR0000 + static_cast(sizeof(hrr_args_hipGetErrorName)), // [117] HRR_API_HIPGETERRORNAME + static_cast(sizeof(hrr_args_hipGetErrorString)), // [118] HRR_API_HIPGETERRORSTRING + static_cast(sizeof(hrr_args_hipGetLastError)), // [119] HRR_API_HIPGETLASTERROR + static_cast(sizeof(hrr_args_hipGetMipmappedArrayLevel)), // [120] HRR_API_HIPGETMIPMAPPEDARRAYLEVEL + static_cast(sizeof(hrr_args_hipGetSymbolAddress)), // [121] HRR_API_HIPGETSYMBOLADDRESS + static_cast(sizeof(hrr_args_hipGetSymbolSize)), // [122] HRR_API_HIPGETSYMBOLSIZE + static_cast(sizeof(hrr_args_hipGetTextureAlignmentOffset)), // [123] HRR_API_HIPGETTEXTUREALIGNMENTOFFSET + static_cast(sizeof(hrr_args_hipGetTextureObjectResourceDesc)), // [124] HRR_API_HIPGETTEXTUREOBJECTRESOURCEDESC + static_cast(sizeof(hrr_args_hipGetTextureObjectResourceViewDesc)), // [125] HRR_API_HIPGETTEXTUREOBJECTRESOURCEVIEWDESC + static_cast(sizeof(hrr_args_hipGetTextureObjectTextureDesc)), // [126] HRR_API_HIPGETTEXTUREOBJECTTEXTUREDESC + static_cast(sizeof(hrr_args_hipGetTextureReference)), // [127] HRR_API_HIPGETTEXTUREREFERENCE + static_cast(sizeof(hrr_args_hipGraphAddChildGraphNode)), // [128] HRR_API_HIPGRAPHADDCHILDGRAPHNODE + static_cast(sizeof(hrr_args_hipGraphAddDependencies)), // [129] HRR_API_HIPGRAPHADDDEPENDENCIES + static_cast(sizeof(hrr_args_hipGraphAddEmptyNode)), // [130] HRR_API_HIPGRAPHADDEMPTYNODE + static_cast(sizeof(hrr_args_hipGraphAddEventRecordNode)), // [131] HRR_API_HIPGRAPHADDEVENTRECORDNODE + static_cast(sizeof(hrr_args_hipGraphAddEventWaitNode)), // [132] HRR_API_HIPGRAPHADDEVENTWAITNODE + static_cast(sizeof(hrr_args_hipGraphAddHostNode)), // [133] HRR_API_HIPGRAPHADDHOSTNODE + static_cast(sizeof(hrr_args_hipGraphAddKernelNode)), // [134] HRR_API_HIPGRAPHADDKERNELNODE + static_cast(sizeof(hrr_args_hipGraphAddMemAllocNode)), // [135] HRR_API_HIPGRAPHADDMEMALLOCNODE + static_cast(sizeof(hrr_args_hipGraphAddMemFreeNode)), // [136] HRR_API_HIPGRAPHADDMEMFREENODE + static_cast(sizeof(hrr_args_hipGraphAddMemcpyNode)), // [137] HRR_API_HIPGRAPHADDMEMCPYNODE + static_cast(sizeof(hrr_args_hipGraphAddMemcpyNode1D)), // [138] HRR_API_HIPGRAPHADDMEMCPYNODE1D + static_cast(sizeof(hrr_args_hipGraphAddMemcpyNodeFromSymbol)), // [139] HRR_API_HIPGRAPHADDMEMCPYNODEFROMSYMBOL + static_cast(sizeof(hrr_args_hipGraphAddMemcpyNodeToSymbol)), // [140] HRR_API_HIPGRAPHADDMEMCPYNODETOSYMBOL + static_cast(sizeof(hrr_args_hipGraphAddMemsetNode)), // [141] HRR_API_HIPGRAPHADDMEMSETNODE + static_cast(sizeof(hrr_args_hipGraphChildGraphNodeGetGraph)), // [142] HRR_API_HIPGRAPHCHILDGRAPHNODEGETGRAPH + static_cast(sizeof(hrr_args_hipGraphClone)), // [143] HRR_API_HIPGRAPHCLONE + static_cast(sizeof(hrr_args_hipGraphCreate)), // [144] HRR_API_HIPGRAPHCREATE + static_cast(sizeof(hrr_args_hipGraphDebugDotPrint)), // [145] HRR_API_HIPGRAPHDEBUGDOTPRINT + static_cast(sizeof(hrr_args_hipGraphDestroy)), // [146] HRR_API_HIPGRAPHDESTROY + static_cast(sizeof(hrr_args_hipGraphDestroyNode)), // [147] HRR_API_HIPGRAPHDESTROYNODE + static_cast(sizeof(hrr_args_hipGraphEventRecordNodeGetEvent)), // [148] HRR_API_HIPGRAPHEVENTRECORDNODEGETEVENT + static_cast(sizeof(hrr_args_hipGraphEventRecordNodeSetEvent)), // [149] HRR_API_HIPGRAPHEVENTRECORDNODESETEVENT + static_cast(sizeof(hrr_args_hipGraphEventWaitNodeGetEvent)), // [150] HRR_API_HIPGRAPHEVENTWAITNODEGETEVENT + static_cast(sizeof(hrr_args_hipGraphEventWaitNodeSetEvent)), // [151] HRR_API_HIPGRAPHEVENTWAITNODESETEVENT + static_cast(sizeof(hrr_args_hipGraphExecChildGraphNodeSetParams)), // [152] HRR_API_HIPGRAPHEXECCHILDGRAPHNODESETPARAMS + static_cast(sizeof(hrr_args_hipGraphExecDestroy)), // [153] HRR_API_HIPGRAPHEXECDESTROY + static_cast(sizeof(hrr_args_hipGraphExecEventRecordNodeSetEvent)), // [154] HRR_API_HIPGRAPHEXECEVENTRECORDNODESETEVENT + static_cast(sizeof(hrr_args_hipGraphExecEventWaitNodeSetEvent)), // [155] HRR_API_HIPGRAPHEXECEVENTWAITNODESETEVENT + static_cast(sizeof(hrr_args_hipGraphExecHostNodeSetParams)), // [156] HRR_API_HIPGRAPHEXECHOSTNODESETPARAMS + static_cast(sizeof(hrr_args_hipGraphExecKernelNodeSetParams)), // [157] HRR_API_HIPGRAPHEXECKERNELNODESETPARAMS + static_cast(sizeof(hrr_args_hipGraphExecMemcpyNodeSetParams)), // [158] HRR_API_HIPGRAPHEXECMEMCPYNODESETPARAMS + static_cast(sizeof(hrr_args_hipGraphExecMemcpyNodeSetParams1D)), // [159] HRR_API_HIPGRAPHEXECMEMCPYNODESETPARAMS1D + static_cast(sizeof(hrr_args_hipGraphExecMemcpyNodeSetParamsFromSymbol)), // [160] HRR_API_HIPGRAPHEXECMEMCPYNODESETPARAMSFROMSYMBOL + static_cast(sizeof(hrr_args_hipGraphExecMemcpyNodeSetParamsToSymbol)), // [161] HRR_API_HIPGRAPHEXECMEMCPYNODESETPARAMSTOSYMBOL + static_cast(sizeof(hrr_args_hipGraphExecMemsetNodeSetParams)), // [162] HRR_API_HIPGRAPHEXECMEMSETNODESETPARAMS + static_cast(sizeof(hrr_args_hipGraphExecUpdate)), // [163] HRR_API_HIPGRAPHEXECUPDATE + static_cast(sizeof(hrr_args_hipGraphGetEdges)), // [164] HRR_API_HIPGRAPHGETEDGES + static_cast(sizeof(hrr_args_hipGraphGetNodes)), // [165] HRR_API_HIPGRAPHGETNODES + static_cast(sizeof(hrr_args_hipGraphGetRootNodes)), // [166] HRR_API_HIPGRAPHGETROOTNODES + static_cast(sizeof(hrr_args_hipGraphHostNodeGetParams)), // [167] HRR_API_HIPGRAPHHOSTNODEGETPARAMS + static_cast(sizeof(hrr_args_hipGraphHostNodeSetParams)), // [168] HRR_API_HIPGRAPHHOSTNODESETPARAMS + static_cast(sizeof(hrr_args_hipGraphInstantiate)), // [169] HRR_API_HIPGRAPHINSTANTIATE + static_cast(sizeof(hrr_args_hipGraphInstantiateWithFlags)), // [170] HRR_API_HIPGRAPHINSTANTIATEWITHFLAGS + static_cast(sizeof(hrr_args_hipGraphKernelNodeCopyAttributes)), // [171] HRR_API_HIPGRAPHKERNELNODECOPYATTRIBUTES + static_cast(sizeof(hrr_args_hipGraphKernelNodeGetAttribute)), // [172] HRR_API_HIPGRAPHKERNELNODEGETATTRIBUTE + static_cast(sizeof(hrr_args_hipGraphKernelNodeGetParams)), // [173] HRR_API_HIPGRAPHKERNELNODEGETPARAMS + static_cast(sizeof(hrr_args_hipGraphKernelNodeSetAttribute)), // [174] HRR_API_HIPGRAPHKERNELNODESETATTRIBUTE + static_cast(sizeof(hrr_args_hipGraphKernelNodeSetParams)), // [175] HRR_API_HIPGRAPHKERNELNODESETPARAMS + static_cast(sizeof(hrr_args_hipGraphLaunch)), // [176] HRR_API_HIPGRAPHLAUNCH + static_cast(sizeof(hrr_args_hipGraphMemAllocNodeGetParams)), // [177] HRR_API_HIPGRAPHMEMALLOCNODEGETPARAMS + static_cast(sizeof(hrr_args_hipGraphMemFreeNodeGetParams)), // [178] HRR_API_HIPGRAPHMEMFREENODEGETPARAMS + static_cast(sizeof(hrr_args_hipGraphMemcpyNodeGetParams)), // [179] HRR_API_HIPGRAPHMEMCPYNODEGETPARAMS + static_cast(sizeof(hrr_args_hipGraphMemcpyNodeSetParams)), // [180] HRR_API_HIPGRAPHMEMCPYNODESETPARAMS + static_cast(sizeof(hrr_args_hipGraphMemcpyNodeSetParams1D)), // [181] HRR_API_HIPGRAPHMEMCPYNODESETPARAMS1D + static_cast(sizeof(hrr_args_hipGraphMemcpyNodeSetParamsFromSymbol)), // [182] HRR_API_HIPGRAPHMEMCPYNODESETPARAMSFROMSYMBOL + static_cast(sizeof(hrr_args_hipGraphMemcpyNodeSetParamsToSymbol)), // [183] HRR_API_HIPGRAPHMEMCPYNODESETPARAMSTOSYMBOL + static_cast(sizeof(hrr_args_hipGraphMemsetNodeGetParams)), // [184] HRR_API_HIPGRAPHMEMSETNODEGETPARAMS + static_cast(sizeof(hrr_args_hipGraphMemsetNodeSetParams)), // [185] HRR_API_HIPGRAPHMEMSETNODESETPARAMS + static_cast(sizeof(hrr_args_hipGraphNodeFindInClone)), // [186] HRR_API_HIPGRAPHNODEFINDINCLONE + static_cast(sizeof(hrr_args_hipGraphNodeGetDependencies)), // [187] HRR_API_HIPGRAPHNODEGETDEPENDENCIES + static_cast(sizeof(hrr_args_hipGraphNodeGetDependentNodes)), // [188] HRR_API_HIPGRAPHNODEGETDEPENDENTNODES + static_cast(sizeof(hrr_args_hipGraphNodeGetEnabled)), // [189] HRR_API_HIPGRAPHNODEGETENABLED + static_cast(sizeof(hrr_args_hipGraphNodeGetType)), // [190] HRR_API_HIPGRAPHNODEGETTYPE + static_cast(sizeof(hrr_args_hipGraphNodeSetEnabled)), // [191] HRR_API_HIPGRAPHNODESETENABLED + static_cast(sizeof(hrr_args_hipGraphReleaseUserObject)), // [192] HRR_API_HIPGRAPHRELEASEUSEROBJECT + static_cast(sizeof(hrr_args_hipGraphRemoveDependencies)), // [193] HRR_API_HIPGRAPHREMOVEDEPENDENCIES + static_cast(sizeof(hrr_args_hipGraphRetainUserObject)), // [194] HRR_API_HIPGRAPHRETAINUSEROBJECT + static_cast(sizeof(hrr_args_hipGraphUpload)), // [195] HRR_API_HIPGRAPHUPLOAD + static_cast(sizeof(hrr_args_hipGraphicsGLRegisterBuffer)), // [196] HRR_API_HIPGRAPHICSGLREGISTERBUFFER + static_cast(sizeof(hrr_args_hipGraphicsGLRegisterImage)), // [197] HRR_API_HIPGRAPHICSGLREGISTERIMAGE + static_cast(sizeof(hrr_args_hipGraphicsMapResources)), // [198] HRR_API_HIPGRAPHICSMAPRESOURCES + static_cast(sizeof(hrr_args_hipGraphicsResourceGetMappedPointer)), // [199] HRR_API_HIPGRAPHICSRESOURCEGETMAPPEDPOINTER + static_cast(sizeof(hrr_args_hipGraphicsSubResourceGetMappedArray)), // [200] HRR_API_HIPGRAPHICSSUBRESOURCEGETMAPPEDARRAY + static_cast(sizeof(hrr_args_hipGraphicsUnmapResources)), // [201] HRR_API_HIPGRAPHICSUNMAPRESOURCES + static_cast(sizeof(hrr_args_hipGraphicsUnregisterResource)), // [202] HRR_API_HIPGRAPHICSUNREGISTERRESOURCE + static_cast(sizeof(hrr_args_hipHostAlloc)), // [203] HRR_API_HIPHOSTALLOC + static_cast(sizeof(hrr_args_hipHostFree)), // [204] HRR_API_HIPHOSTFREE + static_cast(sizeof(hrr_args_hipHostGetDevicePointer)), // [205] HRR_API_HIPHOSTGETDEVICEPOINTER + static_cast(sizeof(hrr_args_hipHostGetFlags)), // [206] HRR_API_HIPHOSTGETFLAGS + static_cast(sizeof(hrr_args_hipHostMalloc)), // [207] HRR_API_HIPHOSTMALLOC + static_cast(sizeof(hrr_args_hipHostRegister)), // [208] HRR_API_HIPHOSTREGISTER + static_cast(sizeof(hrr_args_hipHostUnregister)), // [209] HRR_API_HIPHOSTUNREGISTER + static_cast(sizeof(hrr_args_hipImportExternalMemory)), // [210] HRR_API_HIPIMPORTEXTERNALMEMORY + static_cast(sizeof(hrr_args_hipImportExternalSemaphore)), // [211] HRR_API_HIPIMPORTEXTERNALSEMAPHORE + static_cast(sizeof(hrr_args_hipInit)), // [212] HRR_API_HIPINIT + static_cast(sizeof(hrr_args_hipInitDevice)), // [213] HRR_API_HIPINITDEVICE + static_cast(sizeof(hrr_args_hipIpcCloseMemHandle)), // [214] HRR_API_HIPIPCCLOSEMEMHANDLE + static_cast(sizeof(hrr_args_hipIpcGetEventHandle)), // [215] HRR_API_HIPIPCGETEVENTHANDLE + static_cast(sizeof(hrr_args_hipIpcGetMemHandle)), // [216] HRR_API_HIPIPCGETMEMHANDLE + static_cast(sizeof(hrr_args_hipIpcOpenEventHandle)), // [217] HRR_API_HIPIPCOPENEVENTHANDLE + static_cast(sizeof(hrr_args_hipIpcOpenMemHandle)), // [218] HRR_API_HIPIPCOPENMEMHANDLE + static_cast(sizeof(hrr_args_hipKernelNameRef)), // [219] HRR_API_HIPKERNELNAMEREF + static_cast(sizeof(hrr_args_hipKernelNameRefByPtr)), // [220] HRR_API_HIPKERNELNAMEREFBYPTR + static_cast(sizeof(hrr_event_header) + 8u + 2u + 16u + 12u + 12u + 4u + 2u + 2u), // [221] variable-length kernel launch + static_cast(sizeof(hrr_args_hipLaunchCooperativeKernel)), // [222] HRR_API_HIPLAUNCHCOOPERATIVEKERNEL + static_cast(sizeof(hrr_args_hipLaunchCooperativeKernelMultiDevice)), // [223] HRR_API_HIPLAUNCHCOOPERATIVEKERNELMULTIDEVICE + static_cast(sizeof(hrr_args_hipLaunchHostFunc)), // [224] HRR_API_HIPLAUNCHHOSTFUNC + static_cast(sizeof(hrr_event_header) + 8u + 2u + 16u + 12u + 12u + 4u + 2u + 2u), // [225] variable-length kernel launch + static_cast(sizeof(hrr_args_hipMalloc)), // [226] HRR_API_HIPMALLOC + static_cast(sizeof(hrr_args_hipMalloc3D)), // [227] HRR_API_HIPMALLOC3D + static_cast(sizeof(hrr_args_hipMalloc3DArray)), // [228] HRR_API_HIPMALLOC3DARRAY + static_cast(sizeof(hrr_args_hipMallocArray)), // [229] HRR_API_HIPMALLOCARRAY + static_cast(sizeof(hrr_args_hipMallocAsync)), // [230] HRR_API_HIPMALLOCASYNC + static_cast(sizeof(hrr_args_hipMallocFromPoolAsync)), // [231] HRR_API_HIPMALLOCFROMPOOLASYNC + static_cast(sizeof(hrr_args_hipMallocHost)), // [232] HRR_API_HIPMALLOCHOST + static_cast(sizeof(hrr_args_hipMallocManaged)), // [233] HRR_API_HIPMALLOCMANAGED + static_cast(sizeof(hrr_args_hipMallocMipmappedArray)), // [234] HRR_API_HIPMALLOCMIPMAPPEDARRAY + static_cast(sizeof(hrr_args_hipMallocPitch)), // [235] HRR_API_HIPMALLOCPITCH + static_cast(sizeof(hrr_args_hipMemAddressFree)), // [236] HRR_API_HIPMEMADDRESSFREE + static_cast(sizeof(hrr_args_hipMemAddressReserve)), // [237] HRR_API_HIPMEMADDRESSRESERVE + static_cast(sizeof(hrr_args_hipMemAdvise)), // [238] HRR_API_HIPMEMADVISE + static_cast(sizeof(hrr_args_hipMemAdvise_v2)), // [239] HRR_API_HIPMEMADVISE_V2 + static_cast(sizeof(hrr_args_hipMemAllocHost)), // [240] HRR_API_HIPMEMALLOCHOST + static_cast(sizeof(hrr_args_hipMemAllocPitch)), // [241] HRR_API_HIPMEMALLOCPITCH + static_cast(sizeof(hrr_args_hipMemCreate)), // [242] HRR_API_HIPMEMCREATE + static_cast(sizeof(hrr_args_hipMemExportToShareableHandle)), // [243] HRR_API_HIPMEMEXPORTTOSHAREABLEHANDLE + static_cast(sizeof(hrr_args_hipMemGetAccess)), // [244] HRR_API_HIPMEMGETACCESS + static_cast(sizeof(hrr_args_hipMemGetAddressRange)), // [245] HRR_API_HIPMEMGETADDRESSRANGE + static_cast(sizeof(hrr_args_hipMemGetAllocationGranularity)), // [246] HRR_API_HIPMEMGETALLOCATIONGRANULARITY + static_cast(sizeof(hrr_args_hipMemGetAllocationPropertiesFromHandle)), // [247] HRR_API_HIPMEMGETALLOCATIONPROPERTIESFROMHANDLE + static_cast(sizeof(hrr_args_hipMemGetInfo)), // [248] HRR_API_HIPMEMGETINFO + static_cast(sizeof(hrr_args_hipMemImportFromShareableHandle)), // [249] HRR_API_HIPMEMIMPORTFROMSHAREABLEHANDLE + static_cast(sizeof(hrr_args_hipMemMap)), // [250] HRR_API_HIPMEMMAP + static_cast(sizeof(hrr_args_hipMemMapArrayAsync)), // [251] HRR_API_HIPMEMMAPARRAYASYNC + static_cast(sizeof(hrr_args_hipMemPoolCreate)), // [252] HRR_API_HIPMEMPOOLCREATE + static_cast(sizeof(hrr_args_hipMemPoolDestroy)), // [253] HRR_API_HIPMEMPOOLDESTROY + static_cast(sizeof(hrr_args_hipMemPoolExportPointer)), // [254] HRR_API_HIPMEMPOOLEXPORTPOINTER + static_cast(sizeof(hrr_args_hipMemPoolExportToShareableHandle)), // [255] HRR_API_HIPMEMPOOLEXPORTTOSHAREABLEHANDLE + static_cast(sizeof(hrr_args_hipMemPoolGetAccess)), // [256] HRR_API_HIPMEMPOOLGETACCESS + static_cast(sizeof(hrr_args_hipMemPoolGetAttribute)), // [257] HRR_API_HIPMEMPOOLGETATTRIBUTE + static_cast(sizeof(hrr_args_hipMemPoolImportFromShareableHandle)), // [258] HRR_API_HIPMEMPOOLIMPORTFROMSHAREABLEHANDLE + static_cast(sizeof(hrr_args_hipMemPoolImportPointer)), // [259] HRR_API_HIPMEMPOOLIMPORTPOINTER + static_cast(sizeof(hrr_args_hipMemPoolSetAccess)), // [260] HRR_API_HIPMEMPOOLSETACCESS + static_cast(sizeof(hrr_args_hipMemPoolSetAttribute)), // [261] HRR_API_HIPMEMPOOLSETATTRIBUTE + static_cast(sizeof(hrr_args_hipMemPoolTrimTo)), // [262] HRR_API_HIPMEMPOOLTRIMTO + static_cast(sizeof(hrr_args_hipMemPrefetchAsync)), // [263] HRR_API_HIPMEMPREFETCHASYNC + static_cast(sizeof(hrr_args_hipMemPrefetchAsync_v2)), // [264] HRR_API_HIPMEMPREFETCHASYNC_V2 + static_cast(sizeof(hrr_args_hipMemPrefetchBatchAsync)), // [265] HRR_API_HIPMEMPREFETCHBATCHASYNC + static_cast(sizeof(hrr_args_hipMemDiscardBatchAsync)), // [266] HRR_API_HIPMEMDISCARDBATCHASYNC + static_cast(sizeof(hrr_args_hipDrvMemDiscardBatchAsync)), // [267] HRR_API_HIPDRVMEMDISCARDBATCHASYNC + static_cast(sizeof(hrr_args_hipMemDiscardAndPrefetchBatchAsync)), // [268] HRR_API_HIPMEMDISCARDANDPREFETCHBATCHASYNC + static_cast(sizeof(hrr_args_hipDrvMemDiscardAndPrefetchBatchAsync)), // [269] HRR_API_HIPDRVMEMDISCARDANDPREFETCHBATCHASYNC + static_cast(sizeof(hrr_args_hipMemPtrGetInfo)), // [270] HRR_API_HIPMEMPTRGETINFO + static_cast(sizeof(hrr_args_hipMemRangeGetAttribute)), // [271] HRR_API_HIPMEMRANGEGETATTRIBUTE + static_cast(sizeof(hrr_args_hipMemRangeGetAttributes)), // [272] HRR_API_HIPMEMRANGEGETATTRIBUTES + static_cast(sizeof(hrr_args_hipMemRelease)), // [273] HRR_API_HIPMEMRELEASE + static_cast(sizeof(hrr_args_hipMemRetainAllocationHandle)), // [274] HRR_API_HIPMEMRETAINALLOCATIONHANDLE + static_cast(sizeof(hrr_args_hipMemSetAccess)), // [275] HRR_API_HIPMEMSETACCESS + static_cast(sizeof(hrr_args_hipMemUnmap)), // [276] HRR_API_HIPMEMUNMAP + static_cast(sizeof(hrr_args_hipMemcpy)), // [277] HRR_API_HIPMEMCPY + static_cast(sizeof(hrr_args_hipMemcpy2D)), // [278] HRR_API_HIPMEMCPY2D + static_cast(sizeof(hrr_args_hipMemcpy2DAsync)), // [279] HRR_API_HIPMEMCPY2DASYNC + static_cast(sizeof(hrr_args_hipMemcpy2DFromArray)), // [280] HRR_API_HIPMEMCPY2DFROMARRAY + static_cast(sizeof(hrr_args_hipMemcpy2DFromArrayAsync)), // [281] HRR_API_HIPMEMCPY2DFROMARRAYASYNC + static_cast(sizeof(hrr_args_hipMemcpy2DToArray)), // [282] HRR_API_HIPMEMCPY2DTOARRAY + static_cast(sizeof(hrr_args_hipMemcpy2DToArrayAsync)), // [283] HRR_API_HIPMEMCPY2DTOARRAYASYNC + static_cast(sizeof(hrr_args_hipMemcpy3D)), // [284] HRR_API_HIPMEMCPY3D + static_cast(sizeof(hrr_args_hipMemcpy3DAsync)), // [285] HRR_API_HIPMEMCPY3DASYNC + static_cast(sizeof(hrr_args_hipMemcpyAsync)), // [286] HRR_API_HIPMEMCPYASYNC + static_cast(sizeof(hrr_args_hipMemcpyAtoH)), // [287] HRR_API_HIPMEMCPYATOH + static_cast(sizeof(hrr_args_hipMemcpyDtoD)), // [288] HRR_API_HIPMEMCPYDTOD + static_cast(sizeof(hrr_args_hipMemcpyDtoDAsync)), // [289] HRR_API_HIPMEMCPYDTODASYNC + static_cast(sizeof(hrr_args_hipMemcpyDtoH)), // [290] HRR_API_HIPMEMCPYDTOH + static_cast(sizeof(hrr_args_hipMemcpyDtoHAsync)), // [291] HRR_API_HIPMEMCPYDTOHASYNC + static_cast(sizeof(hrr_args_hipMemcpyFromArray)), // [292] HRR_API_HIPMEMCPYFROMARRAY + static_cast(sizeof(hrr_args_hipMemcpyFromSymbol)), // [293] HRR_API_HIPMEMCPYFROMSYMBOL + static_cast(sizeof(hrr_args_hipMemcpyFromSymbolAsync)), // [294] HRR_API_HIPMEMCPYFROMSYMBOLASYNC + static_cast(sizeof(hrr_args_hipMemcpyHtoA)), // [295] HRR_API_HIPMEMCPYHTOA + static_cast(sizeof(hrr_args_hipMemcpyHtoD)), // [296] HRR_API_HIPMEMCPYHTOD + static_cast(sizeof(hrr_args_hipMemcpyHtoDAsync)), // [297] HRR_API_HIPMEMCPYHTODASYNC + static_cast(sizeof(hrr_args_hipMemcpyParam2D)), // [298] HRR_API_HIPMEMCPYPARAM2D + static_cast(sizeof(hrr_args_hipMemcpyParam2DAsync)), // [299] HRR_API_HIPMEMCPYPARAM2DASYNC + static_cast(sizeof(hrr_args_hipMemcpyPeer)), // [300] HRR_API_HIPMEMCPYPEER + static_cast(sizeof(hrr_args_hipMemcpyPeerAsync)), // [301] HRR_API_HIPMEMCPYPEERASYNC + static_cast(sizeof(hrr_args_hipMemcpyToArray)), // [302] HRR_API_HIPMEMCPYTOARRAY + static_cast(sizeof(hrr_args_hipMemcpyToSymbol)), // [303] HRR_API_HIPMEMCPYTOSYMBOL + static_cast(sizeof(hrr_args_hipMemcpyToSymbolAsync)), // [304] HRR_API_HIPMEMCPYTOSYMBOLASYNC + static_cast(sizeof(hrr_args_hipMemcpyWithStream)), // [305] HRR_API_HIPMEMCPYWITHSTREAM + static_cast(sizeof(hrr_args_hipMemset)), // [306] HRR_API_HIPMEMSET + static_cast(sizeof(hrr_args_hipMemset2D)), // [307] HRR_API_HIPMEMSET2D + static_cast(sizeof(hrr_args_hipMemset2DAsync)), // [308] HRR_API_HIPMEMSET2DASYNC + static_cast(sizeof(hrr_args_hipMemset3D)), // [309] HRR_API_HIPMEMSET3D + static_cast(sizeof(hrr_args_hipMemset3DAsync)), // [310] HRR_API_HIPMEMSET3DASYNC + static_cast(sizeof(hrr_args_hipMemsetAsync)), // [311] HRR_API_HIPMEMSETASYNC + static_cast(sizeof(hrr_args_hipMemsetD16)), // [312] HRR_API_HIPMEMSETD16 + static_cast(sizeof(hrr_args_hipMemsetD16Async)), // [313] HRR_API_HIPMEMSETD16ASYNC + static_cast(sizeof(hrr_args_hipMemsetD32)), // [314] HRR_API_HIPMEMSETD32 + static_cast(sizeof(hrr_args_hipMemsetD32Async)), // [315] HRR_API_HIPMEMSETD32ASYNC + static_cast(sizeof(hrr_args_hipMemsetD8)), // [316] HRR_API_HIPMEMSETD8 + static_cast(sizeof(hrr_args_hipMemsetD8Async)), // [317] HRR_API_HIPMEMSETD8ASYNC + static_cast(sizeof(hrr_args_hipMipmappedArrayCreate)), // [318] HRR_API_HIPMIPMAPPEDARRAYCREATE + static_cast(sizeof(hrr_args_hipMipmappedArrayDestroy)), // [319] HRR_API_HIPMIPMAPPEDARRAYDESTROY + static_cast(sizeof(hrr_args_hipMipmappedArrayGetLevel)), // [320] HRR_API_HIPMIPMAPPEDARRAYGETLEVEL + static_cast(sizeof(hrr_args_hipModuleGetFunction)), // [321] HRR_API_HIPMODULEGETFUNCTION + static_cast(sizeof(hrr_args_hipModuleGetFunctionCount)), // [322] HRR_API_HIPMODULEGETFUNCTIONCOUNT + static_cast(sizeof(hrr_args_hipModuleGetGlobal)), // [323] HRR_API_HIPMODULEGETGLOBAL + static_cast(sizeof(hrr_args_hipModuleGetTexRef)), // [324] HRR_API_HIPMODULEGETTEXREF + static_cast(sizeof(hrr_args_hipModuleLaunchCooperativeKernel)), // [325] HRR_API_HIPMODULELAUNCHCOOPERATIVEKERNEL + static_cast(sizeof(hrr_args_hipModuleLaunchCooperativeKernelMultiDevice)), // [326] HRR_API_HIPMODULELAUNCHCOOPERATIVEKERNELMULTIDEVICE + static_cast(sizeof(hrr_event_header) + 8u + 2u + 16u + 12u + 12u + 4u + 2u + 2u), // [327] variable-length kernel launch + static_cast(sizeof(hrr_args_hipModuleLoad)), // [328] HRR_API_HIPMODULELOAD + static_cast(sizeof(hrr_args_hipModuleLoadData)), // [329] HRR_API_HIPMODULELOADDATA + static_cast(sizeof(hrr_args_hipModuleLoadDataEx)), // [330] HRR_API_HIPMODULELOADDATAEX + static_cast(sizeof(hrr_args_hipLinkAddData)), // [331] HRR_API_HIPLINKADDDATA + static_cast(sizeof(hrr_args_hipLinkAddFile)), // [332] HRR_API_HIPLINKADDFILE + static_cast(sizeof(hrr_args_hipLinkComplete)), // [333] HRR_API_HIPLINKCOMPLETE + static_cast(sizeof(hrr_args_hipLinkCreate)), // [334] HRR_API_HIPLINKCREATE + static_cast(sizeof(hrr_args_hipLinkDestroy)), // [335] HRR_API_HIPLINKDESTROY + static_cast(sizeof(hrr_args_hipModuleOccupancyMaxActiveBlocksPerMultiprocessor)), // [336] HRR_API_HIPMODULEOCCUPANCYMAXACTIVEBLOCKSPERMULTIPROCESSOR + static_cast(sizeof(hrr_args_hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags)), // [337] HRR_API_HIPMODULEOCCUPANCYMAXACTIVEBLOCKSPERMULTIPROCESSORWITHFLAGS + static_cast(sizeof(hrr_args_hipModuleOccupancyMaxPotentialBlockSize)), // [338] HRR_API_HIPMODULEOCCUPANCYMAXPOTENTIALBLOCKSIZE + static_cast(sizeof(hrr_args_hipModuleOccupancyMaxPotentialBlockSizeWithFlags)), // [339] HRR_API_HIPMODULEOCCUPANCYMAXPOTENTIALBLOCKSIZEWITHFLAGS + static_cast(sizeof(hrr_args_hipModuleUnload)), // [340] HRR_API_HIPMODULEUNLOAD + static_cast(sizeof(hrr_args_hipOccupancyAvailableDynamicSMemPerBlock)), // [341] HRR_API_HIPOCCUPANCYAVAILABLEDYNAMICSMEMPERBLOCK + static_cast(sizeof(hrr_args_hipOccupancyMaxActiveBlocksPerMultiprocessor)), // [342] HRR_API_HIPOCCUPANCYMAXACTIVEBLOCKSPERMULTIPROCESSOR + static_cast(sizeof(hrr_args_hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags)), // [343] HRR_API_HIPOCCUPANCYMAXACTIVEBLOCKSPERMULTIPROCESSORWITHFLAGS + static_cast(sizeof(hrr_args_hipOccupancyMaxPotentialBlockSize)), // [344] HRR_API_HIPOCCUPANCYMAXPOTENTIALBLOCKSIZE + static_cast(sizeof(hrr_args_hipOccupancyMaxActiveClusters)), // [345] HRR_API_HIPOCCUPANCYMAXACTIVECLUSTERS + static_cast(sizeof(hrr_args_hipOccupancyMaxPotentialClusterSize)), // [346] HRR_API_HIPOCCUPANCYMAXPOTENTIALCLUSTERSIZE + static_cast(sizeof(hrr_args_hipPeekAtLastError)), // [347] HRR_API_HIPPEEKATLASTERROR + static_cast(sizeof(hrr_args_hipPointerGetAttribute)), // [348] HRR_API_HIPPOINTERGETATTRIBUTE + static_cast(sizeof(hrr_args_hipPointerGetAttributes)), // [349] HRR_API_HIPPOINTERGETATTRIBUTES + static_cast(sizeof(hrr_args_hipPointerSetAttribute)), // [350] HRR_API_HIPPOINTERSETATTRIBUTE + static_cast(sizeof(hrr_args_hipProfilerStart)), // [351] HRR_API_HIPPROFILERSTART + static_cast(sizeof(hrr_args_hipProfilerStop)), // [352] HRR_API_HIPPROFILERSTOP + static_cast(sizeof(hrr_args_hipRuntimeGetVersion)), // [353] HRR_API_HIPRUNTIMEGETVERSION + static_cast(sizeof(hrr_args_hipSetDevice)), // [354] HRR_API_HIPSETDEVICE + static_cast(sizeof(hrr_args_hipSetDeviceFlags)), // [355] HRR_API_HIPSETDEVICEFLAGS + static_cast(sizeof(hrr_args_hipSetupArgument)), // [356] HRR_API_HIPSETUPARGUMENT + static_cast(sizeof(hrr_args_hipSignalExternalSemaphoresAsync)), // [357] HRR_API_HIPSIGNALEXTERNALSEMAPHORESASYNC + static_cast(sizeof(hrr_args_hipStreamAddCallback)), // [358] HRR_API_HIPSTREAMADDCALLBACK + static_cast(sizeof(hrr_args_hipStreamAttachMemAsync)), // [359] HRR_API_HIPSTREAMATTACHMEMASYNC + static_cast(sizeof(hrr_args_hipStreamBeginCapture)), // [360] HRR_API_HIPSTREAMBEGINCAPTURE + static_cast(sizeof(hrr_args_hipStreamCopyAttributes)), // [361] HRR_API_HIPSTREAMCOPYATTRIBUTES + static_cast(sizeof(hrr_args_hipStreamCreate)), // [362] HRR_API_HIPSTREAMCREATE + static_cast(sizeof(hrr_args_hipStreamCreateWithFlags)), // [363] HRR_API_HIPSTREAMCREATEWITHFLAGS + static_cast(sizeof(hrr_args_hipStreamCreateWithPriority)), // [364] HRR_API_HIPSTREAMCREATEWITHPRIORITY + static_cast(sizeof(hrr_args_hipStreamDestroy)), // [365] HRR_API_HIPSTREAMDESTROY + static_cast(sizeof(hrr_args_hipStreamEndCapture)), // [366] HRR_API_HIPSTREAMENDCAPTURE + static_cast(sizeof(hrr_args_hipStreamGetCaptureInfo)), // [367] HRR_API_HIPSTREAMGETCAPTUREINFO + static_cast(sizeof(hrr_args_hipStreamGetCaptureInfo_v2)), // [368] HRR_API_HIPSTREAMGETCAPTUREINFO_V2 + static_cast(sizeof(hrr_args_hipStreamGetDevice)), // [369] HRR_API_HIPSTREAMGETDEVICE + static_cast(sizeof(hrr_args_hipStreamGetFlags)), // [370] HRR_API_HIPSTREAMGETFLAGS + static_cast(sizeof(hrr_args_hipStreamGetId)), // [371] HRR_API_HIPSTREAMGETID + static_cast(sizeof(hrr_args_hipStreamGetPriority)), // [372] HRR_API_HIPSTREAMGETPRIORITY + static_cast(sizeof(hrr_args_hipStreamIsCapturing)), // [373] HRR_API_HIPSTREAMISCAPTURING + static_cast(sizeof(hrr_args_hipStreamQuery)), // [374] HRR_API_HIPSTREAMQUERY + static_cast(sizeof(hrr_args_hipStreamSynchronize)), // [375] HRR_API_HIPSTREAMSYNCHRONIZE + static_cast(sizeof(hrr_args_hipStreamUpdateCaptureDependencies)), // [376] HRR_API_HIPSTREAMUPDATECAPTUREDEPENDENCIES + static_cast(sizeof(hrr_args_hipStreamWaitEvent)), // [377] HRR_API_HIPSTREAMWAITEVENT + static_cast(sizeof(hrr_args_hipStreamWaitValue32)), // [378] HRR_API_HIPSTREAMWAITVALUE32 + static_cast(sizeof(hrr_args_hipStreamWaitValue64)), // [379] HRR_API_HIPSTREAMWAITVALUE64 + static_cast(sizeof(hrr_args_hipStreamWriteValue32)), // [380] HRR_API_HIPSTREAMWRITEVALUE32 + static_cast(sizeof(hrr_args_hipStreamWriteValue64)), // [381] HRR_API_HIPSTREAMWRITEVALUE64 + static_cast(sizeof(hrr_args_hipStreamBatchMemOp)), // [382] HRR_API_HIPSTREAMBATCHMEMOP + static_cast(sizeof(hrr_args_hipTexObjectCreate)), // [383] HRR_API_HIPTEXOBJECTCREATE + static_cast(sizeof(hrr_args_hipTexObjectDestroy)), // [384] HRR_API_HIPTEXOBJECTDESTROY + static_cast(sizeof(hrr_args_hipTexObjectGetResourceDesc)), // [385] HRR_API_HIPTEXOBJECTGETRESOURCEDESC + static_cast(sizeof(hrr_args_hipTexObjectGetResourceViewDesc)), // [386] HRR_API_HIPTEXOBJECTGETRESOURCEVIEWDESC + static_cast(sizeof(hrr_args_hipTexObjectGetTextureDesc)), // [387] HRR_API_HIPTEXOBJECTGETTEXTUREDESC + static_cast(sizeof(hrr_args_hipTexRefGetAddress)), // [388] HRR_API_HIPTEXREFGETADDRESS + static_cast(sizeof(hrr_args_hipTexRefGetAddressMode)), // [389] HRR_API_HIPTEXREFGETADDRESSMODE + static_cast(sizeof(hrr_args_hipTexRefGetFilterMode)), // [390] HRR_API_HIPTEXREFGETFILTERMODE + static_cast(sizeof(hrr_args_hipTexRefGetFlags)), // [391] HRR_API_HIPTEXREFGETFLAGS + static_cast(sizeof(hrr_args_hipTexRefGetFormat)), // [392] HRR_API_HIPTEXREFGETFORMAT + static_cast(sizeof(hrr_args_hipTexRefGetMaxAnisotropy)), // [393] HRR_API_HIPTEXREFGETMAXANISOTROPY + static_cast(sizeof(hrr_args_hipTexRefGetMipMappedArray)), // [394] HRR_API_HIPTEXREFGETMIPMAPPEDARRAY + static_cast(sizeof(hrr_args_hipTexRefGetMipmapFilterMode)), // [395] HRR_API_HIPTEXREFGETMIPMAPFILTERMODE + static_cast(sizeof(hrr_args_hipTexRefGetMipmapLevelBias)), // [396] HRR_API_HIPTEXREFGETMIPMAPLEVELBIAS + static_cast(sizeof(hrr_args_hipTexRefGetMipmapLevelClamp)), // [397] HRR_API_HIPTEXREFGETMIPMAPLEVELCLAMP + static_cast(sizeof(hrr_args_hipTexRefSetAddress)), // [398] HRR_API_HIPTEXREFSETADDRESS + static_cast(sizeof(hrr_args_hipTexRefSetAddress2D)), // [399] HRR_API_HIPTEXREFSETADDRESS2D + static_cast(sizeof(hrr_args_hipTexRefSetAddressMode)), // [400] HRR_API_HIPTEXREFSETADDRESSMODE + static_cast(sizeof(hrr_args_hipTexRefSetArray)), // [401] HRR_API_HIPTEXREFSETARRAY + static_cast(sizeof(hrr_args_hipTexRefSetBorderColor)), // [402] HRR_API_HIPTEXREFSETBORDERCOLOR + static_cast(sizeof(hrr_args_hipTexRefSetFilterMode)), // [403] HRR_API_HIPTEXREFSETFILTERMODE + static_cast(sizeof(hrr_args_hipTexRefSetFlags)), // [404] HRR_API_HIPTEXREFSETFLAGS + static_cast(sizeof(hrr_args_hipTexRefSetFormat)), // [405] HRR_API_HIPTEXREFSETFORMAT + static_cast(sizeof(hrr_args_hipTexRefSetMaxAnisotropy)), // [406] HRR_API_HIPTEXREFSETMAXANISOTROPY + static_cast(sizeof(hrr_args_hipTexRefSetMipmapFilterMode)), // [407] HRR_API_HIPTEXREFSETMIPMAPFILTERMODE + static_cast(sizeof(hrr_args_hipTexRefSetMipmapLevelBias)), // [408] HRR_API_HIPTEXREFSETMIPMAPLEVELBIAS + static_cast(sizeof(hrr_args_hipTexRefSetMipmapLevelClamp)), // [409] HRR_API_HIPTEXREFSETMIPMAPLEVELCLAMP + static_cast(sizeof(hrr_args_hipTexRefSetMipmappedArray)), // [410] HRR_API_HIPTEXREFSETMIPMAPPEDARRAY + static_cast(sizeof(hrr_args_hipThreadExchangeStreamCaptureMode)), // [411] HRR_API_HIPTHREADEXCHANGESTREAMCAPTUREMODE + static_cast(sizeof(hrr_args_hipUnbindTexture)), // [412] HRR_API_HIPUNBINDTEXTURE + static_cast(sizeof(hrr_args_hipUserObjectCreate)), // [413] HRR_API_HIPUSEROBJECTCREATE + static_cast(sizeof(hrr_args_hipUserObjectRelease)), // [414] HRR_API_HIPUSEROBJECTRELEASE + static_cast(sizeof(hrr_args_hipUserObjectRetain)), // [415] HRR_API_HIPUSEROBJECTRETAIN + static_cast(sizeof(hrr_args_hipWaitExternalSemaphoresAsync)), // [416] HRR_API_HIPWAITEXTERNALSEMAPHORESASYNC + static_cast(sizeof(hrr_args_hipMemcpy_spt)), // [417] HRR_API_HIPMEMCPY_SPT + static_cast(sizeof(hrr_args_hipMemcpyToSymbol_spt)), // [418] HRR_API_HIPMEMCPYTOSYMBOL_SPT + static_cast(sizeof(hrr_args_hipMemcpyFromSymbol_spt)), // [419] HRR_API_HIPMEMCPYFROMSYMBOL_SPT + static_cast(sizeof(hrr_args_hipMemcpy2D_spt)), // [420] HRR_API_HIPMEMCPY2D_SPT + static_cast(sizeof(hrr_args_hipMemcpy2DFromArray_spt)), // [421] HRR_API_HIPMEMCPY2DFROMARRAY_SPT + static_cast(sizeof(hrr_args_hipMemcpy3D_spt)), // [422] HRR_API_HIPMEMCPY3D_SPT + static_cast(sizeof(hrr_args_hipMemset_spt)), // [423] HRR_API_HIPMEMSET_SPT + static_cast(sizeof(hrr_args_hipMemsetAsync_spt)), // [424] HRR_API_HIPMEMSETASYNC_SPT + static_cast(sizeof(hrr_args_hipMemset2D_spt)), // [425] HRR_API_HIPMEMSET2D_SPT + static_cast(sizeof(hrr_args_hipMemset2DAsync_spt)), // [426] HRR_API_HIPMEMSET2DASYNC_SPT + static_cast(sizeof(hrr_args_hipMemset3DAsync_spt)), // [427] HRR_API_HIPMEMSET3DASYNC_SPT + static_cast(sizeof(hrr_args_hipMemset3D_spt)), // [428] HRR_API_HIPMEMSET3D_SPT + static_cast(sizeof(hrr_args_hipMemcpyAsync_spt)), // [429] HRR_API_HIPMEMCPYASYNC_SPT + static_cast(sizeof(hrr_args_hipMemcpy3DAsync_spt)), // [430] HRR_API_HIPMEMCPY3DASYNC_SPT + static_cast(sizeof(hrr_args_hipMemcpy2DAsync_spt)), // [431] HRR_API_HIPMEMCPY2DASYNC_SPT + static_cast(sizeof(hrr_args_hipMemcpyFromSymbolAsync_spt)), // [432] HRR_API_HIPMEMCPYFROMSYMBOLASYNC_SPT + static_cast(sizeof(hrr_args_hipMemcpyToSymbolAsync_spt)), // [433] HRR_API_HIPMEMCPYTOSYMBOLASYNC_SPT + static_cast(sizeof(hrr_args_hipMemcpyFromArray_spt)), // [434] HRR_API_HIPMEMCPYFROMARRAY_SPT + static_cast(sizeof(hrr_args_hipMemcpy2DToArray_spt)), // [435] HRR_API_HIPMEMCPY2DTOARRAY_SPT + static_cast(sizeof(hrr_args_hipMemcpy2DFromArrayAsync_spt)), // [436] HRR_API_HIPMEMCPY2DFROMARRAYASYNC_SPT + static_cast(sizeof(hrr_args_hipMemcpy2DToArrayAsync_spt)), // [437] HRR_API_HIPMEMCPY2DTOARRAYASYNC_SPT + static_cast(sizeof(hrr_args_hipStreamQuery_spt)), // [438] HRR_API_HIPSTREAMQUERY_SPT + static_cast(sizeof(hrr_args_hipStreamSynchronize_spt)), // [439] HRR_API_HIPSTREAMSYNCHRONIZE_SPT + static_cast(sizeof(hrr_args_hipStreamGetPriority_spt)), // [440] HRR_API_HIPSTREAMGETPRIORITY_SPT + static_cast(sizeof(hrr_args_hipStreamWaitEvent_spt)), // [441] HRR_API_HIPSTREAMWAITEVENT_SPT + static_cast(sizeof(hrr_args_hipStreamGetFlags_spt)), // [442] HRR_API_HIPSTREAMGETFLAGS_SPT + static_cast(sizeof(hrr_args_hipStreamAddCallback_spt)), // [443] HRR_API_HIPSTREAMADDCALLBACK_SPT + static_cast(sizeof(hrr_args_hipEventRecord_spt)), // [444] HRR_API_HIPEVENTRECORD_SPT + static_cast(sizeof(hrr_args_hipLaunchCooperativeKernel_spt)), // [445] HRR_API_HIPLAUNCHCOOPERATIVEKERNEL_SPT + static_cast(sizeof(hrr_args_hipLaunchKernel_spt)), // [446] HRR_API_HIPLAUNCHKERNEL_SPT + static_cast(sizeof(hrr_args_hipGraphLaunch_spt)), // [447] HRR_API_HIPGRAPHLAUNCH_SPT + static_cast(sizeof(hrr_args_hipStreamBeginCapture_spt)), // [448] HRR_API_HIPSTREAMBEGINCAPTURE_SPT + static_cast(sizeof(hrr_args_hipStreamEndCapture_spt)), // [449] HRR_API_HIPSTREAMENDCAPTURE_SPT + static_cast(sizeof(hrr_args_hipStreamIsCapturing_spt)), // [450] HRR_API_HIPSTREAMISCAPTURING_SPT + static_cast(sizeof(hrr_args_hipStreamGetCaptureInfo_spt)), // [451] HRR_API_HIPSTREAMGETCAPTUREINFO_SPT + static_cast(sizeof(hrr_args_hipStreamGetCaptureInfo_v2_spt)), // [452] HRR_API_HIPSTREAMGETCAPTUREINFO_V2_SPT + static_cast(sizeof(hrr_args_hipLaunchHostFunc_spt)), // [453] HRR_API_HIPLAUNCHHOSTFUNC_SPT + static_cast(sizeof(hrr_args_hipCreateChannelDesc)), // [454] HRR_API_HIPCREATECHANNELDESC + static_cast(sizeof(hrr_event_header) + 8u + 2u + 16u + 12u + 12u + 4u + 2u + 2u), // [455] variable-length kernel launch + static_cast(sizeof(hrr_args_hipHccModuleLaunchKernel)), // [456] HRR_API_HIPHCCMODULELAUNCHKERNEL + static_cast(sizeof(hrr_args_hipGetStreamDeviceId)), // [457] HRR_API_HIPGETSTREAMDEVICEID + static_cast(sizeof(hrr_args_hipDrvGraphAddMemsetNode)), // [458] HRR_API_HIPDRVGRAPHADDMEMSETNODE + static_cast(sizeof(hrr_args_hipGraphAddExternalSemaphoresWaitNode)), // [459] HRR_API_HIPGRAPHADDEXTERNALSEMAPHORESWAITNODE + static_cast(sizeof(hrr_args_hipGraphAddExternalSemaphoresSignalNode)), // [460] HRR_API_HIPGRAPHADDEXTERNALSEMAPHORESSIGNALNODE + static_cast(sizeof(hrr_args_hipGraphExternalSemaphoresSignalNodeSetParams)), // [461] HRR_API_HIPGRAPHEXTERNALSEMAPHORESSIGNALNODESETPARAMS + static_cast(sizeof(hrr_args_hipGraphExternalSemaphoresWaitNodeSetParams)), // [462] HRR_API_HIPGRAPHEXTERNALSEMAPHORESWAITNODESETPARAMS + static_cast(sizeof(hrr_args_hipGraphExternalSemaphoresSignalNodeGetParams)), // [463] HRR_API_HIPGRAPHEXTERNALSEMAPHORESSIGNALNODEGETPARAMS + static_cast(sizeof(hrr_args_hipGraphExternalSemaphoresWaitNodeGetParams)), // [464] HRR_API_HIPGRAPHEXTERNALSEMAPHORESWAITNODEGETPARAMS + static_cast(sizeof(hrr_args_hipGraphExecExternalSemaphoresSignalNodeSetParams)), // [465] HRR_API_HIPGRAPHEXECEXTERNALSEMAPHORESSIGNALNODESETPARAMS + static_cast(sizeof(hrr_args_hipGraphExecExternalSemaphoresWaitNodeSetParams)), // [466] HRR_API_HIPGRAPHEXECEXTERNALSEMAPHORESWAITNODESETPARAMS + static_cast(sizeof(hrr_args_hipGraphAddNode)), // [467] HRR_API_HIPGRAPHADDNODE + static_cast(sizeof(hrr_args_hipGraphInstantiateWithParams)), // [468] HRR_API_HIPGRAPHINSTANTIATEWITHPARAMS + static_cast(sizeof(hrr_args_hipExtGetLastError)), // [469] HRR_API_HIPEXTGETLASTERROR + static_cast(sizeof(hrr_args_hipTexRefGetBorderColor)), // [470] HRR_API_HIPTEXREFGETBORDERCOLOR + static_cast(sizeof(hrr_args_hipTexRefGetArray)), // [471] HRR_API_HIPTEXREFGETARRAY + static_cast(sizeof(hrr_args_hipGetProcAddress)), // [472] HRR_API_HIPGETPROCADDRESS + static_cast(sizeof(hrr_args_hipStreamBeginCaptureToGraph)), // [473] HRR_API_HIPSTREAMBEGINCAPTURETOGRAPH + static_cast(sizeof(hrr_args_hipGetFuncBySymbol)), // [474] HRR_API_HIPGETFUNCBYSYMBOL + static_cast(sizeof(hrr_args_hipDrvGraphAddMemFreeNode)), // [475] HRR_API_HIPDRVGRAPHADDMEMFREENODE + static_cast(sizeof(hrr_args_hipDrvGraphExecMemcpyNodeSetParams)), // [476] HRR_API_HIPDRVGRAPHEXECMEMCPYNODESETPARAMS + static_cast(sizeof(hrr_args_hipDrvGraphExecMemsetNodeSetParams)), // [477] HRR_API_HIPDRVGRAPHEXECMEMSETNODESETPARAMS + static_cast(sizeof(hrr_args_hipSetValidDevices)), // [478] HRR_API_HIPSETVALIDDEVICES + static_cast(sizeof(hrr_args_hipMemcpyAtoD)), // [479] HRR_API_HIPMEMCPYATOD + static_cast(sizeof(hrr_args_hipMemcpyDtoA)), // [480] HRR_API_HIPMEMCPYDTOA + static_cast(sizeof(hrr_args_hipMemcpyAtoA)), // [481] HRR_API_HIPMEMCPYATOA + static_cast(sizeof(hrr_args_hipMemcpyAtoHAsync)), // [482] HRR_API_HIPMEMCPYATOHASYNC + static_cast(sizeof(hrr_args_hipMemcpyHtoAAsync)), // [483] HRR_API_HIPMEMCPYHTOAASYNC + static_cast(sizeof(hrr_args_hipMemcpy2DArrayToArray)), // [484] HRR_API_HIPMEMCPY2DARRAYTOARRAY + static_cast(sizeof(hrr_args_hipGraphExecGetFlags)), // [485] HRR_API_HIPGRAPHEXECGETFLAGS + static_cast(sizeof(hrr_args_hipGraphNodeSetParams)), // [486] HRR_API_HIPGRAPHNODESETPARAMS + static_cast(sizeof(hrr_args_hipGraphExecNodeSetParams)), // [487] HRR_API_HIPGRAPHEXECNODESETPARAMS + static_cast(sizeof(hrr_args_hipExternalMemoryGetMappedMipmappedArray)), // [488] HRR_API_HIPEXTERNALMEMORYGETMAPPEDMIPMAPPEDARRAY + static_cast(sizeof(hrr_args_hipDrvGraphMemcpyNodeGetParams)), // [489] HRR_API_HIPDRVGRAPHMEMCPYNODEGETPARAMS + static_cast(sizeof(hrr_args_hipDrvGraphMemcpyNodeSetParams)), // [490] HRR_API_HIPDRVGRAPHMEMCPYNODESETPARAMS + static_cast(sizeof(hrr_args_hipExtHostAlloc)), // [491] HRR_API_HIPEXTHOSTALLOC + static_cast(sizeof(hrr_args_hipDeviceGetTexture1DLinearMaxWidth)), // [492] HRR_API_HIPDEVICEGETTEXTURE1DLINEARMAXWIDTH + static_cast(sizeof(hrr_args_hipGraphAddBatchMemOpNode)), // [493] HRR_API_HIPGRAPHADDBATCHMEMOPNODE + static_cast(sizeof(hrr_args_hipGraphBatchMemOpNodeGetParams)), // [494] HRR_API_HIPGRAPHBATCHMEMOPNODEGETPARAMS + static_cast(sizeof(hrr_args_hipGraphBatchMemOpNodeSetParams)), // [495] HRR_API_HIPGRAPHBATCHMEMOPNODESETPARAMS + static_cast(sizeof(hrr_args_hipGraphExecBatchMemOpNodeSetParams)), // [496] HRR_API_HIPGRAPHEXECBATCHMEMOPNODESETPARAMS + static_cast(sizeof(hrr_args_hipEventRecordWithFlags)), // [497] HRR_API_HIPEVENTRECORDWITHFLAGS + static_cast(sizeof(hrr_args_hipLaunchKernelExC)), // [498] HRR_API_HIPLAUNCHKERNELEXC + static_cast(sizeof(hrr_args_hipDrvLaunchKernelEx)), // [499] HRR_API_HIPDRVLAUNCHKERNELEX + static_cast(sizeof(hrr_args_hipMemGetHandleForAddressRange)), // [500] HRR_API_HIPMEMGETHANDLEFORADDRESSRANGE + static_cast(sizeof(hrr_args_hipMemsetD2D8)), // [501] HRR_API_HIPMEMSETD2D8 + static_cast(sizeof(hrr_args_hipMemsetD2D8Async)), // [502] HRR_API_HIPMEMSETD2D8ASYNC + static_cast(sizeof(hrr_args_hipMemsetD2D16)), // [503] HRR_API_HIPMEMSETD2D16 + static_cast(sizeof(hrr_args_hipMemsetD2D16Async)), // [504] HRR_API_HIPMEMSETD2D16ASYNC + static_cast(sizeof(hrr_args_hipMemsetD2D32)), // [505] HRR_API_HIPMEMSETD2D32 + static_cast(sizeof(hrr_args_hipMemsetD2D32Async)), // [506] HRR_API_HIPMEMSETD2D32ASYNC + static_cast(sizeof(hrr_args_hipStreamSetAttribute)), // [507] HRR_API_HIPSTREAMSETATTRIBUTE + static_cast(sizeof(hrr_args_hipStreamGetAttribute)), // [508] HRR_API_HIPSTREAMGETATTRIBUTE + static_cast(sizeof(hrr_args_hipModuleLoadFatBinary)), // [509] HRR_API_HIPMODULELOADFATBINARY + static_cast(sizeof(hrr_args_hipMemcpyBatchAsync)), // [510] HRR_API_HIPMEMCPYBATCHASYNC + static_cast(sizeof(hrr_args_hipMemcpy3DBatchAsync)), // [511] HRR_API_HIPMEMCPY3DBATCHASYNC + static_cast(sizeof(hrr_args_hipMemcpy3DPeer)), // [512] HRR_API_HIPMEMCPY3DPEER + static_cast(sizeof(hrr_args_hipMemcpy3DPeerAsync)), // [513] HRR_API_HIPMEMCPY3DPEERASYNC + static_cast(sizeof(hrr_args_hipGetDriverEntryPoint)), // [514] HRR_API_HIPGETDRIVERENTRYPOINT + static_cast(sizeof(hrr_args_hipGetDriverEntryPoint_spt)), // [515] HRR_API_HIPGETDRIVERENTRYPOINT_SPT + static_cast(sizeof(hrr_args_hipLibraryLoadData)), // [516] HRR_API_HIPLIBRARYLOADDATA + static_cast(sizeof(hrr_args_hipLibraryLoadFromFile)), // [517] HRR_API_HIPLIBRARYLOADFROMFILE + static_cast(sizeof(hrr_args_hipLibraryUnload)), // [518] HRR_API_HIPLIBRARYUNLOAD + static_cast(sizeof(hrr_args_hipLibraryGetKernel)), // [519] HRR_API_HIPLIBRARYGETKERNEL + static_cast(sizeof(hrr_args_hipLibraryGetKernelCount)), // [520] HRR_API_HIPLIBRARYGETKERNELCOUNT + static_cast(sizeof(hrr_args_hipLibraryGetGlobal)), // [521] HRR_API_HIPLIBRARYGETGLOBAL + static_cast(sizeof(hrr_args_hipLibraryGetManaged)), // [522] HRR_API_HIPLIBRARYGETMANAGED + static_cast(sizeof(hrr_args_hipLibraryEnumerateKernels)), // [523] HRR_API_HIPLIBRARYENUMERATEKERNELS + static_cast(sizeof(hrr_args_hipKernelGetLibrary)), // [524] HRR_API_HIPKERNELGETLIBRARY + static_cast(sizeof(hrr_args_hipKernelGetName)), // [525] HRR_API_HIPKERNELGETNAME + static_cast(sizeof(hrr_args_hipGetProcAddress_spt)), // [526] HRR_API_HIPGETPROCADDRESS_SPT + static_cast(sizeof(hrr_args_hipExtDisableLogging)), // [527] HRR_API_HIPEXTDISABLELOGGING + static_cast(sizeof(hrr_args_hipExtEnableLogging)), // [528] HRR_API_HIPEXTENABLELOGGING + static_cast(sizeof(hrr_args_hipExtSetLoggingParams)), // [529] HRR_API_HIPEXTSETLOGGINGPARAMS + static_cast(sizeof(hrr_args_hipKernelGetAttribute)), // [530] HRR_API_HIPKERNELGETATTRIBUTE + static_cast(sizeof(hrr_args_hipKernelSetAttribute)), // [531] HRR_API_HIPKERNELSETATTRIBUTE + static_cast(sizeof(hrr_args_hipKernelGetFunction)), // [532] HRR_API_HIPKERNELGETFUNCTION + static_cast(sizeof(hrr_args_hipKernelGetParamInfo)), // [533] HRR_API_HIPKERNELGETPARAMINFO + static_cast(sizeof(hrr_args_hipMemSetMemPool)), // [534] HRR_API_HIPMEMSETMEMPOOL + static_cast(sizeof(hrr_args_hipMemGetMemPool)), // [535] HRR_API_HIPMEMGETMEMPOOL + static_cast(sizeof(hrr_args_hipMipmappedArrayGetMemoryRequirements)), // [536] HRR_API_HIPMIPMAPPEDARRAYGETMEMORYREQUIREMENTS + static_cast(sizeof(hrr_args_hipGreenCtxCreate)), // [537] HRR_API_HIPGREENCTXCREATE + static_cast(sizeof(hrr_args_hipExecutionCtxDestroy)), // [538] HRR_API_HIPEXECUTIONCTXDESTROY + static_cast(sizeof(hrr_args_hipExecutionCtxStreamCreate)), // [539] HRR_API_HIPEXECUTIONCTXSTREAMCREATE + static_cast(sizeof(hrr_args_hipDeviceGetDevResource)), // [540] HRR_API_HIPDEVICEGETDEVRESOURCE + static_cast(sizeof(hrr_args_hipDevSmResourceSplitByCount)), // [541] HRR_API_HIPDEVSMRESOURCESPLITBYCOUNT + static_cast(sizeof(hrr_args_hipDevSmResourceSplit)), // [542] HRR_API_HIPDEVSMRESOURCESPLIT + static_cast(sizeof(hrr_args_hipDevResourceGenerateDesc)), // [543] HRR_API_HIPDEVRESOURCEGENERATEDESC + static_cast(sizeof(hrr_args_hipDeviceGetExecutionCtx)), // [544] HRR_API_HIPDEVICEGETEXECUTIONCTX + static_cast(sizeof(hrr_args_hipExecutionCtxGetDevResource)), // [545] HRR_API_HIPEXECUTIONCTXGETDEVRESOURCE + static_cast(sizeof(hrr_args_hipExecutionCtxGetDevice)), // [546] HRR_API_HIPEXECUTIONCTXGETDEVICE + static_cast(sizeof(hrr_args_hipExecutionCtxGetId)), // [547] HRR_API_HIPEXECUTIONCTXGETID + static_cast(sizeof(hrr_args_hipStreamGetDevResource)), // [548] HRR_API_HIPSTREAMGETDEVRESOURCE + static_cast(sizeof(hrr_args_hipExecutionCtxRecordEvent)), // [549] HRR_API_HIPEXECUTIONCTXRECORDEVENT + static_cast(sizeof(hrr_args_hipExecutionCtxSynchronize)), // [550] HRR_API_HIPEXECUTIONCTXSYNCHRONIZE + static_cast(sizeof(hrr_args_hipExecutionCtxWaitEvent)), // [551] HRR_API_HIPEXECUTIONCTXWAITEVENT + static_cast(sizeof(hrr_args_hipMemGetDefaultMemPool)), // [552] HRR_API_HIPMEMGETDEFAULTMEMPOOL }; // ============================================================ @@ -5343,498 +5376,501 @@ hrr_playback_fn_t hrr_playback_dispatch[HRR_API_COUNT] = { playback_hipDeviceGetDefaultMemPool, // [53] HRR_API_HIPDEVICEGETDEFAULTMEMPOOL playback_hipDeviceGetGraphMemAttribute, // [54] HRR_API_HIPDEVICEGETGRAPHMEMATTRIBUTE playback_hipDeviceGetLimit, // [55] HRR_API_HIPDEVICEGETLIMIT - playback_hipDeviceGetMemPool, // [56] HRR_API_HIPDEVICEGETMEMPOOL - playback_hipDeviceGetName, // [57] HRR_API_HIPDEVICEGETNAME - playback_hipDeviceGetP2PAttribute, // [58] HRR_API_HIPDEVICEGETP2PATTRIBUTE - playback_hipDeviceGetPCIBusId, // [59] HRR_API_HIPDEVICEGETPCIBUSID - playback_hipDeviceGetSharedMemConfig, // [60] HRR_API_HIPDEVICEGETSHAREDMEMCONFIG - playback_hipDeviceGetStreamPriorityRange, // [61] HRR_API_HIPDEVICEGETSTREAMPRIORITYRANGE - playback_hipDeviceGetUuid, // [62] HRR_API_HIPDEVICEGETUUID - playback_hipDeviceGraphMemTrim, // [63] HRR_API_HIPDEVICEGRAPHMEMTRIM - playback_hipDevicePrimaryCtxGetState, // [64] HRR_API_HIPDEVICEPRIMARYCTXGETSTATE - playback_hipDevicePrimaryCtxRelease, // [65] HRR_API_HIPDEVICEPRIMARYCTXRELEASE - playback_hipDevicePrimaryCtxReset, // [66] HRR_API_HIPDEVICEPRIMARYCTXRESET - playback_hipDevicePrimaryCtxRetain, // [67] HRR_API_HIPDEVICEPRIMARYCTXRETAIN - playback_hipDevicePrimaryCtxSetFlags, // [68] HRR_API_HIPDEVICEPRIMARYCTXSETFLAGS - playback_hipDeviceReset, // [69] HRR_API_HIPDEVICERESET - playback_hipDeviceSetCacheConfig, // [70] HRR_API_HIPDEVICESETCACHECONFIG - playback_hipDeviceSetGraphMemAttribute, // [71] HRR_API_HIPDEVICESETGRAPHMEMATTRIBUTE - playback_hipDeviceSetLimit, // [72] HRR_API_HIPDEVICESETLIMIT - playback_hipDeviceSetMemPool, // [73] HRR_API_HIPDEVICESETMEMPOOL - playback_hipDeviceSetSharedMemConfig, // [74] HRR_API_HIPDEVICESETSHAREDMEMCONFIG - playback_hipDeviceSynchronize, // [75] HRR_API_HIPDEVICESYNCHRONIZE - playback_hipDeviceTotalMem, // [76] HRR_API_HIPDEVICETOTALMEM - playback_hipDriverGetVersion, // [77] HRR_API_HIPDRIVERGETVERSION - playback_hipDrvGetErrorName, // [78] HRR_API_HIPDRVGETERRORNAME - playback_hipDrvGetErrorString, // [79] HRR_API_HIPDRVGETERRORSTRING - playback_hipDrvGraphAddMemcpyNode, // [80] HRR_API_HIPDRVGRAPHADDMEMCPYNODE - playback_hipDrvMemcpy2DUnaligned, // [81] HRR_API_HIPDRVMEMCPY2DUNALIGNED - playback_hipDrvMemcpy3D, // [82] HRR_API_HIPDRVMEMCPY3D - playback_hipDrvMemcpy3DAsync, // [83] HRR_API_HIPDRVMEMCPY3DASYNC - playback_hipDrvPointerGetAttributes, // [84] HRR_API_HIPDRVPOINTERGETATTRIBUTES - playback_hipEventCreate, // [85] HRR_API_HIPEVENTCREATE - playback_hipEventCreateWithFlags, // [86] HRR_API_HIPEVENTCREATEWITHFLAGS - playback_hipEventDestroy, // [87] HRR_API_HIPEVENTDESTROY - playback_hipEventElapsedTime, // [88] HRR_API_HIPEVENTELAPSEDTIME - playback_hipEventQuery, // [89] HRR_API_HIPEVENTQUERY - playback_hipEventRecord, // [90] HRR_API_HIPEVENTRECORD - playback_hipEventSynchronize, // [91] HRR_API_HIPEVENTSYNCHRONIZE - playback_hipExtGetLinkTypeAndHopCount, // [92] HRR_API_HIPEXTGETLINKTYPEANDHOPCOUNT - playback_hipExtLaunchKernel, // [93] HRR_API_HIPEXTLAUNCHKERNEL - playback_hipExtLaunchMultiKernelMultiDevice, // [94] HRR_API_HIPEXTLAUNCHMULTIKERNELMULTIDEVICE - playback_hipExtMallocWithFlags, // [95] HRR_API_HIPEXTMALLOCWITHFLAGS - playback_hipExtStreamCreateWithCUMask, // [96] HRR_API_HIPEXTSTREAMCREATEWITHCUMASK - playback_hipExtStreamGetCUMask, // [97] HRR_API_HIPEXTSTREAMGETCUMASK - playback_hipExternalMemoryGetMappedBuffer, // [98] HRR_API_HIPEXTERNALMEMORYGETMAPPEDBUFFER - playback_hipFree, // [99] HRR_API_HIPFREE - playback_hipFreeArray, // [100] HRR_API_HIPFREEARRAY - playback_hipFreeAsync, // [101] HRR_API_HIPFREEASYNC - playback_hipFreeHost, // [102] HRR_API_HIPFREEHOST - playback_hipFreeMipmappedArray, // [103] HRR_API_HIPFREEMIPMAPPEDARRAY - playback_hipFuncGetAttribute, // [104] HRR_API_HIPFUNCGETATTRIBUTE - playback_hipFuncGetAttributes, // [105] HRR_API_HIPFUNCGETATTRIBUTES - playback_hipFuncSetAttribute, // [106] HRR_API_HIPFUNCSETATTRIBUTE - playback_hipFuncSetCacheConfig, // [107] HRR_API_HIPFUNCSETCACHECONFIG - playback_hipFuncSetSharedMemConfig, // [108] HRR_API_HIPFUNCSETSHAREDMEMCONFIG - playback_hipGLGetDevices, // [109] HRR_API_HIPGLGETDEVICES - playback_hipGetChannelDesc, // [110] HRR_API_HIPGETCHANNELDESC - playback_hipGetDevice, // [111] HRR_API_HIPGETDEVICE - playback_hipGetDeviceCount, // [112] HRR_API_HIPGETDEVICECOUNT - playback_hipGetDeviceFlags, // [113] HRR_API_HIPGETDEVICEFLAGS - playback_hipGetDevicePropertiesR0600, // [114] HRR_API_HIPGETDEVICEPROPERTIESR0600 - playback_hipGetDevicePropertiesR0000, // [115] HRR_API_HIPGETDEVICEPROPERTIESR0000 - playback_hipGetErrorName, // [116] HRR_API_HIPGETERRORNAME - playback_hipGetErrorString, // [117] HRR_API_HIPGETERRORSTRING - playback_hipGetLastError, // [118] HRR_API_HIPGETLASTERROR - playback_hipGetMipmappedArrayLevel, // [119] HRR_API_HIPGETMIPMAPPEDARRAYLEVEL - playback_hipGetSymbolAddress, // [120] HRR_API_HIPGETSYMBOLADDRESS - playback_hipGetSymbolSize, // [121] HRR_API_HIPGETSYMBOLSIZE - playback_hipGetTextureAlignmentOffset, // [122] HRR_API_HIPGETTEXTUREALIGNMENTOFFSET - playback_hipGetTextureObjectResourceDesc, // [123] HRR_API_HIPGETTEXTUREOBJECTRESOURCEDESC - playback_hipGetTextureObjectResourceViewDesc, // [124] HRR_API_HIPGETTEXTUREOBJECTRESOURCEVIEWDESC - playback_hipGetTextureObjectTextureDesc, // [125] HRR_API_HIPGETTEXTUREOBJECTTEXTUREDESC - playback_hipGetTextureReference, // [126] HRR_API_HIPGETTEXTUREREFERENCE - playback_hipGraphAddChildGraphNode, // [127] HRR_API_HIPGRAPHADDCHILDGRAPHNODE - playback_hipGraphAddDependencies, // [128] HRR_API_HIPGRAPHADDDEPENDENCIES - playback_hipGraphAddEmptyNode, // [129] HRR_API_HIPGRAPHADDEMPTYNODE - playback_hipGraphAddEventRecordNode, // [130] HRR_API_HIPGRAPHADDEVENTRECORDNODE - playback_hipGraphAddEventWaitNode, // [131] HRR_API_HIPGRAPHADDEVENTWAITNODE - playback_hipGraphAddHostNode, // [132] HRR_API_HIPGRAPHADDHOSTNODE - playback_hipGraphAddKernelNode, // [133] HRR_API_HIPGRAPHADDKERNELNODE - playback_hipGraphAddMemAllocNode, // [134] HRR_API_HIPGRAPHADDMEMALLOCNODE - playback_hipGraphAddMemFreeNode, // [135] HRR_API_HIPGRAPHADDMEMFREENODE - playback_hipGraphAddMemcpyNode, // [136] HRR_API_HIPGRAPHADDMEMCPYNODE - playback_hipGraphAddMemcpyNode1D, // [137] HRR_API_HIPGRAPHADDMEMCPYNODE1D - playback_hipGraphAddMemcpyNodeFromSymbol, // [138] HRR_API_HIPGRAPHADDMEMCPYNODEFROMSYMBOL - playback_hipGraphAddMemcpyNodeToSymbol, // [139] HRR_API_HIPGRAPHADDMEMCPYNODETOSYMBOL - playback_hipGraphAddMemsetNode, // [140] HRR_API_HIPGRAPHADDMEMSETNODE - playback_hipGraphChildGraphNodeGetGraph, // [141] HRR_API_HIPGRAPHCHILDGRAPHNODEGETGRAPH - playback_hipGraphClone, // [142] HRR_API_HIPGRAPHCLONE - playback_hipGraphCreate, // [143] HRR_API_HIPGRAPHCREATE - playback_hipGraphDebugDotPrint, // [144] HRR_API_HIPGRAPHDEBUGDOTPRINT - playback_hipGraphDestroy, // [145] HRR_API_HIPGRAPHDESTROY - playback_hipGraphDestroyNode, // [146] HRR_API_HIPGRAPHDESTROYNODE - playback_hipGraphEventRecordNodeGetEvent, // [147] HRR_API_HIPGRAPHEVENTRECORDNODEGETEVENT - playback_hipGraphEventRecordNodeSetEvent, // [148] HRR_API_HIPGRAPHEVENTRECORDNODESETEVENT - playback_hipGraphEventWaitNodeGetEvent, // [149] HRR_API_HIPGRAPHEVENTWAITNODEGETEVENT - playback_hipGraphEventWaitNodeSetEvent, // [150] HRR_API_HIPGRAPHEVENTWAITNODESETEVENT - playback_hipGraphExecChildGraphNodeSetParams, // [151] HRR_API_HIPGRAPHEXECCHILDGRAPHNODESETPARAMS - playback_hipGraphExecDestroy, // [152] HRR_API_HIPGRAPHEXECDESTROY - playback_hipGraphExecEventRecordNodeSetEvent, // [153] HRR_API_HIPGRAPHEXECEVENTRECORDNODESETEVENT - playback_hipGraphExecEventWaitNodeSetEvent, // [154] HRR_API_HIPGRAPHEXECEVENTWAITNODESETEVENT - playback_hipGraphExecHostNodeSetParams, // [155] HRR_API_HIPGRAPHEXECHOSTNODESETPARAMS - playback_hipGraphExecKernelNodeSetParams, // [156] HRR_API_HIPGRAPHEXECKERNELNODESETPARAMS - playback_hipGraphExecMemcpyNodeSetParams, // [157] HRR_API_HIPGRAPHEXECMEMCPYNODESETPARAMS - playback_hipGraphExecMemcpyNodeSetParams1D, // [158] HRR_API_HIPGRAPHEXECMEMCPYNODESETPARAMS1D - playback_hipGraphExecMemcpyNodeSetParamsFromSymbol, // [159] HRR_API_HIPGRAPHEXECMEMCPYNODESETPARAMSFROMSYMBOL - playback_hipGraphExecMemcpyNodeSetParamsToSymbol, // [160] HRR_API_HIPGRAPHEXECMEMCPYNODESETPARAMSTOSYMBOL - playback_hipGraphExecMemsetNodeSetParams, // [161] HRR_API_HIPGRAPHEXECMEMSETNODESETPARAMS - playback_hipGraphExecUpdate, // [162] HRR_API_HIPGRAPHEXECUPDATE - playback_hipGraphGetEdges, // [163] HRR_API_HIPGRAPHGETEDGES - playback_hipGraphGetNodes, // [164] HRR_API_HIPGRAPHGETNODES - playback_hipGraphGetRootNodes, // [165] HRR_API_HIPGRAPHGETROOTNODES - playback_hipGraphHostNodeGetParams, // [166] HRR_API_HIPGRAPHHOSTNODEGETPARAMS - playback_hipGraphHostNodeSetParams, // [167] HRR_API_HIPGRAPHHOSTNODESETPARAMS - playback_hipGraphInstantiate, // [168] HRR_API_HIPGRAPHINSTANTIATE - playback_hipGraphInstantiateWithFlags, // [169] HRR_API_HIPGRAPHINSTANTIATEWITHFLAGS - playback_hipGraphKernelNodeCopyAttributes, // [170] HRR_API_HIPGRAPHKERNELNODECOPYATTRIBUTES - playback_hipGraphKernelNodeGetAttribute, // [171] HRR_API_HIPGRAPHKERNELNODEGETATTRIBUTE - playback_hipGraphKernelNodeGetParams, // [172] HRR_API_HIPGRAPHKERNELNODEGETPARAMS - playback_hipGraphKernelNodeSetAttribute, // [173] HRR_API_HIPGRAPHKERNELNODESETATTRIBUTE - playback_hipGraphKernelNodeSetParams, // [174] HRR_API_HIPGRAPHKERNELNODESETPARAMS - playback_hipGraphLaunch, // [175] HRR_API_HIPGRAPHLAUNCH - playback_hipGraphMemAllocNodeGetParams, // [176] HRR_API_HIPGRAPHMEMALLOCNODEGETPARAMS - playback_hipGraphMemFreeNodeGetParams, // [177] HRR_API_HIPGRAPHMEMFREENODEGETPARAMS - playback_hipGraphMemcpyNodeGetParams, // [178] HRR_API_HIPGRAPHMEMCPYNODEGETPARAMS - playback_hipGraphMemcpyNodeSetParams, // [179] HRR_API_HIPGRAPHMEMCPYNODESETPARAMS - playback_hipGraphMemcpyNodeSetParams1D, // [180] HRR_API_HIPGRAPHMEMCPYNODESETPARAMS1D - playback_hipGraphMemcpyNodeSetParamsFromSymbol, // [181] HRR_API_HIPGRAPHMEMCPYNODESETPARAMSFROMSYMBOL - playback_hipGraphMemcpyNodeSetParamsToSymbol, // [182] HRR_API_HIPGRAPHMEMCPYNODESETPARAMSTOSYMBOL - playback_hipGraphMemsetNodeGetParams, // [183] HRR_API_HIPGRAPHMEMSETNODEGETPARAMS - playback_hipGraphMemsetNodeSetParams, // [184] HRR_API_HIPGRAPHMEMSETNODESETPARAMS - playback_hipGraphNodeFindInClone, // [185] HRR_API_HIPGRAPHNODEFINDINCLONE - playback_hipGraphNodeGetDependencies, // [186] HRR_API_HIPGRAPHNODEGETDEPENDENCIES - playback_hipGraphNodeGetDependentNodes, // [187] HRR_API_HIPGRAPHNODEGETDEPENDENTNODES - playback_hipGraphNodeGetEnabled, // [188] HRR_API_HIPGRAPHNODEGETENABLED - playback_hipGraphNodeGetType, // [189] HRR_API_HIPGRAPHNODEGETTYPE - playback_hipGraphNodeSetEnabled, // [190] HRR_API_HIPGRAPHNODESETENABLED - playback_hipGraphReleaseUserObject, // [191] HRR_API_HIPGRAPHRELEASEUSEROBJECT - playback_hipGraphRemoveDependencies, // [192] HRR_API_HIPGRAPHREMOVEDEPENDENCIES - playback_hipGraphRetainUserObject, // [193] HRR_API_HIPGRAPHRETAINUSEROBJECT - playback_hipGraphUpload, // [194] HRR_API_HIPGRAPHUPLOAD - playback_hipGraphicsGLRegisterBuffer, // [195] HRR_API_HIPGRAPHICSGLREGISTERBUFFER - playback_hipGraphicsGLRegisterImage, // [196] HRR_API_HIPGRAPHICSGLREGISTERIMAGE - playback_hipGraphicsMapResources, // [197] HRR_API_HIPGRAPHICSMAPRESOURCES - playback_hipGraphicsResourceGetMappedPointer, // [198] HRR_API_HIPGRAPHICSRESOURCEGETMAPPEDPOINTER - playback_hipGraphicsSubResourceGetMappedArray, // [199] HRR_API_HIPGRAPHICSSUBRESOURCEGETMAPPEDARRAY - playback_hipGraphicsUnmapResources, // [200] HRR_API_HIPGRAPHICSUNMAPRESOURCES - playback_hipGraphicsUnregisterResource, // [201] HRR_API_HIPGRAPHICSUNREGISTERRESOURCE - playback_hipHostAlloc, // [202] HRR_API_HIPHOSTALLOC - playback_hipHostFree, // [203] HRR_API_HIPHOSTFREE - playback_hipHostGetDevicePointer, // [204] HRR_API_HIPHOSTGETDEVICEPOINTER - playback_hipHostGetFlags, // [205] HRR_API_HIPHOSTGETFLAGS - playback_hipHostMalloc, // [206] HRR_API_HIPHOSTMALLOC - playback_hipHostRegister, // [207] HRR_API_HIPHOSTREGISTER - playback_hipHostUnregister, // [208] HRR_API_HIPHOSTUNREGISTER - playback_hipImportExternalMemory, // [209] HRR_API_HIPIMPORTEXTERNALMEMORY - playback_hipImportExternalSemaphore, // [210] HRR_API_HIPIMPORTEXTERNALSEMAPHORE - playback_hipInit, // [211] HRR_API_HIPINIT - playback_hipIpcCloseMemHandle, // [212] HRR_API_HIPIPCCLOSEMEMHANDLE - playback_hipIpcGetEventHandle, // [213] HRR_API_HIPIPCGETEVENTHANDLE - playback_hipIpcGetMemHandle, // [214] HRR_API_HIPIPCGETMEMHANDLE - playback_hipIpcOpenEventHandle, // [215] HRR_API_HIPIPCOPENEVENTHANDLE - playback_hipIpcOpenMemHandle, // [216] HRR_API_HIPIPCOPENMEMHANDLE - playback_hipKernelNameRef, // [217] HRR_API_HIPKERNELNAMEREF - playback_hipKernelNameRefByPtr, // [218] HRR_API_HIPKERNELNAMEREFBYPTR - playback_hipLaunchByPtr, // [219] HRR_API_HIPLAUNCHBYPTR - playback_hipLaunchCooperativeKernel, // [220] HRR_API_HIPLAUNCHCOOPERATIVEKERNEL - playback_hipLaunchCooperativeKernelMultiDevice, // [221] HRR_API_HIPLAUNCHCOOPERATIVEKERNELMULTIDEVICE - playback_hipLaunchHostFunc, // [222] HRR_API_HIPLAUNCHHOSTFUNC - playback_hipLaunchKernel, // [223] HRR_API_HIPLAUNCHKERNEL - playback_hipMalloc, // [224] HRR_API_HIPMALLOC - playback_hipMalloc3D, // [225] HRR_API_HIPMALLOC3D - playback_hipMalloc3DArray, // [226] HRR_API_HIPMALLOC3DARRAY - playback_hipMallocArray, // [227] HRR_API_HIPMALLOCARRAY - playback_hipMallocAsync, // [228] HRR_API_HIPMALLOCASYNC - playback_hipMallocFromPoolAsync, // [229] HRR_API_HIPMALLOCFROMPOOLASYNC - playback_hipMallocHost, // [230] HRR_API_HIPMALLOCHOST - playback_hipMallocManaged, // [231] HRR_API_HIPMALLOCMANAGED - playback_hipMallocMipmappedArray, // [232] HRR_API_HIPMALLOCMIPMAPPEDARRAY - playback_hipMallocPitch, // [233] HRR_API_HIPMALLOCPITCH - playback_hipMemAddressFree, // [234] HRR_API_HIPMEMADDRESSFREE - playback_hipMemAddressReserve, // [235] HRR_API_HIPMEMADDRESSRESERVE - playback_hipMemAdvise, // [236] HRR_API_HIPMEMADVISE - playback_hipMemAdvise_v2, // [237] HRR_API_HIPMEMADVISE_V2 - playback_hipMemAllocHost, // [238] HRR_API_HIPMEMALLOCHOST - playback_hipMemAllocPitch, // [239] HRR_API_HIPMEMALLOCPITCH - playback_hipMemCreate, // [240] HRR_API_HIPMEMCREATE - playback_hipMemExportToShareableHandle, // [241] HRR_API_HIPMEMEXPORTTOSHAREABLEHANDLE - playback_hipMemGetAccess, // [242] HRR_API_HIPMEMGETACCESS - playback_hipMemGetAddressRange, // [243] HRR_API_HIPMEMGETADDRESSRANGE - playback_hipMemGetAllocationGranularity, // [244] HRR_API_HIPMEMGETALLOCATIONGRANULARITY - playback_hipMemGetAllocationPropertiesFromHandle, // [245] HRR_API_HIPMEMGETALLOCATIONPROPERTIESFROMHANDLE - playback_hipMemGetInfo, // [246] HRR_API_HIPMEMGETINFO - playback_hipMemImportFromShareableHandle, // [247] HRR_API_HIPMEMIMPORTFROMSHAREABLEHANDLE - playback_hipMemMap, // [248] HRR_API_HIPMEMMAP - playback_hipMemMapArrayAsync, // [249] HRR_API_HIPMEMMAPARRAYASYNC - playback_hipMemPoolCreate, // [250] HRR_API_HIPMEMPOOLCREATE - playback_hipMemPoolDestroy, // [251] HRR_API_HIPMEMPOOLDESTROY - playback_hipMemPoolExportPointer, // [252] HRR_API_HIPMEMPOOLEXPORTPOINTER - playback_hipMemPoolExportToShareableHandle, // [253] HRR_API_HIPMEMPOOLEXPORTTOSHAREABLEHANDLE - playback_hipMemPoolGetAccess, // [254] HRR_API_HIPMEMPOOLGETACCESS - playback_hipMemPoolGetAttribute, // [255] HRR_API_HIPMEMPOOLGETATTRIBUTE - playback_hipMemPoolImportFromShareableHandle, // [256] HRR_API_HIPMEMPOOLIMPORTFROMSHAREABLEHANDLE - playback_hipMemPoolImportPointer, // [257] HRR_API_HIPMEMPOOLIMPORTPOINTER - playback_hipMemPoolSetAccess, // [258] HRR_API_HIPMEMPOOLSETACCESS - playback_hipMemPoolSetAttribute, // [259] HRR_API_HIPMEMPOOLSETATTRIBUTE - playback_hipMemPoolTrimTo, // [260] HRR_API_HIPMEMPOOLTRIMTO - playback_hipMemPrefetchAsync, // [261] HRR_API_HIPMEMPREFETCHASYNC - playback_hipMemPrefetchAsync_v2, // [262] HRR_API_HIPMEMPREFETCHASYNC_V2 - playback_hipMemPrefetchBatchAsync, // [263] HRR_API_HIPMEMPREFETCHBATCHASYNC - playback_hipMemDiscardBatchAsync, // [264] HRR_API_HIPMEMDISCARDBATCHASYNC - playback_hipDrvMemDiscardBatchAsync, // [265] HRR_API_HIPDRVMEMDISCARDBATCHASYNC - playback_hipMemDiscardAndPrefetchBatchAsync, // [266] HRR_API_HIPMEMDISCARDANDPREFETCHBATCHASYNC - playback_hipDrvMemDiscardAndPrefetchBatchAsync, // [267] HRR_API_HIPDRVMEMDISCARDANDPREFETCHBATCHASYNC - playback_hipMemPtrGetInfo, // [268] HRR_API_HIPMEMPTRGETINFO - playback_hipMemRangeGetAttribute, // [269] HRR_API_HIPMEMRANGEGETATTRIBUTE - playback_hipMemRangeGetAttributes, // [270] HRR_API_HIPMEMRANGEGETATTRIBUTES - playback_hipMemRelease, // [271] HRR_API_HIPMEMRELEASE - playback_hipMemRetainAllocationHandle, // [272] HRR_API_HIPMEMRETAINALLOCATIONHANDLE - playback_hipMemSetAccess, // [273] HRR_API_HIPMEMSETACCESS - playback_hipMemUnmap, // [274] HRR_API_HIPMEMUNMAP - playback_hipMemcpy, // [275] HRR_API_HIPMEMCPY - playback_hipMemcpy2D, // [276] HRR_API_HIPMEMCPY2D - playback_hipMemcpy2DAsync, // [277] HRR_API_HIPMEMCPY2DASYNC - playback_hipMemcpy2DFromArray, // [278] HRR_API_HIPMEMCPY2DFROMARRAY - playback_hipMemcpy2DFromArrayAsync, // [279] HRR_API_HIPMEMCPY2DFROMARRAYASYNC - playback_hipMemcpy2DToArray, // [280] HRR_API_HIPMEMCPY2DTOARRAY - playback_hipMemcpy2DToArrayAsync, // [281] HRR_API_HIPMEMCPY2DTOARRAYASYNC - playback_hipMemcpy3D, // [282] HRR_API_HIPMEMCPY3D - playback_hipMemcpy3DAsync, // [283] HRR_API_HIPMEMCPY3DASYNC - playback_hipMemcpyAsync, // [284] HRR_API_HIPMEMCPYASYNC - playback_hipMemcpyAtoH, // [285] HRR_API_HIPMEMCPYATOH - playback_hipMemcpyDtoD, // [286] HRR_API_HIPMEMCPYDTOD - playback_hipMemcpyDtoDAsync, // [287] HRR_API_HIPMEMCPYDTODASYNC - playback_hipMemcpyDtoH, // [288] HRR_API_HIPMEMCPYDTOH - playback_hipMemcpyDtoHAsync, // [289] HRR_API_HIPMEMCPYDTOHASYNC - playback_hipMemcpyFromArray, // [290] HRR_API_HIPMEMCPYFROMARRAY - playback_hipMemcpyFromSymbol, // [291] HRR_API_HIPMEMCPYFROMSYMBOL - playback_hipMemcpyFromSymbolAsync, // [292] HRR_API_HIPMEMCPYFROMSYMBOLASYNC - playback_hipMemcpyHtoA, // [293] HRR_API_HIPMEMCPYHTOA - playback_hipMemcpyHtoD, // [294] HRR_API_HIPMEMCPYHTOD - playback_hipMemcpyHtoDAsync, // [295] HRR_API_HIPMEMCPYHTODASYNC - playback_hipMemcpyParam2D, // [296] HRR_API_HIPMEMCPYPARAM2D - playback_hipMemcpyParam2DAsync, // [297] HRR_API_HIPMEMCPYPARAM2DASYNC - playback_hipMemcpyPeer, // [298] HRR_API_HIPMEMCPYPEER - playback_hipMemcpyPeerAsync, // [299] HRR_API_HIPMEMCPYPEERASYNC - playback_hipMemcpyToArray, // [300] HRR_API_HIPMEMCPYTOARRAY - playback_hipMemcpyToSymbol, // [301] HRR_API_HIPMEMCPYTOSYMBOL - playback_hipMemcpyToSymbolAsync, // [302] HRR_API_HIPMEMCPYTOSYMBOLASYNC - playback_hipMemcpyWithStream, // [303] HRR_API_HIPMEMCPYWITHSTREAM - playback_hipMemset, // [304] HRR_API_HIPMEMSET - playback_hipMemset2D, // [305] HRR_API_HIPMEMSET2D - playback_hipMemset2DAsync, // [306] HRR_API_HIPMEMSET2DASYNC - playback_hipMemset3D, // [307] HRR_API_HIPMEMSET3D - playback_hipMemset3DAsync, // [308] HRR_API_HIPMEMSET3DASYNC - playback_hipMemsetAsync, // [309] HRR_API_HIPMEMSETASYNC - playback_hipMemsetD16, // [310] HRR_API_HIPMEMSETD16 - playback_hipMemsetD16Async, // [311] HRR_API_HIPMEMSETD16ASYNC - playback_hipMemsetD32, // [312] HRR_API_HIPMEMSETD32 - playback_hipMemsetD32Async, // [313] HRR_API_HIPMEMSETD32ASYNC - playback_hipMemsetD8, // [314] HRR_API_HIPMEMSETD8 - playback_hipMemsetD8Async, // [315] HRR_API_HIPMEMSETD8ASYNC - playback_hipMipmappedArrayCreate, // [316] HRR_API_HIPMIPMAPPEDARRAYCREATE - playback_hipMipmappedArrayDestroy, // [317] HRR_API_HIPMIPMAPPEDARRAYDESTROY - playback_hipMipmappedArrayGetLevel, // [318] HRR_API_HIPMIPMAPPEDARRAYGETLEVEL - playback_hipModuleGetFunction, // [319] HRR_API_HIPMODULEGETFUNCTION - playback_hipModuleGetFunctionCount, // [320] HRR_API_HIPMODULEGETFUNCTIONCOUNT - playback_hipModuleGetGlobal, // [321] HRR_API_HIPMODULEGETGLOBAL - playback_hipModuleGetTexRef, // [322] HRR_API_HIPMODULEGETTEXREF - playback_hipModuleLaunchCooperativeKernel, // [323] HRR_API_HIPMODULELAUNCHCOOPERATIVEKERNEL - playback_hipModuleLaunchCooperativeKernelMultiDevice, // [324] HRR_API_HIPMODULELAUNCHCOOPERATIVEKERNELMULTIDEVICE - playback_hipModuleLaunchKernel, // [325] HRR_API_HIPMODULELAUNCHKERNEL - playback_hipModuleLoad, // [326] HRR_API_HIPMODULELOAD - playback_hipModuleLoadData, // [327] HRR_API_HIPMODULELOADDATA - playback_hipModuleLoadDataEx, // [328] HRR_API_HIPMODULELOADDATAEX - playback_hipLinkAddData, // [329] HRR_API_HIPLINKADDDATA - playback_hipLinkAddFile, // [330] HRR_API_HIPLINKADDFILE - playback_hipLinkComplete, // [331] HRR_API_HIPLINKCOMPLETE - playback_hipLinkCreate, // [332] HRR_API_HIPLINKCREATE - playback_hipLinkDestroy, // [333] HRR_API_HIPLINKDESTROY - playback_hipModuleOccupancyMaxActiveBlocksPerMultiprocessor, // [334] HRR_API_HIPMODULEOCCUPANCYMAXACTIVEBLOCKSPERMULTIPROCESSOR - playback_hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags, // [335] HRR_API_HIPMODULEOCCUPANCYMAXACTIVEBLOCKSPERMULTIPROCESSORWITHFLAGS - playback_hipModuleOccupancyMaxPotentialBlockSize, // [336] HRR_API_HIPMODULEOCCUPANCYMAXPOTENTIALBLOCKSIZE - playback_hipModuleOccupancyMaxPotentialBlockSizeWithFlags, // [337] HRR_API_HIPMODULEOCCUPANCYMAXPOTENTIALBLOCKSIZEWITHFLAGS - playback_hipModuleUnload, // [338] HRR_API_HIPMODULEUNLOAD - playback_hipOccupancyAvailableDynamicSMemPerBlock, // [339] HRR_API_HIPOCCUPANCYAVAILABLEDYNAMICSMEMPERBLOCK - playback_hipOccupancyMaxActiveBlocksPerMultiprocessor, // [340] HRR_API_HIPOCCUPANCYMAXACTIVEBLOCKSPERMULTIPROCESSOR - playback_hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags, // [341] HRR_API_HIPOCCUPANCYMAXACTIVEBLOCKSPERMULTIPROCESSORWITHFLAGS - playback_hipOccupancyMaxPotentialBlockSize, // [342] HRR_API_HIPOCCUPANCYMAXPOTENTIALBLOCKSIZE - playback_hipOccupancyMaxActiveClusters, // [343] HRR_API_HIPOCCUPANCYMAXACTIVECLUSTERS - playback_hipOccupancyMaxPotentialClusterSize, // [344] HRR_API_HIPOCCUPANCYMAXPOTENTIALCLUSTERSIZE - playback_hipPeekAtLastError, // [345] HRR_API_HIPPEEKATLASTERROR - playback_hipPointerGetAttribute, // [346] HRR_API_HIPPOINTERGETATTRIBUTE - playback_hipPointerGetAttributes, // [347] HRR_API_HIPPOINTERGETATTRIBUTES - playback_hipPointerSetAttribute, // [348] HRR_API_HIPPOINTERSETATTRIBUTE - playback_hipProfilerStart, // [349] HRR_API_HIPPROFILERSTART - playback_hipProfilerStop, // [350] HRR_API_HIPPROFILERSTOP - playback_hipRuntimeGetVersion, // [351] HRR_API_HIPRUNTIMEGETVERSION - playback_hipSetDevice, // [352] HRR_API_HIPSETDEVICE - playback_hipSetDeviceFlags, // [353] HRR_API_HIPSETDEVICEFLAGS - playback_hipSetupArgument, // [354] HRR_API_HIPSETUPARGUMENT - playback_hipSignalExternalSemaphoresAsync, // [355] HRR_API_HIPSIGNALEXTERNALSEMAPHORESASYNC - playback_hipStreamAddCallback, // [356] HRR_API_HIPSTREAMADDCALLBACK - playback_hipStreamAttachMemAsync, // [357] HRR_API_HIPSTREAMATTACHMEMASYNC - playback_hipStreamBeginCapture, // [358] HRR_API_HIPSTREAMBEGINCAPTURE - playback_hipStreamCopyAttributes, // [359] HRR_API_HIPSTREAMCOPYATTRIBUTES - playback_hipStreamCreate, // [360] HRR_API_HIPSTREAMCREATE - playback_hipStreamCreateWithFlags, // [361] HRR_API_HIPSTREAMCREATEWITHFLAGS - playback_hipStreamCreateWithPriority, // [362] HRR_API_HIPSTREAMCREATEWITHPRIORITY - playback_hipStreamDestroy, // [363] HRR_API_HIPSTREAMDESTROY - playback_hipStreamEndCapture, // [364] HRR_API_HIPSTREAMENDCAPTURE - playback_hipStreamGetCaptureInfo, // [365] HRR_API_HIPSTREAMGETCAPTUREINFO - playback_hipStreamGetCaptureInfo_v2, // [366] HRR_API_HIPSTREAMGETCAPTUREINFO_V2 - playback_hipStreamGetDevice, // [367] HRR_API_HIPSTREAMGETDEVICE - playback_hipStreamGetFlags, // [368] HRR_API_HIPSTREAMGETFLAGS - playback_hipStreamGetId, // [369] HRR_API_HIPSTREAMGETID - playback_hipStreamGetPriority, // [370] HRR_API_HIPSTREAMGETPRIORITY - playback_hipStreamIsCapturing, // [371] HRR_API_HIPSTREAMISCAPTURING - playback_hipStreamQuery, // [372] HRR_API_HIPSTREAMQUERY - playback_hipStreamSynchronize, // [373] HRR_API_HIPSTREAMSYNCHRONIZE - playback_hipStreamUpdateCaptureDependencies, // [374] HRR_API_HIPSTREAMUPDATECAPTUREDEPENDENCIES - playback_hipStreamWaitEvent, // [375] HRR_API_HIPSTREAMWAITEVENT - playback_hipStreamWaitValue32, // [376] HRR_API_HIPSTREAMWAITVALUE32 - playback_hipStreamWaitValue64, // [377] HRR_API_HIPSTREAMWAITVALUE64 - playback_hipStreamWriteValue32, // [378] HRR_API_HIPSTREAMWRITEVALUE32 - playback_hipStreamWriteValue64, // [379] HRR_API_HIPSTREAMWRITEVALUE64 - playback_hipStreamBatchMemOp, // [380] HRR_API_HIPSTREAMBATCHMEMOP - playback_hipTexObjectCreate, // [381] HRR_API_HIPTEXOBJECTCREATE - playback_hipTexObjectDestroy, // [382] HRR_API_HIPTEXOBJECTDESTROY - playback_hipTexObjectGetResourceDesc, // [383] HRR_API_HIPTEXOBJECTGETRESOURCEDESC - playback_hipTexObjectGetResourceViewDesc, // [384] HRR_API_HIPTEXOBJECTGETRESOURCEVIEWDESC - playback_hipTexObjectGetTextureDesc, // [385] HRR_API_HIPTEXOBJECTGETTEXTUREDESC - playback_hipTexRefGetAddress, // [386] HRR_API_HIPTEXREFGETADDRESS - playback_hipTexRefGetAddressMode, // [387] HRR_API_HIPTEXREFGETADDRESSMODE - playback_hipTexRefGetFilterMode, // [388] HRR_API_HIPTEXREFGETFILTERMODE - playback_hipTexRefGetFlags, // [389] HRR_API_HIPTEXREFGETFLAGS - playback_hipTexRefGetFormat, // [390] HRR_API_HIPTEXREFGETFORMAT - playback_hipTexRefGetMaxAnisotropy, // [391] HRR_API_HIPTEXREFGETMAXANISOTROPY - playback_hipTexRefGetMipMappedArray, // [392] HRR_API_HIPTEXREFGETMIPMAPPEDARRAY - playback_hipTexRefGetMipmapFilterMode, // [393] HRR_API_HIPTEXREFGETMIPMAPFILTERMODE - playback_hipTexRefGetMipmapLevelBias, // [394] HRR_API_HIPTEXREFGETMIPMAPLEVELBIAS - playback_hipTexRefGetMipmapLevelClamp, // [395] HRR_API_HIPTEXREFGETMIPMAPLEVELCLAMP - playback_hipTexRefSetAddress, // [396] HRR_API_HIPTEXREFSETADDRESS - playback_hipTexRefSetAddress2D, // [397] HRR_API_HIPTEXREFSETADDRESS2D - playback_hipTexRefSetAddressMode, // [398] HRR_API_HIPTEXREFSETADDRESSMODE - playback_hipTexRefSetArray, // [399] HRR_API_HIPTEXREFSETARRAY - playback_hipTexRefSetBorderColor, // [400] HRR_API_HIPTEXREFSETBORDERCOLOR - playback_hipTexRefSetFilterMode, // [401] HRR_API_HIPTEXREFSETFILTERMODE - playback_hipTexRefSetFlags, // [402] HRR_API_HIPTEXREFSETFLAGS - playback_hipTexRefSetFormat, // [403] HRR_API_HIPTEXREFSETFORMAT - playback_hipTexRefSetMaxAnisotropy, // [404] HRR_API_HIPTEXREFSETMAXANISOTROPY - playback_hipTexRefSetMipmapFilterMode, // [405] HRR_API_HIPTEXREFSETMIPMAPFILTERMODE - playback_hipTexRefSetMipmapLevelBias, // [406] HRR_API_HIPTEXREFSETMIPMAPLEVELBIAS - playback_hipTexRefSetMipmapLevelClamp, // [407] HRR_API_HIPTEXREFSETMIPMAPLEVELCLAMP - playback_hipTexRefSetMipmappedArray, // [408] HRR_API_HIPTEXREFSETMIPMAPPEDARRAY - playback_hipThreadExchangeStreamCaptureMode, // [409] HRR_API_HIPTHREADEXCHANGESTREAMCAPTUREMODE - playback_hipUnbindTexture, // [410] HRR_API_HIPUNBINDTEXTURE - playback_hipUserObjectCreate, // [411] HRR_API_HIPUSEROBJECTCREATE - playback_hipUserObjectRelease, // [412] HRR_API_HIPUSEROBJECTRELEASE - playback_hipUserObjectRetain, // [413] HRR_API_HIPUSEROBJECTRETAIN - playback_hipWaitExternalSemaphoresAsync, // [414] HRR_API_HIPWAITEXTERNALSEMAPHORESASYNC - playback_hipMemcpy_spt, // [415] HRR_API_HIPMEMCPY_SPT - playback_hipMemcpyToSymbol_spt, // [416] HRR_API_HIPMEMCPYTOSYMBOL_SPT - playback_hipMemcpyFromSymbol_spt, // [417] HRR_API_HIPMEMCPYFROMSYMBOL_SPT - playback_hipMemcpy2D_spt, // [418] HRR_API_HIPMEMCPY2D_SPT - playback_hipMemcpy2DFromArray_spt, // [419] HRR_API_HIPMEMCPY2DFROMARRAY_SPT - playback_hipMemcpy3D_spt, // [420] HRR_API_HIPMEMCPY3D_SPT - playback_hipMemset_spt, // [421] HRR_API_HIPMEMSET_SPT - playback_hipMemsetAsync_spt, // [422] HRR_API_HIPMEMSETASYNC_SPT - playback_hipMemset2D_spt, // [423] HRR_API_HIPMEMSET2D_SPT - playback_hipMemset2DAsync_spt, // [424] HRR_API_HIPMEMSET2DASYNC_SPT - playback_hipMemset3DAsync_spt, // [425] HRR_API_HIPMEMSET3DASYNC_SPT - playback_hipMemset3D_spt, // [426] HRR_API_HIPMEMSET3D_SPT - playback_hipMemcpyAsync_spt, // [427] HRR_API_HIPMEMCPYASYNC_SPT - playback_hipMemcpy3DAsync_spt, // [428] HRR_API_HIPMEMCPY3DASYNC_SPT - playback_hipMemcpy2DAsync_spt, // [429] HRR_API_HIPMEMCPY2DASYNC_SPT - playback_hipMemcpyFromSymbolAsync_spt, // [430] HRR_API_HIPMEMCPYFROMSYMBOLASYNC_SPT - playback_hipMemcpyToSymbolAsync_spt, // [431] HRR_API_HIPMEMCPYTOSYMBOLASYNC_SPT - playback_hipMemcpyFromArray_spt, // [432] HRR_API_HIPMEMCPYFROMARRAY_SPT - playback_hipMemcpy2DToArray_spt, // [433] HRR_API_HIPMEMCPY2DTOARRAY_SPT - playback_hipMemcpy2DFromArrayAsync_spt, // [434] HRR_API_HIPMEMCPY2DFROMARRAYASYNC_SPT - playback_hipMemcpy2DToArrayAsync_spt, // [435] HRR_API_HIPMEMCPY2DTOARRAYASYNC_SPT - playback_hipStreamQuery_spt, // [436] HRR_API_HIPSTREAMQUERY_SPT - playback_hipStreamSynchronize_spt, // [437] HRR_API_HIPSTREAMSYNCHRONIZE_SPT - playback_hipStreamGetPriority_spt, // [438] HRR_API_HIPSTREAMGETPRIORITY_SPT - playback_hipStreamWaitEvent_spt, // [439] HRR_API_HIPSTREAMWAITEVENT_SPT - playback_hipStreamGetFlags_spt, // [440] HRR_API_HIPSTREAMGETFLAGS_SPT - playback_hipStreamAddCallback_spt, // [441] HRR_API_HIPSTREAMADDCALLBACK_SPT - playback_hipEventRecord_spt, // [442] HRR_API_HIPEVENTRECORD_SPT - playback_hipLaunchCooperativeKernel_spt, // [443] HRR_API_HIPLAUNCHCOOPERATIVEKERNEL_SPT - playback_hipLaunchKernel_spt, // [444] HRR_API_HIPLAUNCHKERNEL_SPT - playback_hipGraphLaunch_spt, // [445] HRR_API_HIPGRAPHLAUNCH_SPT - playback_hipStreamBeginCapture_spt, // [446] HRR_API_HIPSTREAMBEGINCAPTURE_SPT - playback_hipStreamEndCapture_spt, // [447] HRR_API_HIPSTREAMENDCAPTURE_SPT - playback_hipStreamIsCapturing_spt, // [448] HRR_API_HIPSTREAMISCAPTURING_SPT - playback_hipStreamGetCaptureInfo_spt, // [449] HRR_API_HIPSTREAMGETCAPTUREINFO_SPT - playback_hipStreamGetCaptureInfo_v2_spt, // [450] HRR_API_HIPSTREAMGETCAPTUREINFO_V2_SPT - playback_hipLaunchHostFunc_spt, // [451] HRR_API_HIPLAUNCHHOSTFUNC_SPT - playback_hipCreateChannelDesc, // [452] HRR_API_HIPCREATECHANNELDESC - playback_hipExtModuleLaunchKernel, // [453] HRR_API_HIPEXTMODULELAUNCHKERNEL - playback_hipHccModuleLaunchKernel, // [454] HRR_API_HIPHCCMODULELAUNCHKERNEL - playback_hipGetStreamDeviceId, // [455] HRR_API_HIPGETSTREAMDEVICEID - playback_hipDrvGraphAddMemsetNode, // [456] HRR_API_HIPDRVGRAPHADDMEMSETNODE - playback_hipGraphAddExternalSemaphoresWaitNode, // [457] HRR_API_HIPGRAPHADDEXTERNALSEMAPHORESWAITNODE - playback_hipGraphAddExternalSemaphoresSignalNode, // [458] HRR_API_HIPGRAPHADDEXTERNALSEMAPHORESSIGNALNODE - playback_hipGraphExternalSemaphoresSignalNodeSetParams, // [459] HRR_API_HIPGRAPHEXTERNALSEMAPHORESSIGNALNODESETPARAMS - playback_hipGraphExternalSemaphoresWaitNodeSetParams, // [460] HRR_API_HIPGRAPHEXTERNALSEMAPHORESWAITNODESETPARAMS - playback_hipGraphExternalSemaphoresSignalNodeGetParams, // [461] HRR_API_HIPGRAPHEXTERNALSEMAPHORESSIGNALNODEGETPARAMS - playback_hipGraphExternalSemaphoresWaitNodeGetParams, // [462] HRR_API_HIPGRAPHEXTERNALSEMAPHORESWAITNODEGETPARAMS - playback_hipGraphExecExternalSemaphoresSignalNodeSetParams, // [463] HRR_API_HIPGRAPHEXECEXTERNALSEMAPHORESSIGNALNODESETPARAMS - playback_hipGraphExecExternalSemaphoresWaitNodeSetParams, // [464] HRR_API_HIPGRAPHEXECEXTERNALSEMAPHORESWAITNODESETPARAMS - playback_hipGraphAddNode, // [465] HRR_API_HIPGRAPHADDNODE - playback_hipGraphInstantiateWithParams, // [466] HRR_API_HIPGRAPHINSTANTIATEWITHPARAMS - playback_hipExtGetLastError, // [467] HRR_API_HIPEXTGETLASTERROR - playback_hipTexRefGetBorderColor, // [468] HRR_API_HIPTEXREFGETBORDERCOLOR - playback_hipTexRefGetArray, // [469] HRR_API_HIPTEXREFGETARRAY - playback_hipGetProcAddress, // [470] HRR_API_HIPGETPROCADDRESS - playback_hipStreamBeginCaptureToGraph, // [471] HRR_API_HIPSTREAMBEGINCAPTURETOGRAPH - playback_hipGetFuncBySymbol, // [472] HRR_API_HIPGETFUNCBYSYMBOL - playback_hipDrvGraphAddMemFreeNode, // [473] HRR_API_HIPDRVGRAPHADDMEMFREENODE - playback_hipDrvGraphExecMemcpyNodeSetParams, // [474] HRR_API_HIPDRVGRAPHEXECMEMCPYNODESETPARAMS - playback_hipDrvGraphExecMemsetNodeSetParams, // [475] HRR_API_HIPDRVGRAPHEXECMEMSETNODESETPARAMS - playback_hipSetValidDevices, // [476] HRR_API_HIPSETVALIDDEVICES - playback_hipMemcpyAtoD, // [477] HRR_API_HIPMEMCPYATOD - playback_hipMemcpyDtoA, // [478] HRR_API_HIPMEMCPYDTOA - playback_hipMemcpyAtoA, // [479] HRR_API_HIPMEMCPYATOA - playback_hipMemcpyAtoHAsync, // [480] HRR_API_HIPMEMCPYATOHASYNC - playback_hipMemcpyHtoAAsync, // [481] HRR_API_HIPMEMCPYHTOAASYNC - playback_hipMemcpy2DArrayToArray, // [482] HRR_API_HIPMEMCPY2DARRAYTOARRAY - playback_hipGraphExecGetFlags, // [483] HRR_API_HIPGRAPHEXECGETFLAGS - playback_hipGraphNodeSetParams, // [484] HRR_API_HIPGRAPHNODESETPARAMS - playback_hipGraphExecNodeSetParams, // [485] HRR_API_HIPGRAPHEXECNODESETPARAMS - playback_hipExternalMemoryGetMappedMipmappedArray, // [486] HRR_API_HIPEXTERNALMEMORYGETMAPPEDMIPMAPPEDARRAY - playback_hipDrvGraphMemcpyNodeGetParams, // [487] HRR_API_HIPDRVGRAPHMEMCPYNODEGETPARAMS - playback_hipDrvGraphMemcpyNodeSetParams, // [488] HRR_API_HIPDRVGRAPHMEMCPYNODESETPARAMS - playback_hipExtHostAlloc, // [489] HRR_API_HIPEXTHOSTALLOC - playback_hipDeviceGetTexture1DLinearMaxWidth, // [490] HRR_API_HIPDEVICEGETTEXTURE1DLINEARMAXWIDTH - playback_hipGraphAddBatchMemOpNode, // [491] HRR_API_HIPGRAPHADDBATCHMEMOPNODE - playback_hipGraphBatchMemOpNodeGetParams, // [492] HRR_API_HIPGRAPHBATCHMEMOPNODEGETPARAMS - playback_hipGraphBatchMemOpNodeSetParams, // [493] HRR_API_HIPGRAPHBATCHMEMOPNODESETPARAMS - playback_hipGraphExecBatchMemOpNodeSetParams, // [494] HRR_API_HIPGRAPHEXECBATCHMEMOPNODESETPARAMS - playback_hipEventRecordWithFlags, // [495] HRR_API_HIPEVENTRECORDWITHFLAGS - playback_hipLaunchKernelExC, // [496] HRR_API_HIPLAUNCHKERNELEXC - playback_hipDrvLaunchKernelEx, // [497] HRR_API_HIPDRVLAUNCHKERNELEX - playback_hipMemGetHandleForAddressRange, // [498] HRR_API_HIPMEMGETHANDLEFORADDRESSRANGE - playback_hipMemsetD2D8, // [499] HRR_API_HIPMEMSETD2D8 - playback_hipMemsetD2D8Async, // [500] HRR_API_HIPMEMSETD2D8ASYNC - playback_hipMemsetD2D16, // [501] HRR_API_HIPMEMSETD2D16 - playback_hipMemsetD2D16Async, // [502] HRR_API_HIPMEMSETD2D16ASYNC - playback_hipMemsetD2D32, // [503] HRR_API_HIPMEMSETD2D32 - playback_hipMemsetD2D32Async, // [504] HRR_API_HIPMEMSETD2D32ASYNC - playback_hipStreamSetAttribute, // [505] HRR_API_HIPSTREAMSETATTRIBUTE - playback_hipStreamGetAttribute, // [506] HRR_API_HIPSTREAMGETATTRIBUTE - playback_hipModuleLoadFatBinary, // [507] HRR_API_HIPMODULELOADFATBINARY - playback_hipMemcpyBatchAsync, // [508] HRR_API_HIPMEMCPYBATCHASYNC - playback_hipMemcpy3DBatchAsync, // [509] HRR_API_HIPMEMCPY3DBATCHASYNC - playback_hipMemcpy3DPeer, // [510] HRR_API_HIPMEMCPY3DPEER - playback_hipMemcpy3DPeerAsync, // [511] HRR_API_HIPMEMCPY3DPEERASYNC - playback_hipGetDriverEntryPoint, // [512] HRR_API_HIPGETDRIVERENTRYPOINT - playback_hipGetDriverEntryPoint_spt, // [513] HRR_API_HIPGETDRIVERENTRYPOINT_SPT - playback_hipLibraryLoadData, // [514] HRR_API_HIPLIBRARYLOADDATA - playback_hipLibraryLoadFromFile, // [515] HRR_API_HIPLIBRARYLOADFROMFILE - playback_hipLibraryUnload, // [516] HRR_API_HIPLIBRARYUNLOAD - playback_hipLibraryGetKernel, // [517] HRR_API_HIPLIBRARYGETKERNEL - playback_hipLibraryGetKernelCount, // [518] HRR_API_HIPLIBRARYGETKERNELCOUNT - playback_hipLibraryGetGlobal, // [519] HRR_API_HIPLIBRARYGETGLOBAL - playback_hipLibraryGetManaged, // [520] HRR_API_HIPLIBRARYGETMANAGED - playback_hipLibraryEnumerateKernels, // [521] HRR_API_HIPLIBRARYENUMERATEKERNELS - playback_hipKernelGetLibrary, // [522] HRR_API_HIPKERNELGETLIBRARY - playback_hipKernelGetName, // [523] HRR_API_HIPKERNELGETNAME - playback_hipGetProcAddress_spt, // [524] HRR_API_HIPGETPROCADDRESS_SPT - playback_hipExtDisableLogging, // [525] HRR_API_HIPEXTDISABLELOGGING - playback_hipExtEnableLogging, // [526] HRR_API_HIPEXTENABLELOGGING - playback_hipExtSetLoggingParams, // [527] HRR_API_HIPEXTSETLOGGINGPARAMS - playback_hipKernelGetAttribute, // [528] HRR_API_HIPKERNELGETATTRIBUTE - playback_hipKernelSetAttribute, // [529] HRR_API_HIPKERNELSETATTRIBUTE - playback_hipKernelGetFunction, // [530] HRR_API_HIPKERNELGETFUNCTION - playback_hipKernelGetParamInfo, // [531] HRR_API_HIPKERNELGETPARAMINFO - playback_hipMemSetMemPool, // [532] HRR_API_HIPMEMSETMEMPOOL - playback_hipMemGetMemPool, // [533] HRR_API_HIPMEMGETMEMPOOL - playback_hipMipmappedArrayGetMemoryRequirements, // [534] HRR_API_HIPMIPMAPPEDARRAYGETMEMORYREQUIREMENTS - playback_hipGreenCtxCreate, // [535] HRR_API_HIPGREENCTXCREATE - playback_hipExecutionCtxDestroy, // [536] HRR_API_HIPEXECUTIONCTXDESTROY - playback_hipExecutionCtxStreamCreate, // [537] HRR_API_HIPEXECUTIONCTXSTREAMCREATE - playback_hipDeviceGetDevResource, // [538] HRR_API_HIPDEVICEGETDEVRESOURCE - playback_hipDevSmResourceSplitByCount, // [539] HRR_API_HIPDEVSMRESOURCESPLITBYCOUNT - playback_hipDevSmResourceSplit, // [540] HRR_API_HIPDEVSMRESOURCESPLIT - playback_hipDevResourceGenerateDesc, // [541] HRR_API_HIPDEVRESOURCEGENERATEDESC - playback_hipDeviceGetExecutionCtx, // [542] HRR_API_HIPDEVICEGETEXECUTIONCTX - playback_hipExecutionCtxGetDevResource, // [543] HRR_API_HIPEXECUTIONCTXGETDEVRESOURCE - playback_hipExecutionCtxGetDevice, // [544] HRR_API_HIPEXECUTIONCTXGETDEVICE - playback_hipExecutionCtxGetId, // [545] HRR_API_HIPEXECUTIONCTXGETID - playback_hipStreamGetDevResource, // [546] HRR_API_HIPSTREAMGETDEVRESOURCE - playback_hipExecutionCtxRecordEvent, // [547] HRR_API_HIPEXECUTIONCTXRECORDEVENT - playback_hipExecutionCtxSynchronize, // [548] HRR_API_HIPEXECUTIONCTXSYNCHRONIZE - playback_hipExecutionCtxWaitEvent, // [549] HRR_API_HIPEXECUTIONCTXWAITEVENT + playback_hipDeviceGetLuid, // [56] HRR_API_HIPDEVICEGETLUID + playback_hipDeviceGetMemPool, // [57] HRR_API_HIPDEVICEGETMEMPOOL + playback_hipDeviceGetName, // [58] HRR_API_HIPDEVICEGETNAME + playback_hipDeviceGetP2PAttribute, // [59] HRR_API_HIPDEVICEGETP2PATTRIBUTE + playback_hipDeviceGetPCIBusId, // [60] HRR_API_HIPDEVICEGETPCIBUSID + playback_hipDeviceGetSharedMemConfig, // [61] HRR_API_HIPDEVICEGETSHAREDMEMCONFIG + playback_hipDeviceGetStreamPriorityRange, // [62] HRR_API_HIPDEVICEGETSTREAMPRIORITYRANGE + playback_hipDeviceGetUuid, // [63] HRR_API_HIPDEVICEGETUUID + playback_hipDeviceGraphMemTrim, // [64] HRR_API_HIPDEVICEGRAPHMEMTRIM + playback_hipDevicePrimaryCtxGetState, // [65] HRR_API_HIPDEVICEPRIMARYCTXGETSTATE + playback_hipDevicePrimaryCtxRelease, // [66] HRR_API_HIPDEVICEPRIMARYCTXRELEASE + playback_hipDevicePrimaryCtxReset, // [67] HRR_API_HIPDEVICEPRIMARYCTXRESET + playback_hipDevicePrimaryCtxRetain, // [68] HRR_API_HIPDEVICEPRIMARYCTXRETAIN + playback_hipDevicePrimaryCtxSetFlags, // [69] HRR_API_HIPDEVICEPRIMARYCTXSETFLAGS + playback_hipDeviceReset, // [70] HRR_API_HIPDEVICERESET + playback_hipDeviceSetCacheConfig, // [71] HRR_API_HIPDEVICESETCACHECONFIG + playback_hipDeviceSetGraphMemAttribute, // [72] HRR_API_HIPDEVICESETGRAPHMEMATTRIBUTE + playback_hipDeviceSetLimit, // [73] HRR_API_HIPDEVICESETLIMIT + playback_hipDeviceSetMemPool, // [74] HRR_API_HIPDEVICESETMEMPOOL + playback_hipDeviceSetSharedMemConfig, // [75] HRR_API_HIPDEVICESETSHAREDMEMCONFIG + playback_hipDeviceSynchronize, // [76] HRR_API_HIPDEVICESYNCHRONIZE + playback_hipDeviceTotalMem, // [77] HRR_API_HIPDEVICETOTALMEM + playback_hipDriverGetVersion, // [78] HRR_API_HIPDRIVERGETVERSION + playback_hipDrvGetErrorName, // [79] HRR_API_HIPDRVGETERRORNAME + playback_hipDrvGetErrorString, // [80] HRR_API_HIPDRVGETERRORSTRING + playback_hipDrvGraphAddMemcpyNode, // [81] HRR_API_HIPDRVGRAPHADDMEMCPYNODE + playback_hipDrvMemcpy2DUnaligned, // [82] HRR_API_HIPDRVMEMCPY2DUNALIGNED + playback_hipDrvMemcpy3D, // [83] HRR_API_HIPDRVMEMCPY3D + playback_hipDrvMemcpy3DAsync, // [84] HRR_API_HIPDRVMEMCPY3DASYNC + playback_hipDrvPointerGetAttributes, // [85] HRR_API_HIPDRVPOINTERGETATTRIBUTES + playback_hipEventCreate, // [86] HRR_API_HIPEVENTCREATE + playback_hipEventCreateWithFlags, // [87] HRR_API_HIPEVENTCREATEWITHFLAGS + playback_hipEventDestroy, // [88] HRR_API_HIPEVENTDESTROY + playback_hipEventElapsedTime, // [89] HRR_API_HIPEVENTELAPSEDTIME + playback_hipEventQuery, // [90] HRR_API_HIPEVENTQUERY + playback_hipEventRecord, // [91] HRR_API_HIPEVENTRECORD + playback_hipEventSynchronize, // [92] HRR_API_HIPEVENTSYNCHRONIZE + playback_hipExtGetLinkTypeAndHopCount, // [93] HRR_API_HIPEXTGETLINKTYPEANDHOPCOUNT + playback_hipExtLaunchKernel, // [94] HRR_API_HIPEXTLAUNCHKERNEL + playback_hipExtLaunchMultiKernelMultiDevice, // [95] HRR_API_HIPEXTLAUNCHMULTIKERNELMULTIDEVICE + playback_hipExtMallocWithFlags, // [96] HRR_API_HIPEXTMALLOCWITHFLAGS + playback_hipExtStreamCreateWithCUMask, // [97] HRR_API_HIPEXTSTREAMCREATEWITHCUMASK + playback_hipExtStreamGetCUMask, // [98] HRR_API_HIPEXTSTREAMGETCUMASK + playback_hipExternalMemoryGetMappedBuffer, // [99] HRR_API_HIPEXTERNALMEMORYGETMAPPEDBUFFER + playback_hipFree, // [100] HRR_API_HIPFREE + playback_hipFreeArray, // [101] HRR_API_HIPFREEARRAY + playback_hipFreeAsync, // [102] HRR_API_HIPFREEASYNC + playback_hipFreeHost, // [103] HRR_API_HIPFREEHOST + playback_hipFreeMipmappedArray, // [104] HRR_API_HIPFREEMIPMAPPEDARRAY + playback_hipFuncGetAttribute, // [105] HRR_API_HIPFUNCGETATTRIBUTE + playback_hipFuncGetAttributes, // [106] HRR_API_HIPFUNCGETATTRIBUTES + playback_hipFuncSetAttribute, // [107] HRR_API_HIPFUNCSETATTRIBUTE + playback_hipFuncSetCacheConfig, // [108] HRR_API_HIPFUNCSETCACHECONFIG + playback_hipFuncSetSharedMemConfig, // [109] HRR_API_HIPFUNCSETSHAREDMEMCONFIG + playback_hipGLGetDevices, // [110] HRR_API_HIPGLGETDEVICES + playback_hipGetChannelDesc, // [111] HRR_API_HIPGETCHANNELDESC + playback_hipGetDevice, // [112] HRR_API_HIPGETDEVICE + playback_hipGetDeviceCount, // [113] HRR_API_HIPGETDEVICECOUNT + playback_hipGetDeviceFlags, // [114] HRR_API_HIPGETDEVICEFLAGS + playback_hipGetDevicePropertiesR0600, // [115] HRR_API_HIPGETDEVICEPROPERTIESR0600 + playback_hipGetDevicePropertiesR0000, // [116] HRR_API_HIPGETDEVICEPROPERTIESR0000 + playback_hipGetErrorName, // [117] HRR_API_HIPGETERRORNAME + playback_hipGetErrorString, // [118] HRR_API_HIPGETERRORSTRING + playback_hipGetLastError, // [119] HRR_API_HIPGETLASTERROR + playback_hipGetMipmappedArrayLevel, // [120] HRR_API_HIPGETMIPMAPPEDARRAYLEVEL + playback_hipGetSymbolAddress, // [121] HRR_API_HIPGETSYMBOLADDRESS + playback_hipGetSymbolSize, // [122] HRR_API_HIPGETSYMBOLSIZE + playback_hipGetTextureAlignmentOffset, // [123] HRR_API_HIPGETTEXTUREALIGNMENTOFFSET + playback_hipGetTextureObjectResourceDesc, // [124] HRR_API_HIPGETTEXTUREOBJECTRESOURCEDESC + playback_hipGetTextureObjectResourceViewDesc, // [125] HRR_API_HIPGETTEXTUREOBJECTRESOURCEVIEWDESC + playback_hipGetTextureObjectTextureDesc, // [126] HRR_API_HIPGETTEXTUREOBJECTTEXTUREDESC + playback_hipGetTextureReference, // [127] HRR_API_HIPGETTEXTUREREFERENCE + playback_hipGraphAddChildGraphNode, // [128] HRR_API_HIPGRAPHADDCHILDGRAPHNODE + playback_hipGraphAddDependencies, // [129] HRR_API_HIPGRAPHADDDEPENDENCIES + playback_hipGraphAddEmptyNode, // [130] HRR_API_HIPGRAPHADDEMPTYNODE + playback_hipGraphAddEventRecordNode, // [131] HRR_API_HIPGRAPHADDEVENTRECORDNODE + playback_hipGraphAddEventWaitNode, // [132] HRR_API_HIPGRAPHADDEVENTWAITNODE + playback_hipGraphAddHostNode, // [133] HRR_API_HIPGRAPHADDHOSTNODE + playback_hipGraphAddKernelNode, // [134] HRR_API_HIPGRAPHADDKERNELNODE + playback_hipGraphAddMemAllocNode, // [135] HRR_API_HIPGRAPHADDMEMALLOCNODE + playback_hipGraphAddMemFreeNode, // [136] HRR_API_HIPGRAPHADDMEMFREENODE + playback_hipGraphAddMemcpyNode, // [137] HRR_API_HIPGRAPHADDMEMCPYNODE + playback_hipGraphAddMemcpyNode1D, // [138] HRR_API_HIPGRAPHADDMEMCPYNODE1D + playback_hipGraphAddMemcpyNodeFromSymbol, // [139] HRR_API_HIPGRAPHADDMEMCPYNODEFROMSYMBOL + playback_hipGraphAddMemcpyNodeToSymbol, // [140] HRR_API_HIPGRAPHADDMEMCPYNODETOSYMBOL + playback_hipGraphAddMemsetNode, // [141] HRR_API_HIPGRAPHADDMEMSETNODE + playback_hipGraphChildGraphNodeGetGraph, // [142] HRR_API_HIPGRAPHCHILDGRAPHNODEGETGRAPH + playback_hipGraphClone, // [143] HRR_API_HIPGRAPHCLONE + playback_hipGraphCreate, // [144] HRR_API_HIPGRAPHCREATE + playback_hipGraphDebugDotPrint, // [145] HRR_API_HIPGRAPHDEBUGDOTPRINT + playback_hipGraphDestroy, // [146] HRR_API_HIPGRAPHDESTROY + playback_hipGraphDestroyNode, // [147] HRR_API_HIPGRAPHDESTROYNODE + playback_hipGraphEventRecordNodeGetEvent, // [148] HRR_API_HIPGRAPHEVENTRECORDNODEGETEVENT + playback_hipGraphEventRecordNodeSetEvent, // [149] HRR_API_HIPGRAPHEVENTRECORDNODESETEVENT + playback_hipGraphEventWaitNodeGetEvent, // [150] HRR_API_HIPGRAPHEVENTWAITNODEGETEVENT + playback_hipGraphEventWaitNodeSetEvent, // [151] HRR_API_HIPGRAPHEVENTWAITNODESETEVENT + playback_hipGraphExecChildGraphNodeSetParams, // [152] HRR_API_HIPGRAPHEXECCHILDGRAPHNODESETPARAMS + playback_hipGraphExecDestroy, // [153] HRR_API_HIPGRAPHEXECDESTROY + playback_hipGraphExecEventRecordNodeSetEvent, // [154] HRR_API_HIPGRAPHEXECEVENTRECORDNODESETEVENT + playback_hipGraphExecEventWaitNodeSetEvent, // [155] HRR_API_HIPGRAPHEXECEVENTWAITNODESETEVENT + playback_hipGraphExecHostNodeSetParams, // [156] HRR_API_HIPGRAPHEXECHOSTNODESETPARAMS + playback_hipGraphExecKernelNodeSetParams, // [157] HRR_API_HIPGRAPHEXECKERNELNODESETPARAMS + playback_hipGraphExecMemcpyNodeSetParams, // [158] HRR_API_HIPGRAPHEXECMEMCPYNODESETPARAMS + playback_hipGraphExecMemcpyNodeSetParams1D, // [159] HRR_API_HIPGRAPHEXECMEMCPYNODESETPARAMS1D + playback_hipGraphExecMemcpyNodeSetParamsFromSymbol, // [160] HRR_API_HIPGRAPHEXECMEMCPYNODESETPARAMSFROMSYMBOL + playback_hipGraphExecMemcpyNodeSetParamsToSymbol, // [161] HRR_API_HIPGRAPHEXECMEMCPYNODESETPARAMSTOSYMBOL + playback_hipGraphExecMemsetNodeSetParams, // [162] HRR_API_HIPGRAPHEXECMEMSETNODESETPARAMS + playback_hipGraphExecUpdate, // [163] HRR_API_HIPGRAPHEXECUPDATE + playback_hipGraphGetEdges, // [164] HRR_API_HIPGRAPHGETEDGES + playback_hipGraphGetNodes, // [165] HRR_API_HIPGRAPHGETNODES + playback_hipGraphGetRootNodes, // [166] HRR_API_HIPGRAPHGETROOTNODES + playback_hipGraphHostNodeGetParams, // [167] HRR_API_HIPGRAPHHOSTNODEGETPARAMS + playback_hipGraphHostNodeSetParams, // [168] HRR_API_HIPGRAPHHOSTNODESETPARAMS + playback_hipGraphInstantiate, // [169] HRR_API_HIPGRAPHINSTANTIATE + playback_hipGraphInstantiateWithFlags, // [170] HRR_API_HIPGRAPHINSTANTIATEWITHFLAGS + playback_hipGraphKernelNodeCopyAttributes, // [171] HRR_API_HIPGRAPHKERNELNODECOPYATTRIBUTES + playback_hipGraphKernelNodeGetAttribute, // [172] HRR_API_HIPGRAPHKERNELNODEGETATTRIBUTE + playback_hipGraphKernelNodeGetParams, // [173] HRR_API_HIPGRAPHKERNELNODEGETPARAMS + playback_hipGraphKernelNodeSetAttribute, // [174] HRR_API_HIPGRAPHKERNELNODESETATTRIBUTE + playback_hipGraphKernelNodeSetParams, // [175] HRR_API_HIPGRAPHKERNELNODESETPARAMS + playback_hipGraphLaunch, // [176] HRR_API_HIPGRAPHLAUNCH + playback_hipGraphMemAllocNodeGetParams, // [177] HRR_API_HIPGRAPHMEMALLOCNODEGETPARAMS + playback_hipGraphMemFreeNodeGetParams, // [178] HRR_API_HIPGRAPHMEMFREENODEGETPARAMS + playback_hipGraphMemcpyNodeGetParams, // [179] HRR_API_HIPGRAPHMEMCPYNODEGETPARAMS + playback_hipGraphMemcpyNodeSetParams, // [180] HRR_API_HIPGRAPHMEMCPYNODESETPARAMS + playback_hipGraphMemcpyNodeSetParams1D, // [181] HRR_API_HIPGRAPHMEMCPYNODESETPARAMS1D + playback_hipGraphMemcpyNodeSetParamsFromSymbol, // [182] HRR_API_HIPGRAPHMEMCPYNODESETPARAMSFROMSYMBOL + playback_hipGraphMemcpyNodeSetParamsToSymbol, // [183] HRR_API_HIPGRAPHMEMCPYNODESETPARAMSTOSYMBOL + playback_hipGraphMemsetNodeGetParams, // [184] HRR_API_HIPGRAPHMEMSETNODEGETPARAMS + playback_hipGraphMemsetNodeSetParams, // [185] HRR_API_HIPGRAPHMEMSETNODESETPARAMS + playback_hipGraphNodeFindInClone, // [186] HRR_API_HIPGRAPHNODEFINDINCLONE + playback_hipGraphNodeGetDependencies, // [187] HRR_API_HIPGRAPHNODEGETDEPENDENCIES + playback_hipGraphNodeGetDependentNodes, // [188] HRR_API_HIPGRAPHNODEGETDEPENDENTNODES + playback_hipGraphNodeGetEnabled, // [189] HRR_API_HIPGRAPHNODEGETENABLED + playback_hipGraphNodeGetType, // [190] HRR_API_HIPGRAPHNODEGETTYPE + playback_hipGraphNodeSetEnabled, // [191] HRR_API_HIPGRAPHNODESETENABLED + playback_hipGraphReleaseUserObject, // [192] HRR_API_HIPGRAPHRELEASEUSEROBJECT + playback_hipGraphRemoveDependencies, // [193] HRR_API_HIPGRAPHREMOVEDEPENDENCIES + playback_hipGraphRetainUserObject, // [194] HRR_API_HIPGRAPHRETAINUSEROBJECT + playback_hipGraphUpload, // [195] HRR_API_HIPGRAPHUPLOAD + playback_hipGraphicsGLRegisterBuffer, // [196] HRR_API_HIPGRAPHICSGLREGISTERBUFFER + playback_hipGraphicsGLRegisterImage, // [197] HRR_API_HIPGRAPHICSGLREGISTERIMAGE + playback_hipGraphicsMapResources, // [198] HRR_API_HIPGRAPHICSMAPRESOURCES + playback_hipGraphicsResourceGetMappedPointer, // [199] HRR_API_HIPGRAPHICSRESOURCEGETMAPPEDPOINTER + playback_hipGraphicsSubResourceGetMappedArray, // [200] HRR_API_HIPGRAPHICSSUBRESOURCEGETMAPPEDARRAY + playback_hipGraphicsUnmapResources, // [201] HRR_API_HIPGRAPHICSUNMAPRESOURCES + playback_hipGraphicsUnregisterResource, // [202] HRR_API_HIPGRAPHICSUNREGISTERRESOURCE + playback_hipHostAlloc, // [203] HRR_API_HIPHOSTALLOC + playback_hipHostFree, // [204] HRR_API_HIPHOSTFREE + playback_hipHostGetDevicePointer, // [205] HRR_API_HIPHOSTGETDEVICEPOINTER + playback_hipHostGetFlags, // [206] HRR_API_HIPHOSTGETFLAGS + playback_hipHostMalloc, // [207] HRR_API_HIPHOSTMALLOC + playback_hipHostRegister, // [208] HRR_API_HIPHOSTREGISTER + playback_hipHostUnregister, // [209] HRR_API_HIPHOSTUNREGISTER + playback_hipImportExternalMemory, // [210] HRR_API_HIPIMPORTEXTERNALMEMORY + playback_hipImportExternalSemaphore, // [211] HRR_API_HIPIMPORTEXTERNALSEMAPHORE + playback_hipInit, // [212] HRR_API_HIPINIT + playback_hipInitDevice, // [213] HRR_API_HIPINITDEVICE + playback_hipIpcCloseMemHandle, // [214] HRR_API_HIPIPCCLOSEMEMHANDLE + playback_hipIpcGetEventHandle, // [215] HRR_API_HIPIPCGETEVENTHANDLE + playback_hipIpcGetMemHandle, // [216] HRR_API_HIPIPCGETMEMHANDLE + playback_hipIpcOpenEventHandle, // [217] HRR_API_HIPIPCOPENEVENTHANDLE + playback_hipIpcOpenMemHandle, // [218] HRR_API_HIPIPCOPENMEMHANDLE + playback_hipKernelNameRef, // [219] HRR_API_HIPKERNELNAMEREF + playback_hipKernelNameRefByPtr, // [220] HRR_API_HIPKERNELNAMEREFBYPTR + playback_hipLaunchByPtr, // [221] HRR_API_HIPLAUNCHBYPTR + playback_hipLaunchCooperativeKernel, // [222] HRR_API_HIPLAUNCHCOOPERATIVEKERNEL + playback_hipLaunchCooperativeKernelMultiDevice, // [223] HRR_API_HIPLAUNCHCOOPERATIVEKERNELMULTIDEVICE + playback_hipLaunchHostFunc, // [224] HRR_API_HIPLAUNCHHOSTFUNC + playback_hipLaunchKernel, // [225] HRR_API_HIPLAUNCHKERNEL + playback_hipMalloc, // [226] HRR_API_HIPMALLOC + playback_hipMalloc3D, // [227] HRR_API_HIPMALLOC3D + playback_hipMalloc3DArray, // [228] HRR_API_HIPMALLOC3DARRAY + playback_hipMallocArray, // [229] HRR_API_HIPMALLOCARRAY + playback_hipMallocAsync, // [230] HRR_API_HIPMALLOCASYNC + playback_hipMallocFromPoolAsync, // [231] HRR_API_HIPMALLOCFROMPOOLASYNC + playback_hipMallocHost, // [232] HRR_API_HIPMALLOCHOST + playback_hipMallocManaged, // [233] HRR_API_HIPMALLOCMANAGED + playback_hipMallocMipmappedArray, // [234] HRR_API_HIPMALLOCMIPMAPPEDARRAY + playback_hipMallocPitch, // [235] HRR_API_HIPMALLOCPITCH + playback_hipMemAddressFree, // [236] HRR_API_HIPMEMADDRESSFREE + playback_hipMemAddressReserve, // [237] HRR_API_HIPMEMADDRESSRESERVE + playback_hipMemAdvise, // [238] HRR_API_HIPMEMADVISE + playback_hipMemAdvise_v2, // [239] HRR_API_HIPMEMADVISE_V2 + playback_hipMemAllocHost, // [240] HRR_API_HIPMEMALLOCHOST + playback_hipMemAllocPitch, // [241] HRR_API_HIPMEMALLOCPITCH + playback_hipMemCreate, // [242] HRR_API_HIPMEMCREATE + playback_hipMemExportToShareableHandle, // [243] HRR_API_HIPMEMEXPORTTOSHAREABLEHANDLE + playback_hipMemGetAccess, // [244] HRR_API_HIPMEMGETACCESS + playback_hipMemGetAddressRange, // [245] HRR_API_HIPMEMGETADDRESSRANGE + playback_hipMemGetAllocationGranularity, // [246] HRR_API_HIPMEMGETALLOCATIONGRANULARITY + playback_hipMemGetAllocationPropertiesFromHandle, // [247] HRR_API_HIPMEMGETALLOCATIONPROPERTIESFROMHANDLE + playback_hipMemGetInfo, // [248] HRR_API_HIPMEMGETINFO + playback_hipMemImportFromShareableHandle, // [249] HRR_API_HIPMEMIMPORTFROMSHAREABLEHANDLE + playback_hipMemMap, // [250] HRR_API_HIPMEMMAP + playback_hipMemMapArrayAsync, // [251] HRR_API_HIPMEMMAPARRAYASYNC + playback_hipMemPoolCreate, // [252] HRR_API_HIPMEMPOOLCREATE + playback_hipMemPoolDestroy, // [253] HRR_API_HIPMEMPOOLDESTROY + playback_hipMemPoolExportPointer, // [254] HRR_API_HIPMEMPOOLEXPORTPOINTER + playback_hipMemPoolExportToShareableHandle, // [255] HRR_API_HIPMEMPOOLEXPORTTOSHAREABLEHANDLE + playback_hipMemPoolGetAccess, // [256] HRR_API_HIPMEMPOOLGETACCESS + playback_hipMemPoolGetAttribute, // [257] HRR_API_HIPMEMPOOLGETATTRIBUTE + playback_hipMemPoolImportFromShareableHandle, // [258] HRR_API_HIPMEMPOOLIMPORTFROMSHAREABLEHANDLE + playback_hipMemPoolImportPointer, // [259] HRR_API_HIPMEMPOOLIMPORTPOINTER + playback_hipMemPoolSetAccess, // [260] HRR_API_HIPMEMPOOLSETACCESS + playback_hipMemPoolSetAttribute, // [261] HRR_API_HIPMEMPOOLSETATTRIBUTE + playback_hipMemPoolTrimTo, // [262] HRR_API_HIPMEMPOOLTRIMTO + playback_hipMemPrefetchAsync, // [263] HRR_API_HIPMEMPREFETCHASYNC + playback_hipMemPrefetchAsync_v2, // [264] HRR_API_HIPMEMPREFETCHASYNC_V2 + playback_hipMemPrefetchBatchAsync, // [265] HRR_API_HIPMEMPREFETCHBATCHASYNC + playback_hipMemDiscardBatchAsync, // [266] HRR_API_HIPMEMDISCARDBATCHASYNC + playback_hipDrvMemDiscardBatchAsync, // [267] HRR_API_HIPDRVMEMDISCARDBATCHASYNC + playback_hipMemDiscardAndPrefetchBatchAsync, // [268] HRR_API_HIPMEMDISCARDANDPREFETCHBATCHASYNC + playback_hipDrvMemDiscardAndPrefetchBatchAsync, // [269] HRR_API_HIPDRVMEMDISCARDANDPREFETCHBATCHASYNC + playback_hipMemPtrGetInfo, // [270] HRR_API_HIPMEMPTRGETINFO + playback_hipMemRangeGetAttribute, // [271] HRR_API_HIPMEMRANGEGETATTRIBUTE + playback_hipMemRangeGetAttributes, // [272] HRR_API_HIPMEMRANGEGETATTRIBUTES + playback_hipMemRelease, // [273] HRR_API_HIPMEMRELEASE + playback_hipMemRetainAllocationHandle, // [274] HRR_API_HIPMEMRETAINALLOCATIONHANDLE + playback_hipMemSetAccess, // [275] HRR_API_HIPMEMSETACCESS + playback_hipMemUnmap, // [276] HRR_API_HIPMEMUNMAP + playback_hipMemcpy, // [277] HRR_API_HIPMEMCPY + playback_hipMemcpy2D, // [278] HRR_API_HIPMEMCPY2D + playback_hipMemcpy2DAsync, // [279] HRR_API_HIPMEMCPY2DASYNC + playback_hipMemcpy2DFromArray, // [280] HRR_API_HIPMEMCPY2DFROMARRAY + playback_hipMemcpy2DFromArrayAsync, // [281] HRR_API_HIPMEMCPY2DFROMARRAYASYNC + playback_hipMemcpy2DToArray, // [282] HRR_API_HIPMEMCPY2DTOARRAY + playback_hipMemcpy2DToArrayAsync, // [283] HRR_API_HIPMEMCPY2DTOARRAYASYNC + playback_hipMemcpy3D, // [284] HRR_API_HIPMEMCPY3D + playback_hipMemcpy3DAsync, // [285] HRR_API_HIPMEMCPY3DASYNC + playback_hipMemcpyAsync, // [286] HRR_API_HIPMEMCPYASYNC + playback_hipMemcpyAtoH, // [287] HRR_API_HIPMEMCPYATOH + playback_hipMemcpyDtoD, // [288] HRR_API_HIPMEMCPYDTOD + playback_hipMemcpyDtoDAsync, // [289] HRR_API_HIPMEMCPYDTODASYNC + playback_hipMemcpyDtoH, // [290] HRR_API_HIPMEMCPYDTOH + playback_hipMemcpyDtoHAsync, // [291] HRR_API_HIPMEMCPYDTOHASYNC + playback_hipMemcpyFromArray, // [292] HRR_API_HIPMEMCPYFROMARRAY + playback_hipMemcpyFromSymbol, // [293] HRR_API_HIPMEMCPYFROMSYMBOL + playback_hipMemcpyFromSymbolAsync, // [294] HRR_API_HIPMEMCPYFROMSYMBOLASYNC + playback_hipMemcpyHtoA, // [295] HRR_API_HIPMEMCPYHTOA + playback_hipMemcpyHtoD, // [296] HRR_API_HIPMEMCPYHTOD + playback_hipMemcpyHtoDAsync, // [297] HRR_API_HIPMEMCPYHTODASYNC + playback_hipMemcpyParam2D, // [298] HRR_API_HIPMEMCPYPARAM2D + playback_hipMemcpyParam2DAsync, // [299] HRR_API_HIPMEMCPYPARAM2DASYNC + playback_hipMemcpyPeer, // [300] HRR_API_HIPMEMCPYPEER + playback_hipMemcpyPeerAsync, // [301] HRR_API_HIPMEMCPYPEERASYNC + playback_hipMemcpyToArray, // [302] HRR_API_HIPMEMCPYTOARRAY + playback_hipMemcpyToSymbol, // [303] HRR_API_HIPMEMCPYTOSYMBOL + playback_hipMemcpyToSymbolAsync, // [304] HRR_API_HIPMEMCPYTOSYMBOLASYNC + playback_hipMemcpyWithStream, // [305] HRR_API_HIPMEMCPYWITHSTREAM + playback_hipMemset, // [306] HRR_API_HIPMEMSET + playback_hipMemset2D, // [307] HRR_API_HIPMEMSET2D + playback_hipMemset2DAsync, // [308] HRR_API_HIPMEMSET2DASYNC + playback_hipMemset3D, // [309] HRR_API_HIPMEMSET3D + playback_hipMemset3DAsync, // [310] HRR_API_HIPMEMSET3DASYNC + playback_hipMemsetAsync, // [311] HRR_API_HIPMEMSETASYNC + playback_hipMemsetD16, // [312] HRR_API_HIPMEMSETD16 + playback_hipMemsetD16Async, // [313] HRR_API_HIPMEMSETD16ASYNC + playback_hipMemsetD32, // [314] HRR_API_HIPMEMSETD32 + playback_hipMemsetD32Async, // [315] HRR_API_HIPMEMSETD32ASYNC + playback_hipMemsetD8, // [316] HRR_API_HIPMEMSETD8 + playback_hipMemsetD8Async, // [317] HRR_API_HIPMEMSETD8ASYNC + playback_hipMipmappedArrayCreate, // [318] HRR_API_HIPMIPMAPPEDARRAYCREATE + playback_hipMipmappedArrayDestroy, // [319] HRR_API_HIPMIPMAPPEDARRAYDESTROY + playback_hipMipmappedArrayGetLevel, // [320] HRR_API_HIPMIPMAPPEDARRAYGETLEVEL + playback_hipModuleGetFunction, // [321] HRR_API_HIPMODULEGETFUNCTION + playback_hipModuleGetFunctionCount, // [322] HRR_API_HIPMODULEGETFUNCTIONCOUNT + playback_hipModuleGetGlobal, // [323] HRR_API_HIPMODULEGETGLOBAL + playback_hipModuleGetTexRef, // [324] HRR_API_HIPMODULEGETTEXREF + playback_hipModuleLaunchCooperativeKernel, // [325] HRR_API_HIPMODULELAUNCHCOOPERATIVEKERNEL + playback_hipModuleLaunchCooperativeKernelMultiDevice, // [326] HRR_API_HIPMODULELAUNCHCOOPERATIVEKERNELMULTIDEVICE + playback_hipModuleLaunchKernel, // [327] HRR_API_HIPMODULELAUNCHKERNEL + playback_hipModuleLoad, // [328] HRR_API_HIPMODULELOAD + playback_hipModuleLoadData, // [329] HRR_API_HIPMODULELOADDATA + playback_hipModuleLoadDataEx, // [330] HRR_API_HIPMODULELOADDATAEX + playback_hipLinkAddData, // [331] HRR_API_HIPLINKADDDATA + playback_hipLinkAddFile, // [332] HRR_API_HIPLINKADDFILE + playback_hipLinkComplete, // [333] HRR_API_HIPLINKCOMPLETE + playback_hipLinkCreate, // [334] HRR_API_HIPLINKCREATE + playback_hipLinkDestroy, // [335] HRR_API_HIPLINKDESTROY + playback_hipModuleOccupancyMaxActiveBlocksPerMultiprocessor, // [336] HRR_API_HIPMODULEOCCUPANCYMAXACTIVEBLOCKSPERMULTIPROCESSOR + playback_hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags, // [337] HRR_API_HIPMODULEOCCUPANCYMAXACTIVEBLOCKSPERMULTIPROCESSORWITHFLAGS + playback_hipModuleOccupancyMaxPotentialBlockSize, // [338] HRR_API_HIPMODULEOCCUPANCYMAXPOTENTIALBLOCKSIZE + playback_hipModuleOccupancyMaxPotentialBlockSizeWithFlags, // [339] HRR_API_HIPMODULEOCCUPANCYMAXPOTENTIALBLOCKSIZEWITHFLAGS + playback_hipModuleUnload, // [340] HRR_API_HIPMODULEUNLOAD + playback_hipOccupancyAvailableDynamicSMemPerBlock, // [341] HRR_API_HIPOCCUPANCYAVAILABLEDYNAMICSMEMPERBLOCK + playback_hipOccupancyMaxActiveBlocksPerMultiprocessor, // [342] HRR_API_HIPOCCUPANCYMAXACTIVEBLOCKSPERMULTIPROCESSOR + playback_hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags, // [343] HRR_API_HIPOCCUPANCYMAXACTIVEBLOCKSPERMULTIPROCESSORWITHFLAGS + playback_hipOccupancyMaxPotentialBlockSize, // [344] HRR_API_HIPOCCUPANCYMAXPOTENTIALBLOCKSIZE + playback_hipOccupancyMaxActiveClusters, // [345] HRR_API_HIPOCCUPANCYMAXACTIVECLUSTERS + playback_hipOccupancyMaxPotentialClusterSize, // [346] HRR_API_HIPOCCUPANCYMAXPOTENTIALCLUSTERSIZE + playback_hipPeekAtLastError, // [347] HRR_API_HIPPEEKATLASTERROR + playback_hipPointerGetAttribute, // [348] HRR_API_HIPPOINTERGETATTRIBUTE + playback_hipPointerGetAttributes, // [349] HRR_API_HIPPOINTERGETATTRIBUTES + playback_hipPointerSetAttribute, // [350] HRR_API_HIPPOINTERSETATTRIBUTE + playback_hipProfilerStart, // [351] HRR_API_HIPPROFILERSTART + playback_hipProfilerStop, // [352] HRR_API_HIPPROFILERSTOP + playback_hipRuntimeGetVersion, // [353] HRR_API_HIPRUNTIMEGETVERSION + playback_hipSetDevice, // [354] HRR_API_HIPSETDEVICE + playback_hipSetDeviceFlags, // [355] HRR_API_HIPSETDEVICEFLAGS + playback_hipSetupArgument, // [356] HRR_API_HIPSETUPARGUMENT + playback_hipSignalExternalSemaphoresAsync, // [357] HRR_API_HIPSIGNALEXTERNALSEMAPHORESASYNC + playback_hipStreamAddCallback, // [358] HRR_API_HIPSTREAMADDCALLBACK + playback_hipStreamAttachMemAsync, // [359] HRR_API_HIPSTREAMATTACHMEMASYNC + playback_hipStreamBeginCapture, // [360] HRR_API_HIPSTREAMBEGINCAPTURE + playback_hipStreamCopyAttributes, // [361] HRR_API_HIPSTREAMCOPYATTRIBUTES + playback_hipStreamCreate, // [362] HRR_API_HIPSTREAMCREATE + playback_hipStreamCreateWithFlags, // [363] HRR_API_HIPSTREAMCREATEWITHFLAGS + playback_hipStreamCreateWithPriority, // [364] HRR_API_HIPSTREAMCREATEWITHPRIORITY + playback_hipStreamDestroy, // [365] HRR_API_HIPSTREAMDESTROY + playback_hipStreamEndCapture, // [366] HRR_API_HIPSTREAMENDCAPTURE + playback_hipStreamGetCaptureInfo, // [367] HRR_API_HIPSTREAMGETCAPTUREINFO + playback_hipStreamGetCaptureInfo_v2, // [368] HRR_API_HIPSTREAMGETCAPTUREINFO_V2 + playback_hipStreamGetDevice, // [369] HRR_API_HIPSTREAMGETDEVICE + playback_hipStreamGetFlags, // [370] HRR_API_HIPSTREAMGETFLAGS + playback_hipStreamGetId, // [371] HRR_API_HIPSTREAMGETID + playback_hipStreamGetPriority, // [372] HRR_API_HIPSTREAMGETPRIORITY + playback_hipStreamIsCapturing, // [373] HRR_API_HIPSTREAMISCAPTURING + playback_hipStreamQuery, // [374] HRR_API_HIPSTREAMQUERY + playback_hipStreamSynchronize, // [375] HRR_API_HIPSTREAMSYNCHRONIZE + playback_hipStreamUpdateCaptureDependencies, // [376] HRR_API_HIPSTREAMUPDATECAPTUREDEPENDENCIES + playback_hipStreamWaitEvent, // [377] HRR_API_HIPSTREAMWAITEVENT + playback_hipStreamWaitValue32, // [378] HRR_API_HIPSTREAMWAITVALUE32 + playback_hipStreamWaitValue64, // [379] HRR_API_HIPSTREAMWAITVALUE64 + playback_hipStreamWriteValue32, // [380] HRR_API_HIPSTREAMWRITEVALUE32 + playback_hipStreamWriteValue64, // [381] HRR_API_HIPSTREAMWRITEVALUE64 + playback_hipStreamBatchMemOp, // [382] HRR_API_HIPSTREAMBATCHMEMOP + playback_hipTexObjectCreate, // [383] HRR_API_HIPTEXOBJECTCREATE + playback_hipTexObjectDestroy, // [384] HRR_API_HIPTEXOBJECTDESTROY + playback_hipTexObjectGetResourceDesc, // [385] HRR_API_HIPTEXOBJECTGETRESOURCEDESC + playback_hipTexObjectGetResourceViewDesc, // [386] HRR_API_HIPTEXOBJECTGETRESOURCEVIEWDESC + playback_hipTexObjectGetTextureDesc, // [387] HRR_API_HIPTEXOBJECTGETTEXTUREDESC + playback_hipTexRefGetAddress, // [388] HRR_API_HIPTEXREFGETADDRESS + playback_hipTexRefGetAddressMode, // [389] HRR_API_HIPTEXREFGETADDRESSMODE + playback_hipTexRefGetFilterMode, // [390] HRR_API_HIPTEXREFGETFILTERMODE + playback_hipTexRefGetFlags, // [391] HRR_API_HIPTEXREFGETFLAGS + playback_hipTexRefGetFormat, // [392] HRR_API_HIPTEXREFGETFORMAT + playback_hipTexRefGetMaxAnisotropy, // [393] HRR_API_HIPTEXREFGETMAXANISOTROPY + playback_hipTexRefGetMipMappedArray, // [394] HRR_API_HIPTEXREFGETMIPMAPPEDARRAY + playback_hipTexRefGetMipmapFilterMode, // [395] HRR_API_HIPTEXREFGETMIPMAPFILTERMODE + playback_hipTexRefGetMipmapLevelBias, // [396] HRR_API_HIPTEXREFGETMIPMAPLEVELBIAS + playback_hipTexRefGetMipmapLevelClamp, // [397] HRR_API_HIPTEXREFGETMIPMAPLEVELCLAMP + playback_hipTexRefSetAddress, // [398] HRR_API_HIPTEXREFSETADDRESS + playback_hipTexRefSetAddress2D, // [399] HRR_API_HIPTEXREFSETADDRESS2D + playback_hipTexRefSetAddressMode, // [400] HRR_API_HIPTEXREFSETADDRESSMODE + playback_hipTexRefSetArray, // [401] HRR_API_HIPTEXREFSETARRAY + playback_hipTexRefSetBorderColor, // [402] HRR_API_HIPTEXREFSETBORDERCOLOR + playback_hipTexRefSetFilterMode, // [403] HRR_API_HIPTEXREFSETFILTERMODE + playback_hipTexRefSetFlags, // [404] HRR_API_HIPTEXREFSETFLAGS + playback_hipTexRefSetFormat, // [405] HRR_API_HIPTEXREFSETFORMAT + playback_hipTexRefSetMaxAnisotropy, // [406] HRR_API_HIPTEXREFSETMAXANISOTROPY + playback_hipTexRefSetMipmapFilterMode, // [407] HRR_API_HIPTEXREFSETMIPMAPFILTERMODE + playback_hipTexRefSetMipmapLevelBias, // [408] HRR_API_HIPTEXREFSETMIPMAPLEVELBIAS + playback_hipTexRefSetMipmapLevelClamp, // [409] HRR_API_HIPTEXREFSETMIPMAPLEVELCLAMP + playback_hipTexRefSetMipmappedArray, // [410] HRR_API_HIPTEXREFSETMIPMAPPEDARRAY + playback_hipThreadExchangeStreamCaptureMode, // [411] HRR_API_HIPTHREADEXCHANGESTREAMCAPTUREMODE + playback_hipUnbindTexture, // [412] HRR_API_HIPUNBINDTEXTURE + playback_hipUserObjectCreate, // [413] HRR_API_HIPUSEROBJECTCREATE + playback_hipUserObjectRelease, // [414] HRR_API_HIPUSEROBJECTRELEASE + playback_hipUserObjectRetain, // [415] HRR_API_HIPUSEROBJECTRETAIN + playback_hipWaitExternalSemaphoresAsync, // [416] HRR_API_HIPWAITEXTERNALSEMAPHORESASYNC + playback_hipMemcpy_spt, // [417] HRR_API_HIPMEMCPY_SPT + playback_hipMemcpyToSymbol_spt, // [418] HRR_API_HIPMEMCPYTOSYMBOL_SPT + playback_hipMemcpyFromSymbol_spt, // [419] HRR_API_HIPMEMCPYFROMSYMBOL_SPT + playback_hipMemcpy2D_spt, // [420] HRR_API_HIPMEMCPY2D_SPT + playback_hipMemcpy2DFromArray_spt, // [421] HRR_API_HIPMEMCPY2DFROMARRAY_SPT + playback_hipMemcpy3D_spt, // [422] HRR_API_HIPMEMCPY3D_SPT + playback_hipMemset_spt, // [423] HRR_API_HIPMEMSET_SPT + playback_hipMemsetAsync_spt, // [424] HRR_API_HIPMEMSETASYNC_SPT + playback_hipMemset2D_spt, // [425] HRR_API_HIPMEMSET2D_SPT + playback_hipMemset2DAsync_spt, // [426] HRR_API_HIPMEMSET2DASYNC_SPT + playback_hipMemset3DAsync_spt, // [427] HRR_API_HIPMEMSET3DASYNC_SPT + playback_hipMemset3D_spt, // [428] HRR_API_HIPMEMSET3D_SPT + playback_hipMemcpyAsync_spt, // [429] HRR_API_HIPMEMCPYASYNC_SPT + playback_hipMemcpy3DAsync_spt, // [430] HRR_API_HIPMEMCPY3DASYNC_SPT + playback_hipMemcpy2DAsync_spt, // [431] HRR_API_HIPMEMCPY2DASYNC_SPT + playback_hipMemcpyFromSymbolAsync_spt, // [432] HRR_API_HIPMEMCPYFROMSYMBOLASYNC_SPT + playback_hipMemcpyToSymbolAsync_spt, // [433] HRR_API_HIPMEMCPYTOSYMBOLASYNC_SPT + playback_hipMemcpyFromArray_spt, // [434] HRR_API_HIPMEMCPYFROMARRAY_SPT + playback_hipMemcpy2DToArray_spt, // [435] HRR_API_HIPMEMCPY2DTOARRAY_SPT + playback_hipMemcpy2DFromArrayAsync_spt, // [436] HRR_API_HIPMEMCPY2DFROMARRAYASYNC_SPT + playback_hipMemcpy2DToArrayAsync_spt, // [437] HRR_API_HIPMEMCPY2DTOARRAYASYNC_SPT + playback_hipStreamQuery_spt, // [438] HRR_API_HIPSTREAMQUERY_SPT + playback_hipStreamSynchronize_spt, // [439] HRR_API_HIPSTREAMSYNCHRONIZE_SPT + playback_hipStreamGetPriority_spt, // [440] HRR_API_HIPSTREAMGETPRIORITY_SPT + playback_hipStreamWaitEvent_spt, // [441] HRR_API_HIPSTREAMWAITEVENT_SPT + playback_hipStreamGetFlags_spt, // [442] HRR_API_HIPSTREAMGETFLAGS_SPT + playback_hipStreamAddCallback_spt, // [443] HRR_API_HIPSTREAMADDCALLBACK_SPT + playback_hipEventRecord_spt, // [444] HRR_API_HIPEVENTRECORD_SPT + playback_hipLaunchCooperativeKernel_spt, // [445] HRR_API_HIPLAUNCHCOOPERATIVEKERNEL_SPT + playback_hipLaunchKernel_spt, // [446] HRR_API_HIPLAUNCHKERNEL_SPT + playback_hipGraphLaunch_spt, // [447] HRR_API_HIPGRAPHLAUNCH_SPT + playback_hipStreamBeginCapture_spt, // [448] HRR_API_HIPSTREAMBEGINCAPTURE_SPT + playback_hipStreamEndCapture_spt, // [449] HRR_API_HIPSTREAMENDCAPTURE_SPT + playback_hipStreamIsCapturing_spt, // [450] HRR_API_HIPSTREAMISCAPTURING_SPT + playback_hipStreamGetCaptureInfo_spt, // [451] HRR_API_HIPSTREAMGETCAPTUREINFO_SPT + playback_hipStreamGetCaptureInfo_v2_spt, // [452] HRR_API_HIPSTREAMGETCAPTUREINFO_V2_SPT + playback_hipLaunchHostFunc_spt, // [453] HRR_API_HIPLAUNCHHOSTFUNC_SPT + playback_hipCreateChannelDesc, // [454] HRR_API_HIPCREATECHANNELDESC + playback_hipExtModuleLaunchKernel, // [455] HRR_API_HIPEXTMODULELAUNCHKERNEL + playback_hipHccModuleLaunchKernel, // [456] HRR_API_HIPHCCMODULELAUNCHKERNEL + playback_hipGetStreamDeviceId, // [457] HRR_API_HIPGETSTREAMDEVICEID + playback_hipDrvGraphAddMemsetNode, // [458] HRR_API_HIPDRVGRAPHADDMEMSETNODE + playback_hipGraphAddExternalSemaphoresWaitNode, // [459] HRR_API_HIPGRAPHADDEXTERNALSEMAPHORESWAITNODE + playback_hipGraphAddExternalSemaphoresSignalNode, // [460] HRR_API_HIPGRAPHADDEXTERNALSEMAPHORESSIGNALNODE + playback_hipGraphExternalSemaphoresSignalNodeSetParams, // [461] HRR_API_HIPGRAPHEXTERNALSEMAPHORESSIGNALNODESETPARAMS + playback_hipGraphExternalSemaphoresWaitNodeSetParams, // [462] HRR_API_HIPGRAPHEXTERNALSEMAPHORESWAITNODESETPARAMS + playback_hipGraphExternalSemaphoresSignalNodeGetParams, // [463] HRR_API_HIPGRAPHEXTERNALSEMAPHORESSIGNALNODEGETPARAMS + playback_hipGraphExternalSemaphoresWaitNodeGetParams, // [464] HRR_API_HIPGRAPHEXTERNALSEMAPHORESWAITNODEGETPARAMS + playback_hipGraphExecExternalSemaphoresSignalNodeSetParams, // [465] HRR_API_HIPGRAPHEXECEXTERNALSEMAPHORESSIGNALNODESETPARAMS + playback_hipGraphExecExternalSemaphoresWaitNodeSetParams, // [466] HRR_API_HIPGRAPHEXECEXTERNALSEMAPHORESWAITNODESETPARAMS + playback_hipGraphAddNode, // [467] HRR_API_HIPGRAPHADDNODE + playback_hipGraphInstantiateWithParams, // [468] HRR_API_HIPGRAPHINSTANTIATEWITHPARAMS + playback_hipExtGetLastError, // [469] HRR_API_HIPEXTGETLASTERROR + playback_hipTexRefGetBorderColor, // [470] HRR_API_HIPTEXREFGETBORDERCOLOR + playback_hipTexRefGetArray, // [471] HRR_API_HIPTEXREFGETARRAY + playback_hipGetProcAddress, // [472] HRR_API_HIPGETPROCADDRESS + playback_hipStreamBeginCaptureToGraph, // [473] HRR_API_HIPSTREAMBEGINCAPTURETOGRAPH + playback_hipGetFuncBySymbol, // [474] HRR_API_HIPGETFUNCBYSYMBOL + playback_hipDrvGraphAddMemFreeNode, // [475] HRR_API_HIPDRVGRAPHADDMEMFREENODE + playback_hipDrvGraphExecMemcpyNodeSetParams, // [476] HRR_API_HIPDRVGRAPHEXECMEMCPYNODESETPARAMS + playback_hipDrvGraphExecMemsetNodeSetParams, // [477] HRR_API_HIPDRVGRAPHEXECMEMSETNODESETPARAMS + playback_hipSetValidDevices, // [478] HRR_API_HIPSETVALIDDEVICES + playback_hipMemcpyAtoD, // [479] HRR_API_HIPMEMCPYATOD + playback_hipMemcpyDtoA, // [480] HRR_API_HIPMEMCPYDTOA + playback_hipMemcpyAtoA, // [481] HRR_API_HIPMEMCPYATOA + playback_hipMemcpyAtoHAsync, // [482] HRR_API_HIPMEMCPYATOHASYNC + playback_hipMemcpyHtoAAsync, // [483] HRR_API_HIPMEMCPYHTOAASYNC + playback_hipMemcpy2DArrayToArray, // [484] HRR_API_HIPMEMCPY2DARRAYTOARRAY + playback_hipGraphExecGetFlags, // [485] HRR_API_HIPGRAPHEXECGETFLAGS + playback_hipGraphNodeSetParams, // [486] HRR_API_HIPGRAPHNODESETPARAMS + playback_hipGraphExecNodeSetParams, // [487] HRR_API_HIPGRAPHEXECNODESETPARAMS + playback_hipExternalMemoryGetMappedMipmappedArray, // [488] HRR_API_HIPEXTERNALMEMORYGETMAPPEDMIPMAPPEDARRAY + playback_hipDrvGraphMemcpyNodeGetParams, // [489] HRR_API_HIPDRVGRAPHMEMCPYNODEGETPARAMS + playback_hipDrvGraphMemcpyNodeSetParams, // [490] HRR_API_HIPDRVGRAPHMEMCPYNODESETPARAMS + playback_hipExtHostAlloc, // [491] HRR_API_HIPEXTHOSTALLOC + playback_hipDeviceGetTexture1DLinearMaxWidth, // [492] HRR_API_HIPDEVICEGETTEXTURE1DLINEARMAXWIDTH + playback_hipGraphAddBatchMemOpNode, // [493] HRR_API_HIPGRAPHADDBATCHMEMOPNODE + playback_hipGraphBatchMemOpNodeGetParams, // [494] HRR_API_HIPGRAPHBATCHMEMOPNODEGETPARAMS + playback_hipGraphBatchMemOpNodeSetParams, // [495] HRR_API_HIPGRAPHBATCHMEMOPNODESETPARAMS + playback_hipGraphExecBatchMemOpNodeSetParams, // [496] HRR_API_HIPGRAPHEXECBATCHMEMOPNODESETPARAMS + playback_hipEventRecordWithFlags, // [497] HRR_API_HIPEVENTRECORDWITHFLAGS + playback_hipLaunchKernelExC, // [498] HRR_API_HIPLAUNCHKERNELEXC + playback_hipDrvLaunchKernelEx, // [499] HRR_API_HIPDRVLAUNCHKERNELEX + playback_hipMemGetHandleForAddressRange, // [500] HRR_API_HIPMEMGETHANDLEFORADDRESSRANGE + playback_hipMemsetD2D8, // [501] HRR_API_HIPMEMSETD2D8 + playback_hipMemsetD2D8Async, // [502] HRR_API_HIPMEMSETD2D8ASYNC + playback_hipMemsetD2D16, // [503] HRR_API_HIPMEMSETD2D16 + playback_hipMemsetD2D16Async, // [504] HRR_API_HIPMEMSETD2D16ASYNC + playback_hipMemsetD2D32, // [505] HRR_API_HIPMEMSETD2D32 + playback_hipMemsetD2D32Async, // [506] HRR_API_HIPMEMSETD2D32ASYNC + playback_hipStreamSetAttribute, // [507] HRR_API_HIPSTREAMSETATTRIBUTE + playback_hipStreamGetAttribute, // [508] HRR_API_HIPSTREAMGETATTRIBUTE + playback_hipModuleLoadFatBinary, // [509] HRR_API_HIPMODULELOADFATBINARY + playback_hipMemcpyBatchAsync, // [510] HRR_API_HIPMEMCPYBATCHASYNC + playback_hipMemcpy3DBatchAsync, // [511] HRR_API_HIPMEMCPY3DBATCHASYNC + playback_hipMemcpy3DPeer, // [512] HRR_API_HIPMEMCPY3DPEER + playback_hipMemcpy3DPeerAsync, // [513] HRR_API_HIPMEMCPY3DPEERASYNC + playback_hipGetDriverEntryPoint, // [514] HRR_API_HIPGETDRIVERENTRYPOINT + playback_hipGetDriverEntryPoint_spt, // [515] HRR_API_HIPGETDRIVERENTRYPOINT_SPT + playback_hipLibraryLoadData, // [516] HRR_API_HIPLIBRARYLOADDATA + playback_hipLibraryLoadFromFile, // [517] HRR_API_HIPLIBRARYLOADFROMFILE + playback_hipLibraryUnload, // [518] HRR_API_HIPLIBRARYUNLOAD + playback_hipLibraryGetKernel, // [519] HRR_API_HIPLIBRARYGETKERNEL + playback_hipLibraryGetKernelCount, // [520] HRR_API_HIPLIBRARYGETKERNELCOUNT + playback_hipLibraryGetGlobal, // [521] HRR_API_HIPLIBRARYGETGLOBAL + playback_hipLibraryGetManaged, // [522] HRR_API_HIPLIBRARYGETMANAGED + playback_hipLibraryEnumerateKernels, // [523] HRR_API_HIPLIBRARYENUMERATEKERNELS + playback_hipKernelGetLibrary, // [524] HRR_API_HIPKERNELGETLIBRARY + playback_hipKernelGetName, // [525] HRR_API_HIPKERNELGETNAME + playback_hipGetProcAddress_spt, // [526] HRR_API_HIPGETPROCADDRESS_SPT + playback_hipExtDisableLogging, // [527] HRR_API_HIPEXTDISABLELOGGING + playback_hipExtEnableLogging, // [528] HRR_API_HIPEXTENABLELOGGING + playback_hipExtSetLoggingParams, // [529] HRR_API_HIPEXTSETLOGGINGPARAMS + playback_hipKernelGetAttribute, // [530] HRR_API_HIPKERNELGETATTRIBUTE + playback_hipKernelSetAttribute, // [531] HRR_API_HIPKERNELSETATTRIBUTE + playback_hipKernelGetFunction, // [532] HRR_API_HIPKERNELGETFUNCTION + playback_hipKernelGetParamInfo, // [533] HRR_API_HIPKERNELGETPARAMINFO + playback_hipMemSetMemPool, // [534] HRR_API_HIPMEMSETMEMPOOL + playback_hipMemGetMemPool, // [535] HRR_API_HIPMEMGETMEMPOOL + playback_hipMipmappedArrayGetMemoryRequirements, // [536] HRR_API_HIPMIPMAPPEDARRAYGETMEMORYREQUIREMENTS + playback_hipGreenCtxCreate, // [537] HRR_API_HIPGREENCTXCREATE + playback_hipExecutionCtxDestroy, // [538] HRR_API_HIPEXECUTIONCTXDESTROY + playback_hipExecutionCtxStreamCreate, // [539] HRR_API_HIPEXECUTIONCTXSTREAMCREATE + playback_hipDeviceGetDevResource, // [540] HRR_API_HIPDEVICEGETDEVRESOURCE + playback_hipDevSmResourceSplitByCount, // [541] HRR_API_HIPDEVSMRESOURCESPLITBYCOUNT + playback_hipDevSmResourceSplit, // [542] HRR_API_HIPDEVSMRESOURCESPLIT + playback_hipDevResourceGenerateDesc, // [543] HRR_API_HIPDEVRESOURCEGENERATEDESC + playback_hipDeviceGetExecutionCtx, // [544] HRR_API_HIPDEVICEGETEXECUTIONCTX + playback_hipExecutionCtxGetDevResource, // [545] HRR_API_HIPEXECUTIONCTXGETDEVRESOURCE + playback_hipExecutionCtxGetDevice, // [546] HRR_API_HIPEXECUTIONCTXGETDEVICE + playback_hipExecutionCtxGetId, // [547] HRR_API_HIPEXECUTIONCTXGETID + playback_hipStreamGetDevResource, // [548] HRR_API_HIPSTREAMGETDEVRESOURCE + playback_hipExecutionCtxRecordEvent, // [549] HRR_API_HIPEXECUTIONCTXRECORDEVENT + playback_hipExecutionCtxSynchronize, // [550] HRR_API_HIPEXECUTIONCTXSYNCHRONIZE + playback_hipExecutionCtxWaitEvent, // [551] HRR_API_HIPEXECUTIONCTXWAITEVENT + playback_hipMemGetDefaultMemPool, // [552] HRR_API_HIPMEMGETDEFAULTMEMPOOL }; diff --git a/projects/clr/hipamd/src/hrr/playback/hrr_playback.cpp b/projects/hrr/playback/hrr_playback.cpp similarity index 100% rename from projects/clr/hipamd/src/hrr/playback/hrr_playback.cpp rename to projects/hrr/playback/hrr_playback.cpp diff --git a/projects/clr/hipamd/src/hrr/playback/hrr_reader.cpp b/projects/hrr/playback/hrr_reader.cpp similarity index 100% rename from projects/clr/hipamd/src/hrr/playback/hrr_reader.cpp rename to projects/hrr/playback/hrr_reader.cpp diff --git a/projects/clr/hipamd/src/hrr/playback/hrr_reader.h b/projects/hrr/playback/hrr_reader.h similarity index 99% rename from projects/clr/hipamd/src/hrr/playback/hrr_reader.h rename to projects/hrr/playback/hrr_reader.h index ec41e17547d9..12f1088691af 100644 --- a/projects/clr/hipamd/src/hrr/playback/hrr_reader.h +++ b/projects/hrr/playback/hrr_reader.h @@ -13,7 +13,7 @@ #include // hrr_api_args.h — HRR_API_* enum values and hrr_api_names[] string table -#include "hrr_api_args.h" +#include "hrr/hrr_api_args.h" // HRR Archive Reader — reads .hrr trace archives produced by the in-tree // capture layer (HIP_HRR_CAPTURE_OUTPUT). diff --git a/projects/clr/hipamd/src/hrr/skills/decode-and-triage/SKILL.md b/projects/hrr/skills/decode-and-triage/SKILL.md similarity index 92% rename from projects/clr/hipamd/src/hrr/skills/decode-and-triage/SKILL.md rename to projects/hrr/skills/decode-and-triage/SKILL.md index d4d4dd97b59c..7244693b8f55 100644 --- a/projects/clr/hipamd/src/hrr/skills/decode-and-triage/SKILL.md +++ b/projects/hrr/skills/decode-and-triage/SKILL.md @@ -27,19 +27,19 @@ manifest preflight, and finding output. **Run from:** any working directory. On Linux, invoke by absolute path: ```bash -/projects/clr/hipamd/src/hrr/skills/decode-and-triage/scripts/triage_archive.sh \ +/projects/hrr/skills/decode-and-triage/scripts/triage_archive.sh \ --archive /capture.hrr/pid- ``` On Windows, invoke by absolute path: ```powershell -\projects\clr\hipamd\src\hrr\skills\decode-and-triage\scripts\triage_archive.ps1 ` +\projects\hrr\skills\decode-and-triage\scripts\triage_archive.ps1 ` --archive \capture.hrr\pid- ``` -Scripts locate the colocated CLR tree from their install path; you do not need to -`cd` into `rocm-systems` first. +Scripts locate the colocated `projects/hrr` project from their install path; you do +not need to `cd` into `rocm-systems` first. Print the **finding markdown** that `triage_archive.sh` / `triage_archive.ps1` writes to stdout. @@ -48,10 +48,10 @@ Print the **finding markdown** that `triage_archive.sh` / `triage_archive.ps1` w | Capability | Windows today | |------------|---------------| | Full skill via `triage_archive.ps1` | **Yes** — PowerShell port with native GPU replay, manifest preflight, and `.finding.md` output | -| Locate / build `hrr-playback.exe` | **Yes** — `ensure_playback.ps1` searches `HRR_PLAYBACK`, `CLR_BUILD`, `HIP_PATH\bin`, `PATH`; `--build` flag triggers CMake/Ninja build | +| Locate / build `hrr-playback.exe` | **Yes** — `ensure_playback.ps1` searches `HRR_PLAYBACK`, `HIP_PATH\bin`, `ROCM_PATH\bin`, `PATH`; `--build` builds `hrr-playback` from `projects/hrr` | | Metadata-only triage (`--no-replay`) | **Yes** — `triage_archive.ps1 --no-replay` or `python analyze_replay_finding.py --archive ` | | Native GPU replay | **Yes** — `triage_archive.ps1` launches `hrr-playback.exe` via `Start-Process` with stdout/stderr capture | -| Auto-build `hrr-playback.exe` | **Yes** — `ensure_playback.ps1 --build`; set `CLR_BUILD` to existing tree | +| Auto-build `hrr-playback.exe` | **Yes** — `ensure_playback.ps1 --build` builds `hrr-playback` from `projects/hrr` into a dedicated HRR build dir | | Docker replay (`--replay docker`) | **No** — requires a Linux host with Docker and GPU passthrough; use WSL2 or a Linux SSH host | | Container captures (e.g. vLLM image) | Replay on **Linux** (native or Docker); on Windows use `triage_archive.ps1` native replay if the Windows HIP stack matches | @@ -63,8 +63,8 @@ absent and cannot be built. ```powershell # From the skill scripts directory: -.\ensure_playback.ps1 # find existing binary (checks HRR_PLAYBACK, CLR_BUILD, HIP_PATH\bin, PATH) -.\ensure_playback.ps1 --build # also build from source if not found +.\ensure_playback.ps1 # find existing binary (checks HRR_PLAYBACK, HIP_PATH\bin, ROCM_PATH\bin, PATH) +.\ensure_playback.ps1 --build # also build hrr-playback from projects/hrr if not found ``` Set `$env:HRR_PLAYBACK` to the path printed, or let `triage_archive.ps1` call it automatically. @@ -89,7 +89,7 @@ Environment variables on Windows: |---|---| | `HRR_PLAYBACK` | Explicit `hrr-playback.exe` path | | `HIP_PATH` or `ROCM_PATH` | HIP SDK root (default: `C:\Program Files\AMD\ROCm\6.2`) | -| `CLR_BUILD` | Existing build tree containing `hrr-playback.exe` | +| `HRR_BUILD` | Dedicated HRR build dir for `--build` (default: `projects/hrr\build-playback`) | | `GPU` | GPU ordinal for replay (default: `0`) | | `HRR_TRIAGE_WORKDIR` | Output dir for findings + logs | | `HRR_CONTINUE=1` | Proceed past HIP/comgr version mismatch | @@ -122,7 +122,7 @@ When the HIP app runs on a Remote Desktop machine without Cursor, copy the four standalone script files and run them directly: ``` -projects\clr\hipamd\src\hrr\skills\decode-and-triage\scripts\ +projects\hrr\skills\decode-and-triage\scripts\ triage_archive.ps1 ensure_playback.ps1 analyze_replay_finding.py @@ -239,7 +239,7 @@ Classify each finding using these labels: | Situation | Action | |-----------|--------| -| `--build` fails (`rocdevice.cpp` etc.) | Set `CLR_BUILD` to existing `projects/clr/build-hrr*`; re-run. | +| `--build` fails | Install `hrr-playback` under `$ROCM_PATH/bin` or set `HRR_PLAYBACK`; ensure a capture-enabled ROCm/HIP prefix (see README build section). | | Native replay fails (Linux) | Docker replay with capture image (Linux host). | | Native replay fails (Windows) | Check `HRR_PLAYBACK`, `HIP_PATH\bin` on `PATH`; use `--no-replay` as fallback. | | Windows host, no GPU | Metadata-only via `triage_archive.ps1 --no-replay` or `analyze_replay_finding.py --archive`. | diff --git a/projects/clr/hipamd/src/hrr/skills/decode-and-triage/scripts/analyze_replay_finding.py b/projects/hrr/skills/decode-and-triage/scripts/analyze_replay_finding.py similarity index 100% rename from projects/clr/hipamd/src/hrr/skills/decode-and-triage/scripts/analyze_replay_finding.py rename to projects/hrr/skills/decode-and-triage/scripts/analyze_replay_finding.py diff --git a/projects/clr/hipamd/src/hrr/skills/decode-and-triage/scripts/check_replay_compat.py b/projects/hrr/skills/decode-and-triage/scripts/check_replay_compat.py similarity index 99% rename from projects/clr/hipamd/src/hrr/skills/decode-and-triage/scripts/check_replay_compat.py rename to projects/hrr/skills/decode-and-triage/scripts/check_replay_compat.py index 982e6f199381..90443641b85a 100644 --- a/projects/clr/hipamd/src/hrr/skills/decode-and-triage/scripts/check_replay_compat.py +++ b/projects/hrr/skills/decode-and-triage/scripts/check_replay_compat.py @@ -507,7 +507,8 @@ def resolve_clr_lib_dir( if hrr_playback: play = Path(hrr_playback) if play.is_file(): - path = (play.parent / "../../../lib").resolve() + # Installed layout: /bin/hrr-playback -> /lib + path = (play.parent / ".." / "lib").resolve() if path.is_dir() and any(path.glob("libamdhip64.so*")): return path return None diff --git a/projects/hrr/skills/decode-and-triage/scripts/ensure_playback.ps1 b/projects/hrr/skills/decode-and-triage/scripts/ensure_playback.ps1 new file mode 100644 index 000000000000..5c29811a2336 --- /dev/null +++ b/projects/hrr/skills/decode-and-triage/scripts/ensure_playback.ps1 @@ -0,0 +1,192 @@ +#!/usr/bin/env pwsh +# Locate hrr-playback.exe; optionally build the standalone projects/hrr playback tool (--build). +# Prints the absolute path to stdout on success. +# +# Usage: +# .\ensure_playback.ps1 [--build] +# +# Discovery order (no build): HRR_PLAYBACK env, HIP_PATH\bin / ROCM_PATH\bin, then PATH. +# --build: configure + build hrr-playback from projects/hrr into a dedicated HRR build +# dir (never a CLR build dir), against a capture-enabled ROCm/HIP prefix. +# +# Environment: +# HRR_PLAYBACK Explicit binary path (checked first) +# HIP_PATH / ROCM_PATH Capture-enabled ROCm/HIP prefix (default: C:\Program Files\AMD\ROCm\6.2) +# HRR_BUILD Dedicated HRR build dir (default: \build-playback) +# HRR_ENSURE_BUILD=1 Same as passing --build +# --------------------------------------------------------------------------- +Set-StrictMode -Version Latest +$ErrorActionPreference = "Stop" + +# Declare variables — no param() block so $args is always the raw token list +$Build = $false +$Help = $false + +$ScriptDir = $PSScriptRoot +# scripts -> decode-and-triage -> skills -> hrr (the standalone HRR project root) +$HrrProjectDir = (Resolve-Path (Join-Path $ScriptDir "..\..\..")).Path +# Discovery roots, in order: HIP_PATH, then ROCM_PATH (both when set), else default. +$HipRoots = @() +if ($env:HIP_PATH) { $HipRoots += $env:HIP_PATH } +if ($env:ROCM_PATH) { $HipRoots += $env:ROCM_PATH } +if ($HipRoots.Count -eq 0) { $HipRoots += "C:\Program Files\AMD\ROCm\6.2" } +# Primary root used for the --build configure (ROCM_PATH / CMAKE_PREFIX_PATH default). +$HipRoot = $HipRoots[0] + +# Parse flags from $args directly (no param() block — avoids PS binder interference) +foreach ($tok in $args) { + switch -Exact ($tok) { + "--build" { $Build = $true } + "--help" { $Help = $true } + "-h" { $Help = $true } + default { Write-Host "error: unknown arg: $tok" -ForegroundColor Red; exit 1 } + } +} + +if ($Help) { + @" +usage: ensure_playback.ps1 [--build] + default: locate an existing hrr-playback.exe (no build) + --build: configure + build hrr-playback from projects/hrr when not found + +Searched in order: + HRR_PLAYBACK env, HIP_PATH\bin, ROCM_PATH\bin, PATH. +"@ | Write-Host -ForegroundColor Cyan + exit 0 +} + +if ($env:HRR_ENSURE_BUILD -eq "1") { $Build = $true } + +# --------------------------------------------------------------------------- +# Probe known HIP SDK / ROCm install paths and PATH +# --------------------------------------------------------------------------- +function Find-InHipSdk { + foreach ($root in $HipRoots) { + foreach ($sub in @("bin", "hip\bin", "tools\bin")) { + $dir = Join-Path $root $sub + foreach ($name in @("hrr-playback.exe", "hrr-playback")) { + $p = Join-Path $dir $name + if (Test-Path $p -PathType Leaf) { return $p } + } + } + } + # PATH fallback + $cmd = Get-Command "hrr-playback.exe" -ErrorAction SilentlyContinue + if ($cmd) { return $cmd.Source } + $cmd = Get-Command "hrr-playback" -ErrorAction SilentlyContinue + if ($cmd) { return $cmd.Source } + return $null +} + +# --------------------------------------------------------------------------- +# Find hrr-playback.exe inside a dedicated HRR build tree +# --------------------------------------------------------------------------- +function Find-InHrrBuild([string]$BuildDir) { + if (-not $BuildDir) { return $null } + foreach ($rel in @( + "playback\hrr-playback.exe", + "playback\hrr-playback", + "bin\hrr-playback.exe", + "bin\hrr-playback" + )) { + $p = Join-Path $BuildDir $rel + if (Test-Path $p -PathType Leaf) { return (Resolve-Path $p).Path } + } + $found = Get-ChildItem $BuildDir -Recurse -Filter "hrr-playback.exe" -ErrorAction SilentlyContinue | + Select-Object -First 1 + if ($found) { return $found.FullName } + return $null +} + +# --------------------------------------------------------------------------- +# STEP 1 — Honour explicit HRR_PLAYBACK env +# --------------------------------------------------------------------------- +if ($env:HRR_PLAYBACK -and (Test-Path $env:HRR_PLAYBACK -PathType Leaf)) { + Write-Host $env:HRR_PLAYBACK + exit 0 +} + +# --------------------------------------------------------------------------- +# STEP 2 — HIP SDK install / PATH +# --------------------------------------------------------------------------- +$sdkFound = Find-InHipSdk +if ($sdkFound) { Write-Host $sdkFound; exit 0 } + +# --------------------------------------------------------------------------- +# STEP 3 — Build (only when --build requested) +# --------------------------------------------------------------------------- +if (-not $Build) { + Write-Host @" +[ensure_playback] hrr-playback.exe not found. + +Choose one of the options below: + + 1. Point at an existing binary: + `$env:HRR_PLAYBACK = 'C:\path\to\hrr-playback.exe' + + 2. Install a capture-enabled ROCm/HIP SDK so hrr-playback.exe is under HIP_PATH\bin: + `$env:HIP_PATH = 'C:\Program Files\AMD\ROCm\6.2' + + 3. Build hrr-playback from projects/hrr: + .\ensure_playback.ps1 --build + + 4. Triage without replay (no binary needed — reads manifest.json only): + .\triage_archive.ps1 --archive --no-replay +"@ -ForegroundColor Yellow + exit 1 +} + +$CMakeLists = Join-Path $HrrProjectDir "CMakeLists.txt" +if (-not (Test-Path $CMakeLists -PathType Leaf)) { + Write-Error "projects/hrr CMake project not found at $HrrProjectDir" + exit 1 +} + +$BuildOut = if ($env:HRR_BUILD) { $env:HRR_BUILD } else { Join-Path $HrrProjectDir "build-playback" } +New-Item -ItemType Directory -Force -Path $BuildOut | Out-Null + +# Reuse an existing build if it already produced hrr-playback. +$already = Find-InHrrBuild $BuildOut +if ($already) { Write-Host $already; exit 0 } + +Write-Host "[ensure_playback] configuring projects/hrr in $BuildOut" -ForegroundColor DarkGray + +# ---- CMake configure ------------------------------------------------------- +# ROCM_PATH / HIP_PATH must point to a capture-enabled ROCm/HIP install that +# provides hip::host / amdhip64 for the playback tool to link against. +$Prefix = if ($env:CMAKE_PREFIX_PATH) { $env:CMAKE_PREFIX_PATH } else { $HipRoot } +$CMakeArgs = @( + "-S", $HrrProjectDir, + "-B", $BuildOut, + "-DROCM_PATH=$HipRoot", + "-DCMAKE_PREFIX_PATH=$Prefix", + "-DHRR_BUILD_PLAYBACK=ON", + "-DHRR_BUILD_TESTS=OFF", + "-DCMAKE_BUILD_TYPE=Release" +) + +Write-Host "[ensure_playback] cmake $($CMakeArgs -join ' ')" -ForegroundColor DarkGray +cmake @CMakeArgs +if ($LASTEXITCODE -ne 0) { + Write-Error "CMake configure failed (exit $LASTEXITCODE). Review output above." + exit 1 +} + +# ---- Build ----------------------------------------------------------------- +Write-Host "[ensure_playback] cmake --build $BuildOut --target hrr-playback" -ForegroundColor DarkGray +cmake --build $BuildOut --target hrr-playback +if ($LASTEXITCODE -ne 0) { + Write-Error "build failed (exit $LASTEXITCODE). Review output above." + exit 1 +} + +# ---- Return path ----------------------------------------------------------- +$built = Find-InHrrBuild $BuildOut +if (-not $built) { + Write-Error "Build completed but hrr-playback.exe not found under $BuildOut" + exit 1 +} + +Write-Host "[ensure_playback] built: $built" -ForegroundColor DarkGray +Write-Host $built +exit 0 diff --git a/projects/hrr/skills/decode-and-triage/scripts/ensure_playback.sh b/projects/hrr/skills/decode-and-triage/scripts/ensure_playback.sh new file mode 100755 index 000000000000..f71631767187 --- /dev/null +++ b/projects/hrr/skills/decode-and-triage/scripts/ensure_playback.sh @@ -0,0 +1,131 @@ +#!/usr/bin/env bash +# Locate hrr-playback; optionally build the standalone projects/hrr playback tool (--build). +# Prints the absolute path to stdout on success. +# +# Discovery order (no build): explicit HRR_PLAYBACK, installed /bin, then PATH. +# --build: configure and build hrr-playback from projects/hrr into a dedicated HRR build +# dir (never a CLR build dir), against a capture-enabled ROCm/HIP prefix. +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +SKILL_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" +# scripts -> decode-and-triage -> skills -> hrr (the standalone HRR project root) +HRR_PROJECT_DIR="$(cd "$SCRIPT_DIR/../../.." && pwd)" +ROCM_PATH="${ROCM_PATH:-/opt/rocm}" +DO_BUILD=0 + +while [[ $# -gt 0 ]]; do + case "$1" in + --build) DO_BUILD=1; shift ;; + -h|--help) + echo "usage: ensure_playback.sh [--build]" >&2 + echo " default: find an existing hrr-playback (HRR_PLAYBACK, \$ROCM_PATH/bin, PATH)" >&2 + echo " --build: configure and build hrr-playback from projects/hrr when missing" >&2 + exit 0 + ;; + *) echo "error: unknown arg: $1" >&2; exit 1 ;; + esac +done + +[[ "${HRR_ENSURE_BUILD:-0}" == 1 ]] && DO_BUILD=1 + +# Discovery: explicit HRR_PLAYBACK, then installed /bin, then PATH. +find_existing_playback() { + local p candidates=() + [[ -n "${HRR_PLAYBACK:-}" && -x "${HRR_PLAYBACK}" ]] && candidates+=("$HRR_PLAYBACK") + candidates+=("$ROCM_PATH/bin/hrr-playback") + if command -v hrr-playback >/dev/null 2>&1; then + candidates+=("$(command -v hrr-playback)") + fi + for p in "${candidates[@]}"; do + [[ -n "$p" && -x "$p" ]] || continue + echo "$p" + return + done + echo "" +} + +# A dedicated HRR build dir (never a CLR build dir). +resolve_hrr_build_dir() { + [[ -n "${HRR_BUILD:-}" ]] && { echo "$HRR_BUILD"; return; } + echo "$HRR_PROJECT_DIR/build-playback" +} + +playback_from_build() { + local build="$1" + [[ -n "$build" && -x "$build/playback/hrr-playback" ]] || return 1 + echo "$build/playback/hrr-playback" +} + +build_playback() { + local build="$1" + echo "[ensure_playback] configuring projects/hrr at $HRR_PROJECT_DIR (build=$build)" >&2 + cmake -S "$HRR_PROJECT_DIR" -B "$build" \ + -DROCM_PATH="$ROCM_PATH" \ + -DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH:-$ROCM_PATH}" \ + -DHRR_BUILD_PLAYBACK=ON -DHRR_BUILD_TESTS=OFF \ + -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:-Release}" + echo "[ensure_playback] building hrr-playback" >&2 + cmake --build "$build" --target hrr-playback -j"$(nproc)" +} + +export_playback_env() { + local play="$1" ld_parts=() + export HRR_PLAYBACK="$play" + [[ -d "$ROCM_PATH/lib" ]] && ld_parts+=("$ROCM_PATH/lib") + if [[ ${#ld_parts[@]} -gt 0 ]]; then + export LD_LIBRARY_PATH="$(IFS=:; echo "${ld_parts[*]}")${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" + fi +} + +fail_not_found() { + echo "error: hrr-playback not found." >&2 + if [[ "$DO_BUILD" -eq 0 ]]; then + echo "error: set HRR_PLAYBACK, install hrr-playback under $ROCM_PATH/bin, or re-run with --build." >&2 + echo "error: metadata-only: triage_archive.sh --archive --no-replay" >&2 + else + echo "error: build projects/hrr manually or set HRR_PLAYBACK (see SKILL.md)." >&2 + fi + return 1 +} + +main() { + local existing play build + + existing="$(find_existing_playback)" + if [[ -n "$existing" ]]; then + export_playback_env "$existing" + echo "$existing" + return 0 + fi + + [[ "$DO_BUILD" -eq 1 ]] || fail_not_found + + [[ -f "$HRR_PROJECT_DIR/CMakeLists.txt" ]] || { + echo "error: projects/hrr CMake project not found at $HRR_PROJECT_DIR" >&2 + fail_not_found + } + + build="$(resolve_hrr_build_dir)" + if play="$(playback_from_build "$build" 2>/dev/null)"; then + export_playback_env "$play" + echo "$play" + return 0 + fi + + command -v cmake >/dev/null 2>&1 || { + echo "error: cmake required to build hrr-playback" >&2 + fail_not_found + } + + build_playback "$build" + play="$(playback_from_build "$build")" + [[ -n "$play" ]] || { + echo "error: build finished but hrr-playback not found under $build" >&2 + fail_not_found + } + export_playback_env "$play" + echo "$play" +} + +main "$@" diff --git a/projects/clr/hipamd/src/hrr/skills/decode-and-triage/scripts/replay_docker.sh b/projects/hrr/skills/decode-and-triage/scripts/replay_docker.sh similarity index 80% rename from projects/clr/hipamd/src/hrr/skills/decode-and-triage/scripts/replay_docker.sh rename to projects/hrr/skills/decode-and-triage/scripts/replay_docker.sh index 1a16840927b5..90ee837dfbdd 100755 --- a/projects/clr/hipamd/src/hrr/skills/decode-and-triage/scripts/replay_docker.sh +++ b/projects/hrr/skills/decode-and-triage/scripts/replay_docker.sh @@ -25,8 +25,9 @@ Options: Environment: HRR_DOCKER_IMAGE Capture/replay container image (required) - HRR_DOCKER_MOUNT_CLR 1 = mount host hrr-playback + libamdhip64 from CLR_BUILD - HRR_PLAYBACK / CLR_BUILD Host playback binary / build tree (overlay mode) + HRR_DOCKER_MOUNT_CLR 1 = mount host hrr-playback + capture-enabled libamdhip64 + HRR_PLAYBACK Host hrr-playback (overlay mode; else /bin or PATH) + CLR_LIB / CLR_BUILD Host capture-enabled libamdhip64 dir / CLR build tree (overlay) ROCR_LIB Optional in-tree ROCR lib dir for overlay mode HRR_DOCKER_PLAYBACK Path to hrr-playback inside image (default: auto-detect) HRR_DOCKER_EXTRA_LD Extra LD_LIBRARY_PATH segment inside container @@ -105,15 +106,29 @@ PLAY_INSIDE="" LD_INSIDE="" if [[ "$MOUNT_CLR" == "1" ]]; then + # Host hrr-playback: explicit HRR_PLAYBACK, else installed /bin, else PATH. PLAY="${HRR_PLAYBACK:-}" - if [[ -z "$PLAY" && -n "${CLR_BUILD:-}" ]]; then - PLAY="${CLR_BUILD}/hipamd/src/hrr/playback/hrr-playback" + if [[ -z "$PLAY" ]]; then + if [[ -x "${ROCM_PATH:-/opt/rocm}/bin/hrr-playback" ]]; then + PLAY="${ROCM_PATH:-/opt/rocm}/bin/hrr-playback" + elif command -v hrr-playback >/dev/null 2>&1; then + PLAY="$(command -v hrr-playback)" + fi fi - [[ -x "$PLAY" ]] || { - echo "error: HRR_DOCKER_MOUNT_CLR=1 requires host hrr-playback (set HRR_PLAYBACK or CLR_BUILD)" >&2 + [[ -n "$PLAY" && -x "$PLAY" ]] || { + echo "error: HRR_DOCKER_MOUNT_CLR=1 requires host hrr-playback (set HRR_PLAYBACK or install under ROCM_PATH/bin)" >&2 exit 1 } - CLR_LIB="$(cd "$(dirname "$PLAY")/../../../lib" && pwd)" + # Matching capture-enabled libamdhip64: explicit CLR_LIB, else a host CLR build's hipamd/lib. + CLR_LIB="${CLR_LIB:-}" + if [[ -z "$CLR_LIB" && -n "${CLR_BUILD:-}" ]]; then + CLR_LIB="${CLR_BUILD}/hipamd/lib" + fi + [[ -n "$CLR_LIB" && -d "$CLR_LIB" ]] || { + echo "error: HRR_DOCKER_MOUNT_CLR=1 requires a capture-enabled libamdhip64 dir (set CLR_LIB or CLR_BUILD)" >&2 + exit 1 + } + CLR_LIB="$(cd "$CLR_LIB" && pwd)" ROCR_LIB="${HRR_DOCKER_ROCR_LIB:-${ROCR_LIB:-}}" LD_INSIDE="/opt/hrr/lib" [[ -n "$ROCR_LIB" && -d "$ROCR_LIB" ]] && LD_INSIDE="${LD_INSIDE}:/opt/hrr/rocr" diff --git a/projects/clr/hipamd/src/hrr/skills/decode-and-triage/scripts/test_analyze_replay_finding.py b/projects/hrr/skills/decode-and-triage/scripts/test_analyze_replay_finding.py similarity index 100% rename from projects/clr/hipamd/src/hrr/skills/decode-and-triage/scripts/test_analyze_replay_finding.py rename to projects/hrr/skills/decode-and-triage/scripts/test_analyze_replay_finding.py diff --git a/projects/clr/hipamd/src/hrr/skills/decode-and-triage/scripts/test_check_replay_compat.py b/projects/hrr/skills/decode-and-triage/scripts/test_check_replay_compat.py similarity index 95% rename from projects/clr/hipamd/src/hrr/skills/decode-and-triage/scripts/test_check_replay_compat.py rename to projects/hrr/skills/decode-and-triage/scripts/test_check_replay_compat.py index 2454f4e65055..48a62fd18af7 100644 --- a/projects/clr/hipamd/src/hrr/skills/decode-and-triage/scripts/test_check_replay_compat.py +++ b/projects/hrr/skills/decode-and-triage/scripts/test_check_replay_compat.py @@ -130,8 +130,12 @@ def test_strict_version_blocks_without_prompt(self) -> None: @mock.patch("check_replay_compat.probe_comgr_version", return_value="3.0") @mock.patch("check_replay_compat._run") + @mock.patch( + "check_replay_compat.shutil.which", + side_effect=lambda name: "/usr/bin/rocm-smi" if name == "rocm-smi" else None, + ) def test_probe_host_reads_comgr( - self, run_mock: mock.Mock, _comgr_mock: mock.Mock + self, _which_mock: mock.Mock, run_mock: mock.Mock, _comgr_mock: mock.Mock ) -> None: run_mock.return_value = mock.Mock( stdout="GPU[0]\tGPU[1]\nCard series: Instinct MI300X\nCard series: Instinct MI300X\n", @@ -165,12 +169,12 @@ def test_hip_version_from_mounted_clr_lib(self) -> None: def test_resolve_clr_lib_from_playback_path(self) -> None: with tempfile.TemporaryDirectory() as tmp: - root = Path(tmp) - lib_dir = root / "hipamd" / "lib" + root = Path(tmp) # install prefix + lib_dir = root / "lib" lib_dir.mkdir(parents=True) versioned = lib_dir / "libamdhip64.so.7.15.26291-abc" versioned.write_bytes(b"") - play = root / "hipamd" / "src" / "hrr" / "playback" / "hrr-playback" + play = root / "bin" / "hrr-playback" play.parent.mkdir(parents=True) play.write_bytes(b"") resolved = crc.resolve_clr_lib_dir(hrr_playback=str(play)) @@ -190,7 +194,7 @@ def test_resolve_replay_mounts_skips_without_overlay(self) -> None: clr, rocr, extra = crc.resolve_replay_mounts( docker_image="rocm/vllm:test", clr_build="/build", - hrr_playback="/build/hipamd/src/hrr/playback/hrr-playback", + hrr_playback="/opt/rocm/bin/hrr-playback", mount_clr=False, ) self.assertIsNone(clr) @@ -232,8 +236,9 @@ def test_build_docker_ld_inside_matches_replay_docker(self) -> None: @mock.patch("check_replay_compat._docker_cmd", side_effect=lambda *args: list(args)) @mock.patch("check_replay_compat._run") + @mock.patch("check_replay_compat.shutil.which", return_value="/usr/bin/docker") def test_probe_docker_mounts_clr_lib( - self, run_mock: mock.Mock, _docker_mock: mock.Mock + self, _which_mock: mock.Mock, run_mock: mock.Mock, _docker_mock: mock.Mock ) -> None: with tempfile.TemporaryDirectory() as tmp: lib_dir = Path(tmp) diff --git a/projects/clr/hipamd/src/hrr/skills/decode-and-triage/scripts/triage_archive.ps1 b/projects/hrr/skills/decode-and-triage/scripts/triage_archive.ps1 similarity index 98% rename from projects/clr/hipamd/src/hrr/skills/decode-and-triage/scripts/triage_archive.ps1 rename to projects/hrr/skills/decode-and-triage/scripts/triage_archive.ps1 index ef43370ead85..8e0fedfc08f3 100644 --- a/projects/clr/hipamd/src/hrr/skills/decode-and-triage/scripts/triage_archive.ps1 +++ b/projects/hrr/skills/decode-and-triage/scripts/triage_archive.ps1 @@ -359,7 +359,7 @@ if ($Mode -ne "skip") { Where-Object { $_ -notmatch '^\[' } | Select-Object -Last 1).Trim() } catch { - Write-Host "error: ensure_playback.ps1 --build failed. Set HRR_PLAYBACK or CLR_BUILD." -ForegroundColor Red + Write-Host "error: ensure_playback.ps1 --build failed. Set HRR_PLAYBACK or install hrr-playback under HIP_PATH\bin." -ForegroundColor Red exit 1 } } @@ -375,9 +375,9 @@ error: hrr-playback.exe not found. Options: 1. Set HRR_PLAYBACK=C:\path\to\hrr-playback.exe - 2. Set CLR_BUILD=C:\path\to\build-dir (must contain a built hrr-playback.exe) - 3. Run ensure_playback.ps1 --build (builds from source; requires CMake + Ninja + HIP SDK) - 4. Install HIP SDK and ensure hrr-playback.exe is in PATH or HIP_PATH\bin + 2. Install a capture-enabled ROCm/HIP SDK with hrr-playback.exe under HIP_PATH\bin + 3. Run ensure_playback.ps1 --build (builds hrr-playback from projects/hrr; requires CMake + HIP SDK) + 4. Ensure hrr-playback.exe is on PATH "@ -ForegroundColor Red exit 1 } diff --git a/projects/clr/hipamd/src/hrr/skills/decode-and-triage/scripts/triage_archive.sh b/projects/hrr/skills/decode-and-triage/scripts/triage_archive.sh similarity index 94% rename from projects/clr/hipamd/src/hrr/skills/decode-and-triage/scripts/triage_archive.sh rename to projects/hrr/skills/decode-and-triage/scripts/triage_archive.sh index b7b9b1610b0f..bab581fac2f0 100755 --- a/projects/clr/hipamd/src/hrr/skills/decode-and-triage/scripts/triage_archive.sh +++ b/projects/hrr/skills/decode-and-triage/scripts/triage_archive.sh @@ -70,13 +70,14 @@ pick_replay_mode() { } setup_library_path() { - local play="$1" bin_dir lib_dirs=() p seen="" clr built="" + local play="$1" bin_dir lib_dirs=() p seen="" repo built="" bin_dir="$(cd "$(dirname "$play")" && pwd)" - if [[ "$bin_dir" == *"/hipamd/src/hrr/playback" ]]; then - lib_dirs+=("$(cd "$bin_dir/../../../lib" && pwd)") + # Installed/standalone layout: hrr-playback in /bin -> matching libs in /lib. + if [[ "$bin_dir" == */bin ]]; then + lib_dirs+=("$(cd "$bin_dir/../lib" 2>/dev/null && pwd || true)") fi - clr="$(cd "$SCRIPT_DIR/../../../../../" 2>/dev/null && pwd || true)" - for p in "${ROCR_LIB:-}" "${clr:+$clr/../rocr-runtime/build-local/rocr/lib}"; do + repo="$(cd "$SCRIPT_DIR/../../../../.." 2>/dev/null && pwd || true)" + for p in "${ROCR_LIB:-}" "${repo:+$repo/projects/rocr-runtime/build-local/rocr/lib}"; do [[ -n "$p" && -f "$p/libhsa-runtime64.so.1" ]] || continue lib_dirs+=("$p"); break done diff --git a/projects/hrr/tests/CMakeLists.txt b/projects/hrr/tests/CMakeLists.txt new file mode 100644 index 000000000000..1e3e17203457 --- /dev/null +++ b/projects/hrr/tests/CMakeLists.txt @@ -0,0 +1,38 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT + +# HRR project tests. +# +# unit/ CPU-focused format, recovery, and playback-invariant tests. +# integration/ GPU capture/replay round-trip tests (require an AMD GPU and a +# capture-enabled HIP runtime). +# +# The HRR tests use a small local harness (hrr_test_common.hh / hrr_test_process.hh) +# instead of the hip-tests Catch2 infrastructure. + +option(HRR_BUILD_INTEGRATION_TESTS "Build HRR GPU capture/replay integration tests" ON) + +# Catch2 test framework. Prefer an installed Catch2 (as the hip-tests suite +# does); fall back to fetching the pinned tarball used across rocm-systems. +find_package(Catch2 3.8.1 QUIET) +if(NOT Catch2_FOUND) + include(FetchContent) + FetchContent_Declare( + Catch2 + URL "https://rocm-third-party-deps.s3.us-east-2.amazonaws.com/Catch2-3.8.1.tar.gz" + ) + FetchContent_MakeAvailable(Catch2) +endif() + +# HIP is needed for the HIP headers pulled in by the local test harness and the +# playback helper header, and for hip::host linkage in the integration tests. +# The unit tests make no HIP runtime calls, but their sources still include +# , so the HIP package (headers) is required to build them. +find_package(hip CONFIG REQUIRED) + +add_subdirectory(unit) + +if(HRR_BUILD_INTEGRATION_TESTS) + add_subdirectory(integration) +endif() diff --git a/projects/hrr/tests/hrr_test_common.hh b/projects/hrr/tests/hrr_test_common.hh new file mode 100644 index 000000000000..6885a1c7becb --- /dev/null +++ b/projects/hrr/tests/hrr_test_common.hh @@ -0,0 +1,38 @@ +/* + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ +#pragma once + +#include +#include + +// Local HRR test harness. +// +// The HRR project owns its behavior tests and must not depend on the hip-tests +// Catch2 infrastructure (the hip-tests Catch2 helper headers). These macros +// replace only the small pieces the migrated HRR tests actually use. + +// HRR_TEST_CASE mirrors the hip-tests test-case macro but with a fixed [hrr] tag so +// the HRR project's tests do not rely on the hip-tests GET_TAGS() config lookup. +#define HRR_TEST_CASE(name) TEST_CASE(#name, "[hrr]") + +// HRR_HIP_CHECK replaces the hip-tests HIP error check: fail the current Catch2 test if a HIP call +// does not return hipSuccess, reporting the error code and string. +#define HRR_HIP_CHECK(expr) \ + do { \ + hipError_t _hrr_err = (expr); \ + INFO("HIP call failed: " #expr); \ + INFO("hipError_t: " << static_cast(_hrr_err)); \ + INFO("hipGetErrorString: " << hipGetErrorString(_hrr_err)); \ + REQUIRE(_hrr_err == hipSuccess); \ + } while (0) + +// HRR_SKIP replaces the hip-tests skip macro: emit a warning describing why the current +// case is being skipped and return early. +#define HRR_SKIP(message) \ + do { \ + WARN(message); \ + return; \ + } while (0) diff --git a/projects/hrr/tests/hrr_test_process.hh b/projects/hrr/tests/hrr_test_process.hh new file mode 100644 index 000000000000..386d84e25c0d --- /dev/null +++ b/projects/hrr/tests/hrr_test_process.hh @@ -0,0 +1,267 @@ +/* + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ +#pragma once + +#include +#include +#include +#include +#include + +#if defined(_WIN32) +#include +#else +#include +#include +#endif + +namespace hrr::test { + +// Minimal, shell-free subprocess helper for HRR behavior tests. +// +// It implements only what the migrated HRR tests need: overriding environment +// variables for the child, launching a child process without going through a +// shell, and optionally capturing its stdout. It replaces the hip-tests +// SpawnProc helper. Extend only this file if Windows ever needs richer process +// semantics rather than re-importing the hip-tests process helpers. +// +// POSIX: the child is launched with fork()/execvp(). The argument string is +// split on whitespace into argv tokens; no shell is involved, so quote +// characters are literal parts of a token (a token like "name" is passed to the +// child including the quotes — Catch2's own test-spec parser then strips them). +// Environment overrides are applied in the child only (via setenv after fork), +// so the parent's environment is never mutated; from the child's point of view +// an overridden variable such as PATH is replaced entirely with the given value. +// +// run() returns the child's exit code, or 128 + signal number if it was killed +// by a signal (127 if the process could not be launched). Both the capturing +// and non-capturing paths use the same normalization. +class SpawnProc { + public: + explicit SpawnProc(std::string exe, bool capture_stdout = false) + : exe_(std::move(exe)), capture_stdout_(capture_stdout) {} + + void setEnv(const std::string& key, const std::string& value) { + env_.push_back({key, value}); + } + + int run(const std::string& args) { + output_.clear(); + std::vector tokens = split_args(args); + +#if defined(_WIN32) + return run_windows(tokens); +#else + return run_posix(tokens); +#endif + } + + const std::string& getOutput() const { return output_; } + + private: + // Split on whitespace into argv tokens, keeping every other character + // (including quotes) literal. No shell-style quote or escape processing. + static std::vector split_args(const std::string& args) { + std::vector out; + std::string cur; + bool in_token = false; + for (char c : args) { + if (c == ' ' || c == '\t' || c == '\n' || c == '\r') { + if (in_token) { + out.push_back(cur); + cur.clear(); + in_token = false; + } + } else { + cur.push_back(c); + in_token = true; + } + } + if (in_token) out.push_back(cur); + return out; + } + +#if !defined(_WIN32) + int run_posix(const std::vector& tokens) { + // argv[0] is the executable itself; execvp performs the PATH lookup (using + // the child's environment) when exe_ is not an absolute/relative path. + std::vector argv; + argv.push_back(const_cast(exe_.c_str())); + for (const auto& t : tokens) argv.push_back(const_cast(t.c_str())); + argv.push_back(nullptr); + + int pipefd[2] = {-1, -1}; + if (capture_stdout_ && ::pipe(pipefd) != 0) return 127; + + pid_t pid = ::fork(); + if (pid < 0) { + if (capture_stdout_) { + ::close(pipefd[0]); + ::close(pipefd[1]); + } + return 127; + } + + if (pid == 0) { + // Child: apply environment overrides (affects this process only), wire up + // stdout capture if requested, then exec. On failure exit with 127. + for (const auto& kv : env_) { + ::setenv(kv.first.c_str(), kv.second.c_str(), 1); + } + if (capture_stdout_) { + ::close(pipefd[0]); + ::dup2(pipefd[1], STDOUT_FILENO); + ::close(pipefd[1]); + } + ::execvp(exe_.c_str(), argv.data()); + ::_exit(127); + } + + // Parent. + if (capture_stdout_) { + ::close(pipefd[1]); + char buffer[4096]; + ssize_t n; + while ((n = ::read(pipefd[0], buffer, sizeof(buffer))) > 0) { + output_.append(buffer, static_cast(n)); + } + ::close(pipefd[0]); + } + + int status = 0; + while (::waitpid(pid, &status, 0) < 0) { + if (errno != EINTR) return 127; + } + if (WIFEXITED(status)) return WEXITSTATUS(status); + if (WIFSIGNALED(status)) return 128 + WTERMSIG(status); + return 127; + } +#endif + +#if defined(_WIN32) + int run_windows(const std::vector& tokens) { + // Build a command line: the executable followed by the raw tokens. Callers + // are responsible for quoting paths that contain spaces (CreateProcess does + // not use a shell). Rejoining with single spaces preserves the caller's + // quoting. + std::string cmdline = exe_; + for (const auto& t : tokens) { + cmdline += " "; + cmdline += t; + } + + // Build the child environment block: inherit the parent's environment, then + // apply overrides, without mutating the parent's environment. + std::string env_block = build_env_block(); + + HANDLE read_h = nullptr; + HANDLE write_h = nullptr; + SECURITY_ATTRIBUTES sa; + sa.nLength = sizeof(sa); + sa.bInheritHandle = TRUE; + sa.lpSecurityDescriptor = nullptr; + + if (capture_stdout_) { + if (!CreatePipe(&read_h, &write_h, &sa, 0)) return 127; + SetHandleInformation(read_h, HANDLE_FLAG_INHERIT, 0); + } + + STARTUPINFOA si; + ZeroMemory(&si, sizeof(si)); + si.cb = sizeof(si); + if (capture_stdout_) { + si.dwFlags |= STARTF_USESTDHANDLES; + si.hStdOutput = write_h; + si.hStdError = GetStdHandle(STD_ERROR_HANDLE); + si.hStdInput = GetStdHandle(STD_INPUT_HANDLE); + } + + PROCESS_INFORMATION pi; + ZeroMemory(&pi, sizeof(pi)); + + std::vector cmd_mutable(cmdline.begin(), cmdline.end()); + cmd_mutable.push_back('\0'); + + BOOL ok = CreateProcessA( + nullptr, cmd_mutable.data(), nullptr, nullptr, + /*bInheritHandles=*/capture_stdout_ ? TRUE : FALSE, 0, + env_block.empty() ? nullptr : env_block.data(), nullptr, &si, &pi); + + if (!ok) { + if (capture_stdout_) { + CloseHandle(read_h); + CloseHandle(write_h); + } + return 127; + } + + if (capture_stdout_) { + CloseHandle(write_h); + char buffer[4096]; + DWORD n = 0; + while (ReadFile(read_h, buffer, sizeof(buffer), &n, nullptr) && n > 0) { + output_.append(buffer, n); + } + CloseHandle(read_h); + } + + WaitForSingleObject(pi.hProcess, INFINITE); + DWORD exit_code = 127; + GetExitCodeProcess(pi.hProcess, &exit_code); + CloseHandle(pi.hProcess); + CloseHandle(pi.hThread); + return static_cast(exit_code); + } + + std::string build_env_block() const { + // Start from the parent's environment, apply overrides (case-insensitive on + // the variable name, per Windows semantics), and emit a double-null + // terminated block for CreateProcess. + std::vector> vars; + LPCH env = GetEnvironmentStringsA(); + if (env) { + for (LPCH p = env; *p != '\0';) { + std::string entry(p); + p += entry.size() + 1; + size_t eq = entry.find('='); + if (eq == std::string::npos || eq == 0) continue; // skip drive entries + vars.push_back({entry.substr(0, eq), entry.substr(eq + 1)}); + } + FreeEnvironmentStringsA(env); + } + auto ieq = [](const std::string& a, const std::string& b) { + return a.size() == b.size() && _stricmp(a.c_str(), b.c_str()) == 0; + }; + for (const auto& kv : env_) { + bool replaced = false; + for (auto& v : vars) { + if (ieq(v.first, kv.first)) { + v.second = kv.second; + replaced = true; + break; + } + } + if (!replaced) vars.push_back(kv); + } + std::string block; + for (const auto& v : vars) { + block += v.first; + block += '='; + block += v.second; + block.push_back('\0'); + } + block.push_back('\0'); + return block; + } +#endif + + std::string exe_; + bool capture_stdout_ = false; + std::string output_; + std::vector> env_; +}; + +} // namespace hrr::test diff --git a/projects/hrr/tests/integration/CMakeLists.txt b/projects/hrr/tests/integration/CMakeLists.txt new file mode 100644 index 000000000000..2c7802703c3f --- /dev/null +++ b/projects/hrr/tests/integration/CMakeLists.txt @@ -0,0 +1,99 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT + +# HRR GPU capture/replay integration tests. +# +# hrr_roundtrip_test.cc is the driver: it sets HIP_HRR_CAPTURE_OUTPUT, spawns the +# hidden [.][hrr-direct] workloads from this same binary as subprocesses, then +# runs hrr-playback to validate replayed device-to-host buffers byte-for-byte. +# The workload translation units (hrr_workload / hrr_repro_workload / hrr_spt_workload) +# provide those hidden _Direct cases and must be linked into the same executable. + +# The workload translation units carry __global__ kernels, device built-ins +# (blockIdx/blockDim/threadIdx), hipLaunchKernelGGL, and HIP_SYMBOL, so they must +# be compiled with the HIP device toolchain rather than a plain C++ compiler. +# hrr_roundtrip_test.cc is a host-only driver (subprocess orchestration + hipRTC +# host calls) and stays a plain C++ translation unit. +set(HRR_GPU_WORKLOAD_SOURCES + hrr_workload_test.cc + hrr_repro_workload_test.cc + hrr_spt_workload_test.cc +) + +if(NOT DEFINED HIP_PLATFORM) + set(HIP_PLATFORM "amd") +endif() + +if(HIP_PLATFORM STREQUAL "amd") + enable_language(HIP) + set_source_files_properties(${HRR_GPU_WORKLOAD_SOURCES} PROPERTIES LANGUAGE HIP) +endif() + +add_executable(hrr-integration-tests + ${HRR_GPU_WORKLOAD_SOURCES} + hrr_roundtrip_test.cc +) +set_target_properties(hrr-integration-tests PROPERTIES + CXX_STANDARD 17 + CXX_STANDARD_REQUIRED ON + HIP_STANDARD 17 + HIP_STANDARD_REQUIRED ON) + +# hrr_spt_workload_test.cc calls the ordinary hipMemset* names and relies on the +# per-thread-default-stream compile option to redirect them to the _spt entry +# points under test. This must stay per source so the other workloads keep +# resolving to the plain entry points. +if(HIP_PLATFORM STREQUAL "amd") + set_source_files_properties(hrr_spt_workload_test.cc PROPERTIES + COMPILE_OPTIONS "-fgpu-default-stream=per-thread") +elseif(HIP_PLATFORM STREQUAL "nvidia") + set_source_files_properties(hrr_spt_workload_test.cc PROPERTIES + COMPILE_OPTIONS "--default-stream=per-thread") +endif() + +# ${CMAKE_CURRENT_SOURCE_DIR}/.. -> local harness headers. +# ../../playback -> hrr_reader.h / hip_playback.h (also propagated by hrr::reader). +target_include_directories(hrr-integration-tests PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/.. + ${CMAKE_CURRENT_SOURCE_DIR}/../../playback +) + +# hiprtc::hiprtc (hipRTC) is a separate ROCm CMake package from hip::host. +find_package(hiprtc CONFIG REQUIRED) + +target_link_libraries(hrr-integration-tests PRIVATE + hrr::reader + hip::host + hiprtc::hiprtc + Catch2::Catch2WithMain) + +# Optional: hip_raw_trace, a genuine multi-threaded capture workload used only by +# Unit_HRR_MultiThreadRoundtrip. If it is not found, HRR_RAW_TRACE_EXE is defined +# empty and that test skips itself at run time. +if(NOT DEFINED HRR_RAW_TRACE_EXE) + find_program(_hrr_raw_trace_found NAMES hip_raw_trace hip_raw_trace.exe + HINTS + "${CMAKE_INSTALL_PREFIX}/bin" + "${ROCM_PATH}/bin" + ) + if(_hrr_raw_trace_found) + set(HRR_RAW_TRACE_EXE "${_hrr_raw_trace_found}") + else() + set(HRR_RAW_TRACE_EXE "") + endif() +endif() + +target_compile_definitions(hrr-integration-tests PRIVATE + HRR_API_ARGS_IMPLEMENTATION + __HIP_PLATFORM_AMD__ + HRR_TEST_EXE="$" + HRR_PLAYBACK_EXE="$" + HRR_RAW_TRACE_EXE="${HRR_RAW_TRACE_EXE}" + ROCM_BIN_PATH="${ROCM_PATH}/bin" +) + +# The integration tests spawn hrr-playback; make sure it is built first. +add_dependencies(hrr-integration-tests hrr-playback) + +add_test(NAME hrr-integration-tests COMMAND hrr-integration-tests) diff --git a/projects/hip-tests/catch/unit/hrr/hrr_repro_workload_test.cc b/projects/hrr/tests/integration/hrr_repro_workload_test.cc similarity index 81% rename from projects/hip-tests/catch/unit/hrr/hrr_repro_workload_test.cc rename to projects/hrr/tests/integration/hrr_repro_workload_test.cc index 060517dce266..5c5859b07ddc 100644 --- a/projects/hip-tests/catch/unit/hrr/hrr_repro_workload_test.cc +++ b/projects/hrr/tests/integration/hrr_repro_workload_test.cc @@ -26,7 +26,7 @@ * never via genuine GPU nondeterminism, so the replay outcomes are reproducible. */ -#include +#include "hrr_test_common.hh" #include @@ -116,25 +116,25 @@ __global__ void hrr_repro_slotmap(float* required_out, const unsigned* flag, // =========================================================================== TEST_CASE("Unit_HRR_FirstMalloc_Direct", "[.][hrr-direct]") { float* da = nullptr; - HIP_CHECK(hipMalloc(&da, kSZ)); // intentionally the first HIP call + HRR_HIP_CHECK(hipMalloc(&da, kSZ)); // intentionally the first HIP call float* dout = nullptr; - HIP_CHECK(hipMalloc(&dout, kSZ)); + HRR_HIP_CHECK(hipMalloc(&dout, kSZ)); float* ha = new float[kN]; float* hout = new float[kN]; for (int i = 0; i < kN; ++i) ha[i] = 1.0f; - HIP_CHECK(hipMemcpy(da, ha, kSZ, hipMemcpyHostToDevice)); + HRR_HIP_CHECK(hipMemcpy(da, ha, kSZ, hipMemcpyHostToDevice)); hipLaunchKernelGGL(hrr_repro_scale, dim3(kGrid), dim3(kBlock), 0, nullptr, da, dout, 2.0f, kN); - HIP_CHECK(hipGetLastError()); - HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipGetLastError()); + HRR_HIP_CHECK(hipDeviceSynchronize()); - HIP_CHECK(hipMemcpy(hout, dout, kSZ, hipMemcpyDeviceToHost)); + HRR_HIP_CHECK(hipMemcpy(hout, dout, kSZ, hipMemcpyDeviceToHost)); for (int i = 0; i < kN; ++i) REQUIRE(hout[i] == 2.0f); - HIP_CHECK(hipFree(da)); - HIP_CHECK(hipFree(dout)); + HRR_HIP_CHECK(hipFree(da)); + HRR_HIP_CHECK(hipFree(dout)); delete[] ha; delete[] hout; } @@ -149,32 +149,32 @@ TEST_CASE("Unit_HRR_FirstMalloc_Direct", "[.][hrr-direct]") { // a=1, b=1 -> c = a + b = 2 => c[i] == 2.0f // =========================================================================== TEST_CASE("Unit_HRR_EmbeddedPtrStruct_Direct", "[.][hrr-direct]") { - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); float *da = nullptr, *db = nullptr, *dc = nullptr; - HIP_CHECK(hipMalloc(&da, kSZ)); - HIP_CHECK(hipMalloc(&db, kSZ)); - HIP_CHECK(hipMalloc(&dc, kSZ)); + HRR_HIP_CHECK(hipMalloc(&da, kSZ)); + HRR_HIP_CHECK(hipMalloc(&db, kSZ)); + HRR_HIP_CHECK(hipMalloc(&dc, kSZ)); float* ha = new float[kN]; float* hc = new float[kN]; for (int i = 0; i < kN; ++i) ha[i] = 1.0f; - HIP_CHECK(hipMemcpy(da, ha, kSZ, hipMemcpyHostToDevice)); - HIP_CHECK(hipMemcpy(db, ha, kSZ, hipMemcpyHostToDevice)); + HRR_HIP_CHECK(hipMemcpy(da, ha, kSZ, hipMemcpyHostToDevice)); + HRR_HIP_CHECK(hipMemcpy(db, ha, kSZ, hipMemcpyHostToDevice)); HrrAddArgs args{da, db, dc, kN}; hipLaunchKernelGGL(hrr_repro_addStruct, dim3(kGrid), dim3(kBlock), 0, nullptr, args); - HIP_CHECK(hipGetLastError()); - HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipGetLastError()); + HRR_HIP_CHECK(hipDeviceSynchronize()); - HIP_CHECK(hipMemcpy(hc, dc, kSZ, hipMemcpyDeviceToHost)); + HRR_HIP_CHECK(hipMemcpy(hc, dc, kSZ, hipMemcpyDeviceToHost)); for (int i = 0; i < kN; ++i) REQUIRE(hc[i] == 2.0f); - HIP_CHECK(hipFree(da)); - HIP_CHECK(hipFree(db)); - HIP_CHECK(hipFree(dc)); + HRR_HIP_CHECK(hipFree(da)); + HRR_HIP_CHECK(hipFree(db)); + HRR_HIP_CHECK(hipFree(dc)); delete[] ha; delete[] hc; } @@ -190,30 +190,30 @@ TEST_CASE("Unit_HRR_EmbeddedPtrStruct_Direct", "[.][hrr-direct]") { // guard test — no genuine GPU nondeterminism is involved. // =========================================================================== TEST_CASE("Unit_HRR_UncapturedHostWrite_Direct", "[.][hrr-direct]") { - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); int* flag = nullptr; - HIP_CHECK(hipHostMalloc(reinterpret_cast(&flag), sizeof(int), + HRR_HIP_CHECK(hipHostMalloc(reinterpret_cast(&flag), sizeof(int), hipHostMallocMapped)); int* flag_dev = nullptr; - HIP_CHECK(hipHostGetDevicePointer(reinterpret_cast(&flag_dev), flag, 0)); + HRR_HIP_CHECK(hipHostGetDevicePointer(reinterpret_cast(&flag_dev), flag, 0)); flag[0] = kFlagSentinel; // uncaptured CPU store int* dout = nullptr; - HIP_CHECK(hipMalloc(&dout, kN * sizeof(int))); + HRR_HIP_CHECK(hipMalloc(&dout, kN * sizeof(int))); int* hout = new int[kN]; for (int it = 0; it < kDivergeIters; ++it) { hipLaunchKernelGGL(hrr_repro_writeFlag, dim3(kGrid), dim3(kBlock), 0, nullptr, dout, flag_dev, kN); - HIP_CHECK(hipGetLastError()); - HIP_CHECK(hipDeviceSynchronize()); - HIP_CHECK(hipMemcpy(hout, dout, kN * sizeof(int), hipMemcpyDeviceToHost)); + HRR_HIP_CHECK(hipGetLastError()); + HRR_HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipMemcpy(hout, dout, kN * sizeof(int), hipMemcpyDeviceToHost)); for (int i = 0; i < kN; ++i) REQUIRE(hout[i] == kFlagSentinel); } - HIP_CHECK(hipFree(dout)); - HIP_CHECK(hipHostFree(flag)); + HRR_HIP_CHECK(hipFree(dout)); + HRR_HIP_CHECK(hipHostFree(flag)); delete[] hout; } @@ -230,45 +230,45 @@ TEST_CASE("Unit_HRR_UncapturedHostWrite_Direct", "[.][hrr-direct]") { // clean; the optional_out argument is genuinely NULL (recorded as 0x0). // =========================================================================== TEST_CASE("Unit_HRR_NullOptionalPtr_Direct", "[.][hrr-direct]") { - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); unsigned* flag = nullptr; - HIP_CHECK(hipHostMalloc(reinterpret_cast(&flag), sizeof(unsigned), + HRR_HIP_CHECK(hipHostMalloc(reinterpret_cast(&flag), sizeof(unsigned), hipHostMallocMapped)); unsigned* flag_dev = nullptr; - HIP_CHECK(hipHostGetDevicePointer(reinterpret_cast(&flag_dev), flag, 0)); + HRR_HIP_CHECK(hipHostGetDevicePointer(reinterpret_cast(&flag_dev), flag, 0)); flag[0] = kSlotSentinel; // uncaptured CPU store // Divergence source: many D2H readbacks whose value depends on the flag. int* dcount = nullptr; - HIP_CHECK(hipMalloc(&dcount, kN * sizeof(int))); + HRR_HIP_CHECK(hipMalloc(&dcount, kN * sizeof(int))); int* hcount = new int[kN]; int* iflag_dev = reinterpret_cast(flag_dev); for (int it = 0; it < kDivergeIters; ++it) { hipLaunchKernelGGL(hrr_repro_writeFlag, dim3(kGrid), dim3(kBlock), 0, nullptr, dcount, iflag_dev, kN); - HIP_CHECK(hipGetLastError()); - HIP_CHECK(hipDeviceSynchronize()); - HIP_CHECK(hipMemcpy(hcount, dcount, kN * sizeof(int), hipMemcpyDeviceToHost)); + HRR_HIP_CHECK(hipGetLastError()); + HRR_HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipMemcpy(hcount, dcount, kN * sizeof(int), hipMemcpyDeviceToHost)); } float* required_out = nullptr; - HIP_CHECK(hipMalloc(&required_out, kSZ)); + HRR_HIP_CHECK(hipMalloc(&required_out, kSZ)); float* optional_out = nullptr; // genuinely NULL at capture (recorded as 0x0) hipLaunchKernelGGL(hrr_repro_slotmap, dim3(kGrid), dim3(kBlock), 0, nullptr, required_out, flag_dev, optional_out, kN); - HIP_CHECK(hipGetLastError()); - HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipGetLastError()); + HRR_HIP_CHECK(hipDeviceSynchronize()); // D2H readback of the always-valid output so capture records a blob. float* hreq = new float[kN]; - HIP_CHECK(hipMemcpy(hreq, required_out, kSZ, hipMemcpyDeviceToHost)); + HRR_HIP_CHECK(hipMemcpy(hreq, required_out, kSZ, hipMemcpyDeviceToHost)); REQUIRE(hreq[1] == 1.0f); - HIP_CHECK(hipFree(dcount)); - HIP_CHECK(hipFree(required_out)); - HIP_CHECK(hipHostFree(flag)); + HRR_HIP_CHECK(hipFree(dcount)); + HRR_HIP_CHECK(hipFree(required_out)); + HRR_HIP_CHECK(hipHostFree(flag)); delete[] hcount; delete[] hreq; } @@ -283,20 +283,20 @@ TEST_CASE("Unit_HRR_NullOptionalPtr_Direct", "[.][hrr-direct]") { // knob off, replay may reuse stale bytes and diverge. // =========================================================================== TEST_CASE("Unit_HRR_ZeroInitRead_Direct", "[.][hrr-direct]") { - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); float* dsrc = nullptr; // intentionally never written - HIP_CHECK(hipMalloc(&dsrc, kSZ)); + HRR_HIP_CHECK(hipMalloc(&dsrc, kSZ)); float* dout = nullptr; - HIP_CHECK(hipMalloc(&dout, kSZ)); + HRR_HIP_CHECK(hipMalloc(&dout, kSZ)); hipLaunchKernelGGL(hrr_repro_copy, dim3(kGrid), dim3(kBlock), 0, nullptr, dsrc, dout, kN); - HIP_CHECK(hipGetLastError()); - HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipGetLastError()); + HRR_HIP_CHECK(hipDeviceSynchronize()); float* hout = new float[kN]; - HIP_CHECK(hipMemcpy(hout, dout, kSZ, hipMemcpyDeviceToHost)); + HRR_HIP_CHECK(hipMemcpy(hout, dout, kSZ, hipMemcpyDeviceToHost)); // Precondition: fresh device allocations are zeroed by the driver. This is // what replay zero-init reproduces; assert it so a non-zeroing platform fails // here (clearly) rather than flaking the roundtrip. @@ -307,8 +307,8 @@ TEST_CASE("Unit_HRR_ZeroInitRead_Direct", "[.][hrr-direct]") { for (int i = 0; i < kN; ++i) REQUIRE(hout[i] == 0.0f); #endif - HIP_CHECK(hipFree(dsrc)); - HIP_CHECK(hipFree(dout)); + HRR_HIP_CHECK(hipFree(dsrc)); + HRR_HIP_CHECK(hipFree(dout)); delete[] hout; } diff --git a/projects/hip-tests/catch/unit/hrr/hrr_roundtrip_test.cc b/projects/hrr/tests/integration/hrr_roundtrip_test.cc similarity index 94% rename from projects/hip-tests/catch/unit/hrr/hrr_roundtrip_test.cc rename to projects/hrr/tests/integration/hrr_roundtrip_test.cc index 8029f5550e42..032e7bcb52e5 100644 --- a/projects/hip-tests/catch/unit/hrr/hrr_roundtrip_test.cc +++ b/projects/hrr/tests/integration/hrr_roundtrip_test.cc @@ -29,11 +29,11 @@ * if hrr-playback is not installed under CMAKE_INSTALL_PREFIX or ROCM_PATH. */ -#include -#include +#include "hrr_test_common.hh" +#include "hrr_test_process.hh" #include #include "hrr_reader.h" -#include "hrr_api_args.h" +#include "hrr/hrr_api_args.h" #include #include @@ -59,7 +59,7 @@ static constexpr char kPathSep = ':'; // On Windows: DLLs are found via PATH. // On Linux: fork() inherits LD_LIBRARY_PATH from the parent automatically; // no explicit setEnv needed. -static void set_proc_search_path(hip::SpawnProc& proc) { +static void set_proc_search_path(hrr::test::SpawnProc& proc) { const char* cur_path = getenv("PATH"); proc.setEnv("PATH", std::string(ROCM_BIN_PATH) + kPathSep + (cur_path ? cur_path : "")); @@ -217,7 +217,7 @@ static bool hrr_parse_d2h_summary(const std::string& out, int& d2h_pass, int& d2 static void hrr_run_playback(const fs::path& cap_path, const std::string& extra_args = "", bool require_d2h = true) { - hip::SpawnProc proc(HRR_PLAYBACK_EXE, /*capture_stdout=*/true); + hrr::test::SpawnProc proc(HRR_PLAYBACK_EXE, /*capture_stdout=*/true); set_proc_search_path(proc); // On Windows, wrap the path in quotes so CreateProcess handles spaces. // On Linux, SpawnProc uses execvp (no shell), so quotes are literal characters @@ -277,14 +277,14 @@ static void hrr_run_playback(const fs::path& cap_path, * - REQUIRE(playback exit == 0): any D2H mismatch causes failure. * - Deletes the temp archive directory on scope exit. */ -HIP_TEST_CASE(Unit_HRR_CaptureReplayRoundtrip) { +HRR_TEST_CASE(Unit_HRR_CaptureReplayRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_gpu"}; // ------------------------------------------------------------------------- // Step 1: capture // ------------------------------------------------------------------------- { - hip::SpawnProc proc(HRR_TEST_EXE); + hrr::test::SpawnProc proc(HRR_TEST_EXE); proc.setEnv("HIP_HRR_CAPTURE_OUTPUT", cap.path.string()); // Prepend ROCm bin to PATH so the subprocess finds amdhip64_7.dll. // SpawnProc replaces PATH entirely, so we reconstruct the full value. @@ -340,14 +340,14 @@ HIP_TEST_CASE(Unit_HRR_CaptureReplayRoundtrip) { * - REQUIRE(playback exit == 0): any D2H mismatch causes failure. * - Deletes the temp archive directory on scope exit. */ -HIP_TEST_CASE(Unit_HRR_AllApisRoundtrip) { +HRR_TEST_CASE(Unit_HRR_AllApisRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_allapis"}; // ------------------------------------------------------------------------- // Step 1: capture // ------------------------------------------------------------------------- { - hip::SpawnProc proc(HRR_TEST_EXE); + hrr::test::SpawnProc proc(HRR_TEST_EXE); proc.setEnv("HIP_HRR_CAPTURE_OUTPUT", cap.path.string()); { set_proc_search_path(proc); @@ -395,14 +395,14 @@ HIP_TEST_CASE(Unit_HRR_AllApisRoundtrip) { * - REQUIRE(playback exit == 0): any D2H mismatch causes failure. * - Deletes the temp archive directory on scope exit. */ -HIP_TEST_CASE(Unit_HRR_HostMemRoundtrip) { +HRR_TEST_CASE(Unit_HRR_HostMemRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_hostmem"}; // ------------------------------------------------------------------------- // Step 1: capture // ------------------------------------------------------------------------- { - hip::SpawnProc proc(HRR_TEST_EXE); + hrr::test::SpawnProc proc(HRR_TEST_EXE); proc.setEnv("HIP_HRR_CAPTURE_OUTPUT", cap.path.string()); { set_proc_search_path(proc); @@ -451,14 +451,14 @@ HIP_TEST_CASE(Unit_HRR_HostMemRoundtrip) { * - REQUIRE(playback exit == 0): any D2H mismatch causes failure. * - Deletes the temp archive directory on scope exit. */ -HIP_TEST_CASE(Unit_HRR_GraphRoundtrip) { +HRR_TEST_CASE(Unit_HRR_GraphRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_graph"}; // ------------------------------------------------------------------------- // Step 1: capture // ------------------------------------------------------------------------- { - hip::SpawnProc proc(HRR_TEST_EXE); + hrr::test::SpawnProc proc(HRR_TEST_EXE); proc.setEnv("HIP_HRR_CAPTURE_OUTPUT", cap.path.string()); // Prepend ROCm bin to PATH so the subprocess finds amdhip64_7.dll. // SpawnProc replaces PATH entirely, so we reconstruct the full value. @@ -504,14 +504,14 @@ HIP_TEST_CASE(Unit_HRR_GraphRoundtrip) { * - REQUIRE(playback exit == 0): any D2H mismatch causes failure. * - Deletes the temp archive directory on scope exit. */ -HIP_TEST_CASE(Unit_HRR_StressApisRoundtrip) { +HRR_TEST_CASE(Unit_HRR_StressApisRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_stress"}; // ------------------------------------------------------------------------- // Step 1: capture // ------------------------------------------------------------------------- { - hip::SpawnProc proc(HRR_TEST_EXE); + hrr::test::SpawnProc proc(HRR_TEST_EXE); proc.setEnv("HIP_HRR_CAPTURE_OUTPUT", cap.path.string()); { set_proc_search_path(proc); @@ -563,7 +563,7 @@ static void hrr_run_roundtrip(const std::string& direct_case, const fs::path& cap_path, size_t min_events = 5, bool require_d2h = true) { - { hip::SpawnProc proc(HRR_TEST_EXE); + { hrr::test::SpawnProc proc(HRR_TEST_EXE); proc.setEnv("HIP_HRR_CAPTURE_OUTPUT", cap_path.string()); { set_proc_search_path(proc); } int ret = proc.run("\"" + direct_case + "\""); @@ -589,14 +589,14 @@ static void hrr_run_roundtrip(const std::string& direct_case, } static bool hrr_find_peer_accessible_pair(int& src_dev, int& dst_dev, int& ndev) { - HIP_CHECK(hipGetDeviceCount(&ndev)); + HRR_HIP_CHECK(hipGetDeviceCount(&ndev)); if (ndev < 2) return false; for (int src = 0; src < ndev; ++src) { for (int dst = 0; dst < ndev; ++dst) { if (src == dst) continue; int can_access = 0; - HIP_CHECK(hipDeviceCanAccessPeer(&can_access, src, dst)); + HRR_HIP_CHECK(hipDeviceCanAccessPeer(&can_access, src, dst)); if (can_access) { src_dev = src; dst_dev = dst; @@ -623,7 +623,7 @@ static bool hrr_find_peer_accessible_pair(int& src_dev, int& dst_dev, int& ndev) static void hrr_capture_direct(const std::string& direct_case, const fs::path& cap_path, size_t min_events = 5) { - { hip::SpawnProc proc(HRR_TEST_EXE); + { hrr::test::SpawnProc proc(HRR_TEST_EXE); proc.setEnv("HIP_HRR_CAPTURE_OUTPUT", cap_path.string()); { set_proc_search_path(proc); } int ret = proc.run("\"" + direct_case + "\""); @@ -642,7 +642,7 @@ static std::pair hrr_playback_env( const fs::path& cap_path, const std::vector>& env, const std::string& extra_args = "") { - hip::SpawnProc proc(HRR_PLAYBACK_EXE, /*capture_stdout=*/true); + hrr::test::SpawnProc proc(HRR_PLAYBACK_EXE, /*capture_stdout=*/true); set_proc_search_path(proc); for (const auto& kv : env) proc.setEnv(kv.first, kv.second); #ifdef _WIN32 @@ -688,7 +688,7 @@ TEST_CASE("Unit_HRR_FirstMallocRoundtrip", "[.][hrr-repro]") { * with embedded device pointers). Replay and REQUIRE D2H pass >= 1, proving * the embedded pointers were detected at capture and translated at replay. */ -HIP_TEST_CASE(Unit_HRR_EmbeddedPtrRoundtrip) { +HRR_TEST_CASE(Unit_HRR_EmbeddedPtrRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_embeddedptr"}; hrr_run_roundtrip("Unit_HRR_EmbeddedPtrStruct_Direct", cap.path); } @@ -703,7 +703,7 @@ HIP_TEST_CASE(Unit_HRR_EmbeddedPtrRoundtrip) { * zero-init replay knob. Note: with the knob off the replay may reuse stale * bytes and diverge — that path is intentionally not asserted here. */ -HIP_TEST_CASE(Unit_HRR_ZeroInitRoundtrip) { +HRR_TEST_CASE(Unit_HRR_ZeroInitRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_zeroinit"}; hrr_capture_direct("Unit_HRR_ZeroInitRead_Direct", cap.path); @@ -745,7 +745,7 @@ HIP_TEST_CASE(Unit_HRR_ZeroInitRoundtrip) { * guard that the divergence-abort teardown stays leak-free. The clean exit 2 * (not a signal/abort >= 128) is the deterministic contract asserted here. */ -HIP_TEST_CASE(Unit_HRR_DivergenceAbortRoundtrip) { +HRR_TEST_CASE(Unit_HRR_DivergenceAbortRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_divergence"}; hrr_capture_direct("Unit_HRR_UncapturedHostWrite_Direct", cap.path); @@ -826,12 +826,12 @@ TEST_CASE("Unit_HRR_NullOptionalPtrRoundtrip", "[.][hrr-repro]") { * support the workload skips, which would leave too few events / no D2H * blob for the archive assertions, so skip the roundtrip as well. */ -HIP_TEST_CASE(Unit_HRR_StreamWriteValueRoundtrip) { +HRR_TEST_CASE(Unit_HRR_StreamWriteValueRoundtrip) { int canUseStreamValue = 0; - HIP_CHECK(hipDeviceGetAttribute(&canUseStreamValue, + HRR_HIP_CHECK(hipDeviceGetAttribute(&canUseStreamValue, hipDeviceAttributeCanUseStreamWaitValue, 0)); if (!canUseStreamValue) { - HIP_SKIP_TEST(HipTest::SkipReason::kStreamWaitValueUnsupported); + HRR_SKIP("stream wait value unsupported"); } ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_streamwritevalue"}; @@ -920,7 +920,7 @@ static void hrr_run_exact_roundtrip(const std::string& direct_case, * written sub-region AND leave the inter-row padding at the sentinel, so * neither a skipped fill nor a fill that ignores the pitch can pass. */ -HIP_TEST_CASE(Unit_HRR_MemsetD2DRoundtrip) { +HRR_TEST_CASE(Unit_HRR_MemsetD2DRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_memsetd2d"}; hrr_run_exact_roundtrip("Unit_HRR_MemsetD2D_Direct", cap.path); } @@ -937,7 +937,7 @@ HIP_TEST_CASE(Unit_HRR_MemsetD2DRoundtrip) { * replay. The archive's other (translatable) D2H blob is only reached and * validated if the replay survived, which is what this asserts. */ -HIP_TEST_CASE(Unit_HRR_MemsetD2DPitchAllocRoundtrip) { +HRR_TEST_CASE(Unit_HRR_MemsetD2DPitchAllocRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_memsetd2dpitchalloc"}; hrr_run_exact_roundtrip("Unit_HRR_MemsetD2DPitchAlloc_Direct", cap.path); } @@ -962,7 +962,7 @@ HIP_TEST_CASE(Unit_HRR_MemsetD2DPitchAllocRoundtrip) { * playback handler for any single _spt memset fails its own buffer and turns * the playback exit code into 1. */ -HIP_TEST_CASE(Unit_HRR_MemsetSptRoundtrip) { +HRR_TEST_CASE(Unit_HRR_MemsetSptRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_memsetspt"}; hrr_capture_direct("Unit_HRR_MemsetSpt_Direct", cap.path); @@ -1005,21 +1005,21 @@ HIP_TEST_CASE(Unit_HRR_MemsetSptRoundtrip) { #endif } -HIP_TEST_CASE(Unit_HRR_MemsetVariantsRoundtrip) { +HRR_TEST_CASE(Unit_HRR_MemsetVariantsRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_memsetvariants"}; hrr_run_roundtrip("Unit_HRR_MemsetVariants_Direct", cap.path); } -HIP_TEST_CASE(Unit_HRR_DeviceInfoRoundtrip) { +HRR_TEST_CASE(Unit_HRR_DeviceInfoRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_deviceinfo"}; hrr_run_roundtrip("Unit_HRR_DeviceInfo_Direct", cap.path); } -HIP_TEST_CASE(Unit_HRR_MetadataManifest) { +HRR_TEST_CASE(Unit_HRR_MetadataManifest) { ScopedDir cap{fs::temp_directory_path() / "hrr_metadata_manifest"}; { - hip::SpawnProc proc(HRR_TEST_EXE); + hrr::test::SpawnProc proc(HRR_TEST_EXE); proc.setEnv("HIP_HRR_CAPTURE_OUTPUT", cap.path.string()); set_proc_search_path(proc); int ret = proc.run("\"Unit_HRR_DeviceInfo_Direct\""); @@ -1079,19 +1079,19 @@ HIP_TEST_CASE(Unit_HRR_MetadataManifest) { CHECK_FALSE(uuid.empty()); } -HIP_TEST_CASE(Unit_HRR_StreamAdvancedRoundtrip) { +HRR_TEST_CASE(Unit_HRR_StreamAdvancedRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_streamadvanced"}; hrr_run_roundtrip("Unit_HRR_StreamAdvanced_Direct", cap.path); } -HIP_TEST_CASE(Unit_HRR_DrvMemcpyRoundtrip) { +HRR_TEST_CASE(Unit_HRR_DrvMemcpyRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_drvmemcpy"}; hrr_run_roundtrip("Unit_HRR_DrvMemcpy_Direct", cap.path); } -HIP_TEST_CASE(Unit_HRR_OccupancyRoundtrip) { +HRR_TEST_CASE(Unit_HRR_OccupancyRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_occupancy"}; - { hip::SpawnProc proc(HRR_TEST_EXE); + { hrr::test::SpawnProc proc(HRR_TEST_EXE); proc.setEnv("HIP_HRR_CAPTURE_OUTPUT", cap.path.string()); { set_proc_search_path(proc); } int ret = proc.run("\"Unit_HRR_Occupancy_Direct\""); @@ -1117,89 +1117,89 @@ HIP_TEST_CASE(Unit_HRR_OccupancyRoundtrip) { #endif } -HIP_TEST_CASE(Unit_HRR_HostAliasesRoundtrip) { +HRR_TEST_CASE(Unit_HRR_HostAliasesRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_hostaliases"}; hrr_run_roundtrip("Unit_HRR_HostAliases_Direct", cap.path); } -HIP_TEST_CASE(Unit_HRR_MemPoolExtendedRoundtrip) { +HRR_TEST_CASE(Unit_HRR_MemPoolExtendedRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_mempoolext"}; hrr_run_roundtrip("Unit_HRR_MemPoolExtended_Direct", cap.path); } -HIP_TEST_CASE(Unit_HRR_DeviceMemPoolRoundtrip) { +HRR_TEST_CASE(Unit_HRR_DeviceMemPoolRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_devicemempool"}; // Exercises hipDeviceSetMemPool (device stream-ordered pool association), // the one device mem-pool API left untested by Unit_HRR_DeviceInfo_Direct. hrr_run_roundtrip("Unit_HRR_DeviceMemPool_Direct", cap.path); } -HIP_TEST_CASE(Unit_HRR_ExtMallocRoundtrip) { +HRR_TEST_CASE(Unit_HRR_ExtMallocRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_extmalloc"}; // Exercises hipExtMallocWithFlags (device allocation, manual playback handler). hrr_run_roundtrip("Unit_HRR_ExtMalloc_Direct", cap.path); } -HIP_TEST_CASE(Unit_HRR_StreamWaitEventSptRoundtrip) { +HRR_TEST_CASE(Unit_HRR_StreamWaitEventSptRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_streamwaitspt"}; // Exercises hipStreamWaitEvent_spt (per-thread-stream cross-stream ordering). hrr_run_roundtrip("Unit_HRR_StreamWaitEventSpt_Direct", cap.path); } -HIP_TEST_CASE(Unit_HRR_GraphLaunchSptRoundtrip) { +HRR_TEST_CASE(Unit_HRR_GraphLaunchSptRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_graphlaunchspt"}; // Exercises hipGraphLaunch_spt (per-thread-stream graph launch). hrr_run_roundtrip("Unit_HRR_GraphLaunchSpt_Direct", cap.path); } -HIP_TEST_CASE(Unit_HRR_ExtModuleLaunchKernelRoundtrip) { +HRR_TEST_CASE(Unit_HRR_ExtModuleLaunchKernelRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_extmodulelaunch"}; // Exercises hipExtModuleLaunchKernel (manual kernarg + device-ptr replay via // the HIPRTC module path, which is captured/replayed on Linux). hrr_run_roundtrip("Unit_HRR_ExtModuleLaunchKernel_Direct", cap.path); } -HIP_TEST_CASE(Unit_HRR_HostFreeRoundtrip) { +HRR_TEST_CASE(Unit_HRR_HostFreeRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_hostfree"}; // Exercises hipHostFree + hipHostMalloc (pinned-host alloc-map lifecycle). hrr_run_roundtrip("Unit_HRR_HostFree_Direct", cap.path); } -HIP_TEST_CASE(Unit_HRR_LoggingRoundtrip) { +HRR_TEST_CASE(Unit_HRR_LoggingRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_logging"}; // Exercises hipExtSetLoggingParams / hipExtEnableLogging / hipExtDisableLogging. hrr_run_roundtrip("Unit_HRR_Logging_Direct", cap.path); } -HIP_TEST_CASE(Unit_HRR_StreamCaptureQuerySptRoundtrip) { +HRR_TEST_CASE(Unit_HRR_StreamCaptureQuerySptRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_capturequeryspt"}; // Exercises hipStreamIsCapturing_spt + hipStreamGetCaptureInfo_spt inside a // manual capture frame (graph executes -> D2H validates the whole path). hrr_run_roundtrip("Unit_HRR_StreamCaptureQuerySpt_Direct", cap.path); } -HIP_TEST_CASE(Unit_HRR_StreamCaptureBeginSptRoundtrip) { +HRR_TEST_CASE(Unit_HRR_StreamCaptureBeginSptRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_capturebeginspt"}; // Validates hipStreamBeginCapture_spt on GPU (generated handler omits the // ctx.in_graph_capture bookkeeping; safe for a memset-only capture region). hrr_run_roundtrip("Unit_HRR_StreamCaptureBeginSpt_Direct", cap.path); } -HIP_TEST_CASE(Unit_HRR_ConfigureCallRoundtrip) { +HRR_TEST_CASE(Unit_HRR_ConfigureCallRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_configurecall"}; // Exercises hipConfigureCall (legacy execution-stack launch configuration). hrr_run_roundtrip("Unit_HRR_ConfigureCall_Direct", cap.path); } -HIP_TEST_CASE(Unit_HRR_MemcpyPeerRoundtrip) { +HRR_TEST_CASE(Unit_HRR_MemcpyPeerRoundtrip) { int src_dev = 0; int dst_dev = 1; int ndev = 0; if (!hrr_find_peer_accessible_pair(src_dev, dst_dev, ndev)) { if (ndev < 2) { - HIP_SKIP_TEST(HipTest::SkipReason::kFewerThanTwoGpus); + HRR_SKIP("fewer than two GPUs"); } else { - HIP_SKIP_TEST(HipTest::SkipReason::kPeerAccessUnavailable); + HRR_SKIP("peer access unavailable"); } } ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_memcpypeer"}; @@ -1208,37 +1208,37 @@ HIP_TEST_CASE(Unit_HRR_MemcpyPeerRoundtrip) { hrr_run_roundtrip("Unit_HRR_MemcpyPeer_Direct", cap.path); } -HIP_TEST_CASE(Unit_HRR_MemsetExtraRoundtrip) { +HRR_TEST_CASE(Unit_HRR_MemsetExtraRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_memsetextra"}; hrr_run_roundtrip("Unit_HRR_MemsetExtra_Direct", cap.path); } -HIP_TEST_CASE(Unit_HRR_MemcpyExtraRoundtrip) { +HRR_TEST_CASE(Unit_HRR_MemcpyExtraRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_memcpyextra"}; hrr_run_roundtrip("Unit_HRR_MemcpyExtra_Direct", cap.path); } -HIP_TEST_CASE(Unit_HRR_DeviceExtraRoundtrip) { +HRR_TEST_CASE(Unit_HRR_DeviceExtraRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_deviceextra"}; hrr_run_roundtrip("Unit_HRR_DeviceExtra_Direct", cap.path); } -HIP_TEST_CASE(Unit_HRR_StreamAdvanced2Roundtrip) { +HRR_TEST_CASE(Unit_HRR_StreamAdvanced2Roundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_streamadv2"}; hrr_run_roundtrip("Unit_HRR_StreamAdvanced2_Direct", cap.path); } -HIP_TEST_CASE(Unit_HRR_ContextRoundtrip) { +HRR_TEST_CASE(Unit_HRR_ContextRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_context"}; hrr_run_roundtrip("Unit_HRR_Context_Direct", cap.path); } -HIP_TEST_CASE(Unit_HRR_ModuleExtraRoundtrip) { +HRR_TEST_CASE(Unit_HRR_ModuleExtraRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_moduleextra"}; hrr_run_roundtrip("Unit_HRR_ModuleExtra_Direct", cap.path); } -HIP_TEST_CASE(Unit_HRR_MiscAPIsRoundtrip) { +HRR_TEST_CASE(Unit_HRR_MiscAPIsRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_miscapis"}; hrr_run_roundtrip("Unit_HRR_MiscAPIs_Direct", cap.path); } @@ -1246,17 +1246,17 @@ HIP_TEST_CASE(Unit_HRR_MiscAPIsRoundtrip) { // Driver-memcpy roundtrips (hipDrvMemcpy3D / 3DAsync / 2DUnaligned). // Pure copy chains with no floating-point arithmetic; byte-exact D2H via // hrr_run_exact_roundtrip() is the correct oracle (see helper above). -HIP_TEST_CASE(Unit_HRR_DrvMemcpy3DRoundtrip) { +HRR_TEST_CASE(Unit_HRR_DrvMemcpy3DRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_drvmemcpy3d"}; hrr_run_exact_roundtrip("Unit_HRR_DrvMemcpy3D_Direct", cap.path); } -HIP_TEST_CASE(Unit_HRR_DrvMemcpy2DUnalignedRoundtrip) { +HRR_TEST_CASE(Unit_HRR_DrvMemcpy2DUnalignedRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_drvmemcpy2dunaligned"}; hrr_run_exact_roundtrip("Unit_HRR_DrvMemcpy2DUnaligned_Direct", cap.path); } -HIP_TEST_CASE(Unit_HRR_TextureRoundtrip) { +HRR_TEST_CASE(Unit_HRR_TextureRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_texture"}; // On devices without image support the workload exits early after // hipDeviceGetAttribute (no D2H memcpy), so D2H validation is skipped. @@ -1268,27 +1268,27 @@ HIP_TEST_CASE(Unit_HRR_TextureRoundtrip) { /*min_events=*/1, /*require_d2h=*/imageSupport != 0); } -HIP_TEST_CASE(Unit_HRR_GraphExplicitRoundtrip) { +HRR_TEST_CASE(Unit_HRR_GraphExplicitRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_graphexplicit"}; hrr_run_roundtrip("Unit_HRR_GraphExplicit_Direct", cap.path); } -HIP_TEST_CASE(Unit_HRR_HostRegLaunchRoundtrip) { +HRR_TEST_CASE(Unit_HRR_HostRegLaunchRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_hostreglch"}; hrr_run_roundtrip("Unit_HRR_HostRegLaunch_Direct", cap.path); } -HIP_TEST_CASE(Unit_HRR_ModuleAPIRoundtrip) { +HRR_TEST_CASE(Unit_HRR_ModuleAPIRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_moduleapi"}; hrr_run_roundtrip("Unit_HRR_ModuleAPI_Direct", cap.path); } -HIP_TEST_CASE(Unit_HRR_VMMRoundtrip) { +HRR_TEST_CASE(Unit_HRR_VMMRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_vmm"}; hrr_run_roundtrip("Unit_HRR_VMM_Direct", cap.path); } -HIP_TEST_CASE(Unit_HRR_ChevronLaunchRoundtrip) { +HRR_TEST_CASE(Unit_HRR_ChevronLaunchRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_chevron"}; // Exercises __hipPushCallConfiguration → hipLaunchByPtr path. // min_events=5: malloc + stream + push + launch + D2H. @@ -1308,7 +1308,7 @@ HIP_TEST_CASE(Unit_HRR_ChevronLaunchRoundtrip) { * (spin-wait ordering, atomic next_seq, per-thread timing events). * - Skips if HRR_RAW_TRACE_EXE was not found at configure time. */ -HIP_TEST_CASE(Unit_HRR_MultiThreadRoundtrip) { +HRR_TEST_CASE(Unit_HRR_MultiThreadRoundtrip) { static constexpr const char* raw_trace_exe = HRR_RAW_TRACE_EXE; if (!raw_trace_exe || raw_trace_exe[0] == '\0') { SUCCEED("hip_raw_trace not found at configure time — skipping " @@ -1322,7 +1322,7 @@ HIP_TEST_CASE(Unit_HRR_MultiThreadRoundtrip) { // Step 1: capture with hip_raw_trace (multi-threaded workload) // ------------------------------------------------------------------------- { - hip::SpawnProc proc(raw_trace_exe); + hrr::test::SpawnProc proc(raw_trace_exe); proc.setEnv("HIP_HRR_CAPTURE_OUTPUT", cap.path.string()); { set_proc_search_path(proc); @@ -1357,7 +1357,7 @@ HIP_TEST_CASE(Unit_HRR_MultiThreadRoundtrip) { // replay (hipStreamSynchronize returns error 900 on an open capture stream). // ------------------------------------------------------------------------- auto run_mt_playback = [&](const std::string& extra_args) { - hip::SpawnProc proc(HRR_PLAYBACK_EXE, /*capture_stdout=*/true); + hrr::test::SpawnProc proc(HRR_PLAYBACK_EXE, /*capture_stdout=*/true); set_proc_search_path(proc); #ifdef _WIN32 std::string mt_path_arg = "\"" + cap.path.string() + "\""; @@ -1456,7 +1456,7 @@ static std::string build_replacement_co(const fs::path& dir) { // Spawn hrr-playback with arbitrary extra args; return {exit_code, stdout}. static std::pair run_playback_raw(const fs::path& cap_path, const std::string& extra_args) { - hip::SpawnProc proc(HRR_PLAYBACK_EXE, /*capture_stdout=*/true); + hrr::test::SpawnProc proc(HRR_PLAYBACK_EXE, /*capture_stdout=*/true); set_proc_search_path(proc); std::string path_arg = cap_path.string(); int ret = proc.run(path_arg + (extra_args.empty() ? "" : " " + extra_args)); @@ -1490,12 +1490,12 @@ static std::string recorded_kernel_name(const fs::path& cap_path, * reports "Replacing kernel". Because behaviour is identical, the D2H * validation still passes (exit 0). */ -HIP_TEST_CASE(Unit_HRR_ReplaceKernelRoundtrip) { +HRR_TEST_CASE(Unit_HRR_ReplaceKernelRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_replace_happy"}; ScopedDir co_dir{fs::temp_directory_path() / "hrr_replace_co"}; { - hip::SpawnProc proc(HRR_TEST_EXE); + hrr::test::SpawnProc proc(HRR_TEST_EXE); proc.setEnv("HIP_HRR_CAPTURE_OUTPUT", cap.path.string()); set_proc_search_path(proc); int ret = proc.run("\"Unit_HRR_GpuWorkload_Direct\""); @@ -1531,11 +1531,11 @@ HIP_TEST_CASE(Unit_HRR_ReplaceKernelRoundtrip) { * recorded kernel: no crash, D2H still passes (exit 0), and a fallback * message is emitted. */ -HIP_TEST_CASE(Unit_HRR_ReplaceKernelMissingCO) { +HRR_TEST_CASE(Unit_HRR_ReplaceKernelMissingCO) { ScopedDir cap{fs::temp_directory_path() / "hrr_replace_missing"}; { - hip::SpawnProc proc(HRR_TEST_EXE); + hrr::test::SpawnProc proc(HRR_TEST_EXE); proc.setEnv("HIP_HRR_CAPTURE_OUTPUT", cap.path.string()); set_proc_search_path(proc); int ret = proc.run("\"Unit_HRR_GpuWorkload_Direct\""); @@ -1565,11 +1565,11 @@ HIP_TEST_CASE(Unit_HRR_ReplaceKernelMissingCO) { * - A --replace-kernel argument that is not in NAME=PATH form (no '=') must be * rejected by the argument parser with a non-zero exit before any GPU work. */ -HIP_TEST_CASE(Unit_HRR_ReplaceKernelBadSpec) { +HRR_TEST_CASE(Unit_HRR_ReplaceKernelBadSpec) { ScopedDir cap{fs::temp_directory_path() / "hrr_replace_badspec"}; { - hip::SpawnProc proc(HRR_TEST_EXE); + hrr::test::SpawnProc proc(HRR_TEST_EXE); proc.setEnv("HIP_HRR_CAPTURE_OUTPUT", cap.path.string()); set_proc_search_path(proc); int ret = proc.run("\"Unit_HRR_GpuWorkload_Direct\""); diff --git a/projects/hip-tests/catch/unit/hrr/hrr_spt_workload_test.cc b/projects/hrr/tests/integration/hrr_spt_workload_test.cc similarity index 85% rename from projects/hip-tests/catch/unit/hrr/hrr_spt_workload_test.cc rename to projects/hrr/tests/integration/hrr_spt_workload_test.cc index 7bea4ad2384d..21a8fea4d626 100644 --- a/projects/hip-tests/catch/unit/hrr/hrr_spt_workload_test.cc +++ b/projects/hrr/tests/integration/hrr_spt_workload_test.cc @@ -25,7 +25,7 @@ * option is ever dropped this stops testing nothing and fails instead. */ -#include +#include "hrr_test_common.hh" // The compile option is what makes this file meaningful; without it every call // below resolves to the plain entry point already covered elsewhere. @@ -71,7 +71,7 @@ // Final blobs: 0x41414141 / 0x42424242 / 0x44444444 / 0x4C4C4C4C. // =========================================================================== TEST_CASE("Unit_HRR_MemsetSpt_Direct", "[.][hrr-direct]") { - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); constexpr int N = 256; constexpr size_t SZ = N * sizeof(int); // 1024 bytes per buffer @@ -87,12 +87,12 @@ TEST_CASE("Unit_HRR_MemsetSpt_Direct", "[.][hrr-direct]") { int* d_set_async = nullptr; int* d_set2d = nullptr; int* d_set2d_async = nullptr; - HIP_CHECK(hipMalloc(&d_set, SZ)); - HIP_CHECK(hipMalloc(&d_set_async, SZ)); - HIP_CHECK(hipMalloc(&d_set2d, SZ)); - HIP_CHECK(hipMalloc(&d_set2d_async, SZ)); + HRR_HIP_CHECK(hipMalloc(&d_set, SZ)); + HRR_HIP_CHECK(hipMalloc(&d_set_async, SZ)); + HRR_HIP_CHECK(hipMalloc(&d_set2d, SZ)); + HRR_HIP_CHECK(hipMalloc(&d_set2d_async, SZ)); - HIP_CHECK(hipMemset(d_set, 0x41, SZ)); + HRR_HIP_CHECK(hipMemset(d_set, 0x41, SZ)); // The async variants need a null stream or they are indistinguishable from // the plain ones: PER_THREAD_DEFAULT_STREAM substitutes only a null or legacy // stream and passes an explicitly created one straight through. @@ -103,28 +103,28 @@ TEST_CASE("Unit_HRR_MemsetSpt_Direct", "[.][hrr-direct]") { // that because translate_stream returns nullptr for handles it cannot map. // AIRUNTIME-2556 turns that fallback into an explicit failure, which would // break this test as though the memset handlers had regressed. - HIP_CHECK(hipMemsetAsync(d_set_async, 0x42, SZ, nullptr)); - HIP_CHECK(hipMemset2D(d_set2d, PITCH, 0x44, PITCH, ROWS)); - HIP_CHECK(hipMemset2DAsync(d_set2d_async, PITCH, 0x4C, PITCH, ROWS, nullptr)); + HRR_HIP_CHECK(hipMemsetAsync(d_set_async, 0x42, SZ, nullptr)); + HRR_HIP_CHECK(hipMemset2D(d_set2d, PITCH, 0x44, PITCH, ROWS)); + HRR_HIP_CHECK(hipMemset2DAsync(d_set2d_async, PITCH, 0x4C, PITCH, ROWS, nullptr)); // The per-thread default stream does not implicitly synchronise with the // legacy stream the readbacks below run on. - HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipDeviceSynchronize()); // One D2H blob per API under test. int* h = new int[N](); - HIP_CHECK(hipMemcpy(h, d_set, SZ, hipMemcpyDeviceToHost)); + HRR_HIP_CHECK(hipMemcpy(h, d_set, SZ, hipMemcpyDeviceToHost)); for (int i = 0; i < N; ++i) REQUIRE(h[i] == 0x41414141); - HIP_CHECK(hipMemcpy(h, d_set_async, SZ, hipMemcpyDeviceToHost)); + HRR_HIP_CHECK(hipMemcpy(h, d_set_async, SZ, hipMemcpyDeviceToHost)); for (int i = 0; i < N; ++i) REQUIRE(h[i] == 0x42424242); - HIP_CHECK(hipMemcpy(h, d_set2d, SZ, hipMemcpyDeviceToHost)); + HRR_HIP_CHECK(hipMemcpy(h, d_set2d, SZ, hipMemcpyDeviceToHost)); for (int i = 0; i < N; ++i) REQUIRE(h[i] == 0x44444444); - HIP_CHECK(hipMemcpy(h, d_set2d_async, SZ, hipMemcpyDeviceToHost)); + HRR_HIP_CHECK(hipMemcpy(h, d_set2d_async, SZ, hipMemcpyDeviceToHost)); for (int i = 0; i < N; ++i) REQUIRE(h[i] == 0x4C4C4C4C); - HIP_CHECK(hipFree(d_set)); - HIP_CHECK(hipFree(d_set_async)); - HIP_CHECK(hipFree(d_set2d)); - HIP_CHECK(hipFree(d_set2d_async)); + HRR_HIP_CHECK(hipFree(d_set)); + HRR_HIP_CHECK(hipFree(d_set_async)); + HRR_HIP_CHECK(hipFree(d_set2d)); + HRR_HIP_CHECK(hipFree(d_set2d_async)); delete[] h; } diff --git a/projects/hip-tests/catch/unit/hrr/hrr_workload_test.cc b/projects/hrr/tests/integration/hrr_workload_test.cc similarity index 71% rename from projects/hip-tests/catch/unit/hrr/hrr_workload_test.cc rename to projects/hrr/tests/integration/hrr_workload_test.cc index c1c5b6f4d3d4..5bc458a246c7 100644 --- a/projects/hip-tests/catch/unit/hrr/hrr_workload_test.cc +++ b/projects/hrr/tests/integration/hrr_workload_test.cc @@ -21,9 +21,21 @@ * HrrTest.exe "Unit_HRR_GraphWorkload_Direct" */ -#include +#include "hrr_test_common.hh" #include #include // hipExtModuleLaunchKernel + +// Local hipRTC error check (replaces the hip-tests hipRTC error check). hipRTC +// symbols come from included above; this mirrors the local +// HRR_HIPRTC_CHECK used by hrr_roundtrip_test.cc. +#define HRR_HIPRTC_CHECK(expr) \ + do { \ + hiprtcResult _hrr_rtc = (expr); \ + INFO("hipRTC call failed: " #expr); \ + INFO("hiprtcResult: " << static_cast(_hrr_rtc)); \ + INFO("hiprtcGetErrorString: " << hiprtcGetErrorString(_hrr_rtc)); \ + REQUIRE(_hrr_rtc == HIPRTC_SUCCESS); \ + } while (0) #include #include #include @@ -39,14 +51,14 @@ static constexpr int KERNEL_ITERS = 4; static constexpr int GRAPH_ITERS = 4; static bool hrr_find_peer_accessible_pair(int& src_dev, int& dst_dev, int& ndev) { - HIP_CHECK(hipGetDeviceCount(&ndev)); + HRR_HIP_CHECK(hipGetDeviceCount(&ndev)); if (ndev < 2) return false; for (int src = 0; src < ndev; ++src) { for (int dst = 0; dst < ndev; ++dst) { if (src == dst) continue; int can_access = 0; - HIP_CHECK(hipDeviceCanAccessPeer(&can_access, src, dst)); + HRR_HIP_CHECK(hipDeviceCanAccessPeer(&can_access, src, dst)); if (can_access) { src_dev = src; dst_dev = dst; @@ -108,11 +120,11 @@ __global__ void hrr_dotPartial(const float* a, const float* b, float* partials, // blob; hrr-playback validates the replayed buffer matches it. // --------------------------------------------------------------------------- TEST_CASE("Unit_HRR_GpuWorkload_Direct", "[.][hrr-direct]") { - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); hipStream_t s0, s1; - HIP_CHECK(hipStreamCreateWithFlags(&s0, hipStreamNonBlocking)); - HIP_CHECK(hipStreamCreateWithFlags(&s1, hipStreamNonBlocking)); + HRR_HIP_CHECK(hipStreamCreateWithFlags(&s0, hipStreamNonBlocking)); + HRR_HIP_CHECK(hipStreamCreateWithFlags(&s1, hipStreamNonBlocking)); float* ha = new float[N]; float* hb = new float[N]; @@ -120,54 +132,54 @@ TEST_CASE("Unit_HRR_GpuWorkload_Direct", "[.][hrr-direct]") { for (int i = 0; i < N; ++i) { ha[i] = 1.0f; hb[i] = 1.0f; } float *da, *db, *dc, *dd, *dp; - HIP_CHECK(hipMalloc(&da, SZ)); - HIP_CHECK(hipMalloc(&db, SZ)); - HIP_CHECK(hipMalloc(&dc, SZ)); - HIP_CHECK(hipMalloc(&dd, SZ)); - HIP_CHECK(hipMalloc(&dp, SZ)); + HRR_HIP_CHECK(hipMalloc(&da, SZ)); + HRR_HIP_CHECK(hipMalloc(&db, SZ)); + HRR_HIP_CHECK(hipMalloc(&dc, SZ)); + HRR_HIP_CHECK(hipMalloc(&dd, SZ)); + HRR_HIP_CHECK(hipMalloc(&dp, SZ)); dim3 block(256), grid((N + 255) / 256); int nblocks = static_cast(grid.x); - HIP_CHECK(hipMemcpyAsync(da, ha, SZ, hipMemcpyHostToDevice, s0)); - HIP_CHECK(hipMemcpyAsync(db, hb, SZ, hipMemcpyHostToDevice, s0)); - HIP_CHECK(hipMemsetAsync(dc, 0, SZ, s1)); - HIP_CHECK(hipStreamSynchronize(s0)); - HIP_CHECK(hipStreamSynchronize(s1)); + HRR_HIP_CHECK(hipMemcpyAsync(da, ha, SZ, hipMemcpyHostToDevice, s0)); + HRR_HIP_CHECK(hipMemcpyAsync(db, hb, SZ, hipMemcpyHostToDevice, s0)); + HRR_HIP_CHECK(hipMemsetAsync(dc, 0, SZ, s1)); + HRR_HIP_CHECK(hipStreamSynchronize(s0)); + HRR_HIP_CHECK(hipStreamSynchronize(s1)); // saxpy: dc = 2*da + dc = 2*1 + 0 = 2 hipLaunchKernelGGL(hrr_vectorSaxpy, grid, block, 0, s0, 2.0f, da, dc, N); - HIP_CHECK(hipGetLastError()); + HRR_HIP_CHECK(hipGetLastError()); // vectorAdd overwrites dc each iter: dc = da + db = 1 + 1 = 2 for (int iter = 0; iter < KERNEL_ITERS; ++iter) { hipLaunchKernelGGL(hrr_vectorAdd, grid, block, 0, s0, da, db, dc, N); - HIP_CHECK(hipGetLastError()); + HRR_HIP_CHECK(hipGetLastError()); } - HIP_CHECK(hipStreamSynchronize(s0)); + HRR_HIP_CHECK(hipStreamSynchronize(s0)); // D2D copy exercises that event type in the capture stream - HIP_CHECK(hipMemcpyAsync(dd, dc, SZ, hipMemcpyDeviceToDevice, s1)); + HRR_HIP_CHECK(hipMemcpyAsync(dd, dc, SZ, hipMemcpyDeviceToDevice, s1)); hipLaunchKernelGGL(hrr_dotPartial, grid, block, block.x * sizeof(float), s0, da, db, dp, N); - HIP_CHECK(hipGetLastError()); + HRR_HIP_CHECK(hipGetLastError()); hipLaunchKernelGGL(hrr_vectorScale, grid, block, 0, s0, dp, dp, 1.0f / nblocks, N); - HIP_CHECK(hipGetLastError()); + HRR_HIP_CHECK(hipGetLastError()); - HIP_CHECK(hipStreamSynchronize(s1)); + HRR_HIP_CHECK(hipStreamSynchronize(s1)); // D2H — blob captured here when HIP_HRR_CAPTURE_OUTPUT is set - HIP_CHECK(hipMemcpyAsync(hc, dc, SZ, hipMemcpyDeviceToHost, s0)); - HIP_CHECK(hipStreamSynchronize(s0)); + HRR_HIP_CHECK(hipMemcpyAsync(hc, dc, SZ, hipMemcpyDeviceToHost, s0)); + HRR_HIP_CHECK(hipStreamSynchronize(s0)); for (int i = 0; i < N; ++i) REQUIRE(hc[i] == 2.0f); - HIP_CHECK(hipFree(da)); HIP_CHECK(hipFree(db)); HIP_CHECK(hipFree(dc)); - HIP_CHECK(hipFree(dd)); HIP_CHECK(hipFree(dp)); - HIP_CHECK(hipStreamDestroy(s0)); - HIP_CHECK(hipStreamDestroy(s1)); + HRR_HIP_CHECK(hipFree(da)); HRR_HIP_CHECK(hipFree(db)); HRR_HIP_CHECK(hipFree(dc)); + HRR_HIP_CHECK(hipFree(dd)); HRR_HIP_CHECK(hipFree(dp)); + HRR_HIP_CHECK(hipStreamDestroy(s0)); + HRR_HIP_CHECK(hipStreamDestroy(s1)); delete[] ha; delete[] hb; delete[] hc; } @@ -179,11 +191,11 @@ TEST_CASE("Unit_HRR_GpuWorkload_Direct", "[.][hrr-direct]") { // Expected: hc[i] == 2.0f // --------------------------------------------------------------------------- TEST_CASE("Unit_HRR_GraphWorkload_Direct", "[.][hrr-direct]") { - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); hipStream_t copyStream, execStream; - HIP_CHECK(hipStreamCreateWithFlags(©Stream, hipStreamNonBlocking)); - HIP_CHECK(hipStreamCreateWithFlags(&execStream, hipStreamNonBlocking)); + HRR_HIP_CHECK(hipStreamCreateWithFlags(©Stream, hipStreamNonBlocking)); + HRR_HIP_CHECK(hipStreamCreateWithFlags(&execStream, hipStreamNonBlocking)); float* ha = new float[N]; float* hb = new float[N]; @@ -191,15 +203,15 @@ TEST_CASE("Unit_HRR_GraphWorkload_Direct", "[.][hrr-direct]") { for (int i = 0; i < N; ++i) { ha[i] = 1.0f; hb[i] = 1.0f; } float *da, *db, *dc, *tmp, *dd; - HIP_CHECK(hipMalloc(&da, SZ)); - HIP_CHECK(hipMalloc(&db, SZ)); - HIP_CHECK(hipMalloc(&dc, SZ)); - HIP_CHECK(hipMalloc(&tmp, SZ)); - HIP_CHECK(hipMalloc(&dd, SZ)); + HRR_HIP_CHECK(hipMalloc(&da, SZ)); + HRR_HIP_CHECK(hipMalloc(&db, SZ)); + HRR_HIP_CHECK(hipMalloc(&dc, SZ)); + HRR_HIP_CHECK(hipMalloc(&tmp, SZ)); + HRR_HIP_CHECK(hipMalloc(&dd, SZ)); - HIP_CHECK(hipMemcpyAsync(da, ha, SZ, hipMemcpyHostToDevice, copyStream)); - HIP_CHECK(hipMemcpyAsync(db, hb, SZ, hipMemcpyHostToDevice, copyStream)); - HIP_CHECK(hipStreamSynchronize(copyStream)); + HRR_HIP_CHECK(hipMemcpyAsync(da, ha, SZ, hipMemcpyHostToDevice, copyStream)); + HRR_HIP_CHECK(hipMemcpyAsync(db, hb, SZ, hipMemcpyHostToDevice, copyStream)); + HRR_HIP_CHECK(hipStreamSynchronize(copyStream)); hipGraph_t graph; hipGraphExec_t graphExec; @@ -215,38 +227,38 @@ TEST_CASE("Unit_HRR_GraphWorkload_Direct", "[.][hrr-direct]") { // add: dc=1+1=2 // saxpy: dc=-1*1+2=1 // add: dc=1+1=2 ✓ - HIP_CHECK(hipStreamBeginCapture(execStream, hipStreamCaptureModeThreadLocal)); + HRR_HIP_CHECK(hipStreamBeginCapture(execStream, hipStreamCaptureModeThreadLocal)); hipLaunchKernelGGL(hrr_vectorFill, grid, block, 0, execStream, dc, 0.0f, N); hipLaunchKernelGGL(hrr_vectorSaxpy, grid, block, 0, execStream, 3.0f, da, dc, N); hipLaunchKernelGGL(hrr_vectorAdd, grid, block, 0, execStream, da, db, tmp, N); hipLaunchKernelGGL(hrr_vectorScale, grid, block, 0, execStream, tmp, tmp, 0.5f, N); hipLaunchKernelGGL(hrr_memcpyKernel, grid, block, 0, execStream, tmp, dc, N); - HIP_CHECK(hipMemcpyAsync(dd, dc, SZ, hipMemcpyDeviceToDevice, execStream)); + HRR_HIP_CHECK(hipMemcpyAsync(dd, dc, SZ, hipMemcpyDeviceToDevice, execStream)); hipLaunchKernelGGL(hrr_vectorAdd, grid, block, 0, execStream, da, dc, dc, N); hipLaunchKernelGGL(hrr_vectorSaxpy, grid, block, 0, execStream, -1.0f, db, dc, N); hipLaunchKernelGGL(hrr_vectorAdd, grid, block, 0, execStream, dc, dc, dc, N); - HIP_CHECK(hipStreamEndCapture(execStream, &graph)); - HIP_CHECK(hipGraphInstantiateWithFlags(&graphExec, graph, 0)); - HIP_CHECK(hipGraphDestroy(graph)); + HRR_HIP_CHECK(hipStreamEndCapture(execStream, &graph)); + HRR_HIP_CHECK(hipGraphInstantiateWithFlags(&graphExec, graph, 0)); + HRR_HIP_CHECK(hipGraphDestroy(graph)); for (int iter = 0; iter < GRAPH_ITERS; ++iter) - HIP_CHECK(hipGraphLaunch(graphExec, execStream)); - HIP_CHECK(hipStreamSynchronize(execStream)); + HRR_HIP_CHECK(hipGraphLaunch(graphExec, execStream)); + HRR_HIP_CHECK(hipStreamSynchronize(execStream)); // D2H — blob captured here when HIP_HRR_CAPTURE_OUTPUT is set - HIP_CHECK(hipMemcpyAsync(hc, dc, SZ, hipMemcpyDeviceToHost, copyStream)); - HIP_CHECK(hipStreamSynchronize(copyStream)); + HRR_HIP_CHECK(hipMemcpyAsync(hc, dc, SZ, hipMemcpyDeviceToHost, copyStream)); + HRR_HIP_CHECK(hipStreamSynchronize(copyStream)); for (int i = 0; i < N; ++i) REQUIRE(hc[i] == 2.0f); - HIP_CHECK(hipGraphExecDestroy(graphExec)); - HIP_CHECK(hipFree(da)); HIP_CHECK(hipFree(db)); HIP_CHECK(hipFree(dc)); - HIP_CHECK(hipFree(tmp)); HIP_CHECK(hipFree(dd)); - HIP_CHECK(hipStreamDestroy(copyStream)); - HIP_CHECK(hipStreamDestroy(execStream)); + HRR_HIP_CHECK(hipGraphExecDestroy(graphExec)); + HRR_HIP_CHECK(hipFree(da)); HRR_HIP_CHECK(hipFree(db)); HRR_HIP_CHECK(hipFree(dc)); + HRR_HIP_CHECK(hipFree(tmp)); HRR_HIP_CHECK(hipFree(dd)); + HRR_HIP_CHECK(hipStreamDestroy(copyStream)); + HRR_HIP_CHECK(hipStreamDestroy(execStream)); delete[] ha; delete[] hb; delete[] hc; } @@ -275,31 +287,31 @@ __global__ void hrr_scalarAdd(const int* a, const int* b, int* c, int n, int sca // - D2H via the device pointer (kernel writes to buf_dev; host reads buf) // --------------------------------------------------------------------------- TEST_CASE("Unit_HRR_HostMemWorkload_Direct", "[.][hrr-direct]") { - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); int* buf; int* buf_dev; - HIP_CHECK(hipHostMalloc(&buf, sizeof(*buf))); - HIP_CHECK(hipHostGetDevicePointer(reinterpret_cast(&buf_dev), buf, 0)); + HRR_HIP_CHECK(hipHostMalloc(&buf, sizeof(*buf))); + HRR_HIP_CHECK(hipHostGetDevicePointer(reinterpret_cast(&buf_dev), buf, 0)); // Initialize via H2D so the captured blob restores this value at playback. int init_val = 1; - HIP_CHECK(hipMemcpy(buf_dev, &init_val, sizeof(init_val), hipMemcpyHostToDevice)); + HRR_HIP_CHECK(hipMemcpy(buf_dev, &init_val, sizeof(init_val), hipMemcpyHostToDevice)); hipLaunchKernelGGL(hrr_incrementInt, dim3(1), dim3(1), 0, hipStreamDefault, buf_dev); - HIP_CHECK(hipGetLastError()); - HIP_CHECK(hipStreamSynchronize(hipStreamDefault)); + HRR_HIP_CHECK(hipGetLastError()); + HRR_HIP_CHECK(hipStreamSynchronize(hipStreamDefault)); // buf is host-visible; kernel wrote via buf_dev — same physical page. REQUIRE(*buf == 2); // Explicit D2H memcpy so the capture layer records a D2H blob for playback validation. int result = 0; - HIP_CHECK(hipMemcpy(&result, buf_dev, sizeof(result), hipMemcpyDeviceToHost)); + HRR_HIP_CHECK(hipMemcpy(&result, buf_dev, sizeof(result), hipMemcpyDeviceToHost)); REQUIRE(result == 2); - HIP_CHECK(hipFree(buf)); + HRR_HIP_CHECK(hipFree(buf)); } // --------------------------------------------------------------------------- @@ -320,24 +332,24 @@ TEST_CASE("Unit_HRR_AllApis_Direct", "[.][hrr-direct]") { // 1. Device queries // ========================================================================= int deviceCount = 0; - HIP_CHECK(hipGetDeviceCount(&deviceCount)); + HRR_HIP_CHECK(hipGetDeviceCount(&deviceCount)); REQUIRE(deviceCount >= 1); - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); hipDeviceProp_t props{}; - HIP_CHECK(hipGetDeviceProperties(&props, 0)); + HRR_HIP_CHECK(hipGetDeviceProperties(&props, 0)); INFO("Device: " << props.name); int maxBlockDimX = 0; - HIP_CHECK(hipDeviceGetAttribute(&maxBlockDimX, hipDeviceAttributeMaxBlockDimX, 0)); + HRR_HIP_CHECK(hipDeviceGetAttribute(&maxBlockDimX, hipDeviceAttributeMaxBlockDimX, 0)); REQUIRE(maxBlockDimX > 0); int priLo = 0, priHi = 0; - HIP_CHECK(hipDeviceGetStreamPriorityRange(&priLo, &priHi)); + HRR_HIP_CHECK(hipDeviceGetStreamPriorityRange(&priLo, &priHi)); int driverVer = 0, runtimeVer = 0; - HIP_CHECK(hipDriverGetVersion(&driverVer)); - HIP_CHECK(hipRuntimeGetVersion(&runtimeVer)); + HRR_HIP_CHECK(hipDriverGetVersion(&driverVer)); + HRR_HIP_CHECK(hipRuntimeGetVersion(&runtimeVer)); REQUIRE(driverVer > 0); REQUIRE(runtimeVer > 0); @@ -353,16 +365,16 @@ TEST_CASE("Unit_HRR_AllApis_Direct", "[.][hrr-direct]") { // 3. Stream management // ========================================================================= hipStream_t s0, s1, s2; - HIP_CHECK(hipStreamCreate(&s0)); - HIP_CHECK(hipStreamCreateWithFlags(&s1, hipStreamNonBlocking)); - HIP_CHECK(hipStreamCreateWithPriority(&s2, hipStreamNonBlocking, priLo)); + HRR_HIP_CHECK(hipStreamCreate(&s0)); + HRR_HIP_CHECK(hipStreamCreateWithFlags(&s1, hipStreamNonBlocking)); + HRR_HIP_CHECK(hipStreamCreateWithPriority(&s2, hipStreamNonBlocking, priLo)); unsigned int sflags = 0; - HIP_CHECK(hipStreamGetFlags(s1, &sflags)); + HRR_HIP_CHECK(hipStreamGetFlags(s1, &sflags)); REQUIRE(sflags == hipStreamNonBlocking); int spri = 0; - HIP_CHECK(hipStreamGetPriority(s2, &spri)); + HRR_HIP_CHECK(hipStreamGetPriority(s2, &spri)); // hipStreamQuery — hipSuccess or hipErrorNotReady are both valid responses { @@ -374,9 +386,9 @@ TEST_CASE("Unit_HRR_AllApis_Direct", "[.][hrr-direct]") { // 4. Events // ========================================================================= hipEvent_t ev_start, ev_stop, ev_nodur; - HIP_CHECK(hipEventCreate(&ev_start)); - HIP_CHECK(hipEventCreate(&ev_stop)); - HIP_CHECK(hipEventCreateWithFlags(&ev_nodur, hipEventDisableTiming)); + HRR_HIP_CHECK(hipEventCreate(&ev_start)); + HRR_HIP_CHECK(hipEventCreate(&ev_stop)); + HRR_HIP_CHECK(hipEventCreateWithFlags(&ev_nodur, hipEventDisableTiming)); // ========================================================================= // 5. Memory allocation @@ -385,108 +397,108 @@ TEST_CASE("Unit_HRR_AllApis_Direct", "[.][hrr-direct]") { constexpr size_t SZ = N * sizeof(int); size_t memFree = 0, memTotal = 0; - HIP_CHECK(hipMemGetInfo(&memFree, &memTotal)); + HRR_HIP_CHECK(hipMemGetInfo(&memFree, &memTotal)); REQUIRE(memTotal > 0); int *d0, *d1, *d2; - HIP_CHECK(hipMalloc(&d0, SZ)); - HIP_CHECK(hipMalloc(&d1, SZ)); - HIP_CHECK(hipMalloc(&d2, SZ)); + HRR_HIP_CHECK(hipMalloc(&d0, SZ)); + HRR_HIP_CHECK(hipMalloc(&d1, SZ)); + HRR_HIP_CHECK(hipMalloc(&d2, SZ)); int *d_async = nullptr; - HIP_CHECK(hipMallocAsync(&d_async, SZ, s0)); + HRR_HIP_CHECK(hipMallocAsync(&d_async, SZ, s0)); hipMemPool_t pool; hipMemPoolProps poolProps{}; poolProps.allocType = hipMemAllocationTypePinned; poolProps.location.type = hipMemLocationTypeDevice; poolProps.location.id = 0; - HIP_CHECK(hipMemPoolCreate(&pool, &poolProps)); + HRR_HIP_CHECK(hipMemPoolCreate(&pool, &poolProps)); uint64_t threshold = 0; - HIP_CHECK(hipMemPoolGetAttribute(pool, hipMemPoolAttrReleaseThreshold, &threshold)); + HRR_HIP_CHECK(hipMemPoolGetAttribute(pool, hipMemPoolAttrReleaseThreshold, &threshold)); threshold = static_cast(-1); // never release automatically - HIP_CHECK(hipMemPoolSetAttribute(pool, hipMemPoolAttrReleaseThreshold, &threshold)); + HRR_HIP_CHECK(hipMemPoolSetAttribute(pool, hipMemPoolAttrReleaseThreshold, &threshold)); int *d_pool = nullptr; - HIP_CHECK(hipMallocFromPoolAsync(&d_pool, SZ, pool, s0)); + HRR_HIP_CHECK(hipMallocFromPoolAsync(&d_pool, SZ, pool, s0)); int *h_pinned = nullptr; - HIP_CHECK(hipHostMalloc(&h_pinned, SZ, 0)); + HRR_HIP_CHECK(hipHostMalloc(&h_pinned, SZ, 0)); const bool managed_ok = (props.managedMemory != 0); int *d_managed = nullptr; if (managed_ok) - HIP_CHECK(hipMallocManaged(&d_managed, SZ, hipMemAttachGlobal)); + HRR_HIP_CHECK(hipMallocManaged(&d_managed, SZ, hipMemAttachGlobal)); // ========================================================================= // 6. Memset + H2D memcpy variants // ========================================================================= - HIP_CHECK(hipMemset(d0, 0, SZ)); - HIP_CHECK(hipMemsetAsync(d1, 0, SZ, s0)); + HRR_HIP_CHECK(hipMemset(d0, 0, SZ)); + HRR_HIP_CHECK(hipMemsetAsync(d1, 0, SZ, s0)); int* h_src = new int[N]; for (int i = 0; i < N; ++i) h_src[i] = 42; // hipMemcpy (sync H2D) → d0 = 42 - HIP_CHECK(hipMemcpy(d0, h_src, SZ, hipMemcpyHostToDevice)); + HRR_HIP_CHECK(hipMemcpy(d0, h_src, SZ, hipMemcpyHostToDevice)); // hipMemcpyAsync (H2D on s0) → d1 = 42 - HIP_CHECK(hipMemcpyAsync(d1, h_src, SZ, hipMemcpyHostToDevice, s0)); + HRR_HIP_CHECK(hipMemcpyAsync(d1, h_src, SZ, hipMemcpyHostToDevice, s0)); // hipMemcpyWithStream (H2D on s1) → d_async = 1 for (int i = 0; i < N; ++i) h_pinned[i] = 1; - HIP_CHECK(hipMemcpyWithStream(d_async, h_pinned, SZ, hipMemcpyHostToDevice, s1)); + HRR_HIP_CHECK(hipMemcpyWithStream(d_async, h_pinned, SZ, hipMemcpyHostToDevice, s1)); - HIP_CHECK(hipStreamSynchronize(s0)); - HIP_CHECK(hipStreamSynchronize(s1)); + HRR_HIP_CHECK(hipStreamSynchronize(s0)); + HRR_HIP_CHECK(hipStreamSynchronize(s1)); // ========================================================================= // 7. Pointer attributes // ========================================================================= hipPointerAttribute_t pattr{}; - HIP_CHECK(hipPointerGetAttributes(&pattr, d0)); + HRR_HIP_CHECK(hipPointerGetAttributes(&pattr, d0)); REQUIRE(pattr.type == hipMemoryTypeDevice); // ========================================================================= // 8. Cache config query // ========================================================================= hipFuncCache_t cacheConf = hipFuncCachePreferNone; - HIP_CHECK(hipDeviceGetCacheConfig(&cacheConf)); + HRR_HIP_CHECK(hipDeviceGetCacheConfig(&cacheConf)); // ========================================================================= // 9. Peer access capability (query only, no enable/disable) // ========================================================================= if (deviceCount > 1) { int canAccess = 0; - HIP_CHECK(hipDeviceCanAccessPeer(&canAccess, 0, 1)); + HRR_HIP_CHECK(hipDeviceCanAccessPeer(&canAccess, 0, 1)); } // ========================================================================= // 10. Occupancy query + timed kernel launch // ========================================================================= int occBlockSize = 0, occGridSize = 0; - HIP_CHECK(hipOccupancyMaxPotentialBlockSize(&occGridSize, &occBlockSize, + HRR_HIP_CHECK(hipOccupancyMaxPotentialBlockSize(&occGridSize, &occBlockSize, hrr_scalarAdd, 0, 0)); REQUIRE(occBlockSize > 0); - HIP_CHECK(hipEventRecord(ev_start, s0)); + HRR_HIP_CHECK(hipEventRecord(ev_start, s0)); dim3 block(256), grid((N + 255) / 256); // d2[i] = d0[i] + d1[i] + 10 = 42 + 42 + 10 = 94 hipLaunchKernelGGL(hrr_scalarAdd, grid, block, 0, s0, d0, d1, d2, N, 10); - HIP_CHECK(hipGetLastError()); + HRR_HIP_CHECK(hipGetLastError()); - HIP_CHECK(hipEventRecord(ev_stop, s0)); + HRR_HIP_CHECK(hipEventRecord(ev_stop, s0)); // s1 waits for ev_stop before performing the D2H copy - HIP_CHECK(hipStreamWaitEvent(s1, ev_stop, 0)); + HRR_HIP_CHECK(hipStreamWaitEvent(s1, ev_stop, 0)); // ========================================================================= // 11. Event query + elapsed time // ========================================================================= - HIP_CHECK(hipEventSynchronize(ev_stop)); + HRR_HIP_CHECK(hipEventSynchronize(ev_stop)); { hipError_t q = hipEventQuery(ev_stop); REQUIRE(q == hipSuccess); } float ms = 0.f; - HIP_CHECK(hipEventElapsedTime(&ms, ev_start, ev_stop)); + HRR_HIP_CHECK(hipEventElapsedTime(&ms, ev_start, ev_stop)); // Allow small negative values: GPU timer resolution can return -epsilon // when events are very close together. Accept anything > -1 ms. REQUIRE(ms > -1.f); @@ -495,8 +507,8 @@ TEST_CASE("Unit_HRR_AllApis_Direct", "[.][hrr-direct]") { // 12. D2H memcpy — blob captured here; playback validates against it // ========================================================================= int* h_out = new int[N](); - HIP_CHECK(hipMemcpyAsync(h_out, d2, SZ, hipMemcpyDeviceToHost, s1)); - HIP_CHECK(hipStreamSynchronize(s1)); + HRR_HIP_CHECK(hipMemcpyAsync(h_out, d2, SZ, hipMemcpyDeviceToHost, s1)); + HRR_HIP_CHECK(hipStreamSynchronize(s1)); for (int i = 0; i < N; ++i) REQUIRE(h_out[i] == 94); @@ -504,15 +516,15 @@ TEST_CASE("Unit_HRR_AllApis_Direct", "[.][hrr-direct]") { // ========================================================================= // 13. D2D copy + full device sync // ========================================================================= - HIP_CHECK(hipMemcpy(d1, d2, SZ, hipMemcpyDeviceToDevice)); - HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipMemcpy(d1, d2, SZ, hipMemcpyDeviceToDevice)); + HRR_HIP_CHECK(hipDeviceSynchronize()); // ========================================================================= // 14. Managed memory: advise, range-attr query, prefetch (conditional) // ========================================================================= if (managed_ok && d_managed) { for (int i = 0; i < N; ++i) d_managed[i] = i; - HIP_CHECK(hipMemAdvise(d_managed, SZ, hipMemAdviseSetReadMostly, 0)); + HRR_HIP_CHECK(hipMemAdvise(d_managed, SZ, hipMemAdviseSetReadMostly, 0)); // hipMemRangeGetAttribute segfaults on some Linux ROCm builds — // guard with a non-fatal call and skip the assertion on failure. @@ -527,9 +539,9 @@ TEST_CASE("Unit_HRR_AllApis_Direct", "[.][hrr-direct]") { << " — skipping range-attr assertion on this platform"); } - HIP_CHECK(hipMemPrefetchAsync(d_managed, SZ, 0, s0)); - HIP_CHECK(hipStreamSynchronize(s0)); - HIP_CHECK(hipMemAdvise(d_managed, SZ, hipMemAdviseUnsetReadMostly, 0)); + HRR_HIP_CHECK(hipMemPrefetchAsync(d_managed, SZ, 0, s0)); + HRR_HIP_CHECK(hipStreamSynchronize(s0)); + HRR_HIP_CHECK(hipMemAdvise(d_managed, SZ, hipMemAdviseUnsetReadMostly, 0)); } // ========================================================================= @@ -541,7 +553,7 @@ TEST_CASE("Unit_HRR_AllApis_Direct", "[.][hrr-direct]") { // ========================================================================= { int* d3 = nullptr; - HIP_CHECK(hipMalloc(&d3, SZ)); + HRR_HIP_CHECK(hipMalloc(&d3, SZ)); int* h3_src = new int[N]; int* h3_out = new int[N](); for (int i = 0; i < N; ++i) h3_src[i] = 99; @@ -552,7 +564,7 @@ TEST_CASE("Unit_HRR_AllApis_Direct", "[.][hrr-direct]") { p_h2d.dstPtr = make_hipPitchedPtr(d3, N * sizeof(int), N, 1); p_h2d.extent = make_hipExtent(N * sizeof(int), 1, 1); p_h2d.kind = hipMemcpyHostToDevice; - HIP_CHECK(hipMemcpy3D(&p_h2d)); + HRR_HIP_CHECK(hipMemcpy3D(&p_h2d)); // D2H via hipMemcpy3DAsync — blob captured here; playback validates 99 hipMemcpy3DParms p_d2h{}; @@ -560,13 +572,13 @@ TEST_CASE("Unit_HRR_AllApis_Direct", "[.][hrr-direct]") { p_d2h.dstPtr = make_hipPitchedPtr(h3_out, N * sizeof(int), N, 1); p_d2h.extent = make_hipExtent(N * sizeof(int), 1, 1); p_d2h.kind = hipMemcpyDeviceToHost; - HIP_CHECK(hipMemcpy3DAsync(&p_d2h, s0)); - HIP_CHECK(hipStreamSynchronize(s0)); + HRR_HIP_CHECK(hipMemcpy3DAsync(&p_d2h, s0)); + HRR_HIP_CHECK(hipStreamSynchronize(s0)); for (int i = 0; i < N; ++i) REQUIRE(h3_out[i] == 99); - HIP_CHECK(hipFree(d3)); + HRR_HIP_CHECK(hipFree(d3)); delete[] h3_src; delete[] h3_out; } @@ -579,7 +591,7 @@ TEST_CASE("Unit_HRR_AllApis_Direct", "[.][hrr-direct]") { { hipStreamAttrValue attr_val{}; attr_val.syncPolicy = hipSyncPolicySpin; - HIP_CHECK(hipStreamSetAttribute(s0, hipStreamAttributeSynchronizationPolicy, + HRR_HIP_CHECK(hipStreamSetAttribute(s0, hipStreamAttributeSynchronizationPolicy, &attr_val)); } @@ -592,7 +604,7 @@ TEST_CASE("Unit_HRR_AllApis_Direct", "[.][hrr-direct]") { alloc_prop.location.type = hipMemLocationTypeDevice; alloc_prop.location.id = 0; size_t granularity = 0; - HIP_CHECK(hipMemGetAllocationGranularity( + HRR_HIP_CHECK(hipMemGetAllocationGranularity( &granularity, &alloc_prop, hipMemAllocationGranularityMinimum)); REQUIRE(granularity > 0); } @@ -605,7 +617,7 @@ TEST_CASE("Unit_HRR_AllApis_Direct", "[.][hrr-direct]") { access_desc.location.type = hipMemLocationTypeDevice; access_desc.location.id = 0; access_desc.flags = hipMemAccessFlagsProtReadWrite; - HIP_CHECK(hipMemPoolSetAccess(pool, &access_desc, 1)); + HRR_HIP_CHECK(hipMemPoolSetAccess(pool, &access_desc, 1)); } // ========================================================================= @@ -616,7 +628,7 @@ TEST_CASE("Unit_HRR_AllApis_Direct", "[.][hrr-direct]") { // ========================================================================= { int supportsImages = 0; - HIP_CHECK(hipDeviceGetAttribute(&supportsImages, hipDeviceAttributeImageSupport, 0)); + HRR_HIP_CHECK(hipDeviceGetAttribute(&supportsImages, hipDeviceAttributeImageSupport, 0)); if (supportsImages) { HIP_ARRAY_DESCRIPTOR desc1d{}; desc1d.Width = static_cast(N); @@ -624,8 +636,8 @@ TEST_CASE("Unit_HRR_AllApis_Direct", "[.][hrr-direct]") { desc1d.Format = HIP_AD_FORMAT_SIGNED_INT32; desc1d.NumChannels = 1; hipArray_t arr1d = nullptr; - HIP_CHECK(hipArrayCreate(&arr1d, &desc1d)); - HIP_CHECK(hipFreeArray(arr1d)); + HRR_HIP_CHECK(hipArrayCreate(&arr1d, &desc1d)); + HRR_HIP_CHECK(hipFreeArray(arr1d)); HIP_ARRAY3D_DESCRIPTOR desc3d{}; desc3d.Width = 4; @@ -635,33 +647,33 @@ TEST_CASE("Unit_HRR_AllApis_Direct", "[.][hrr-direct]") { desc3d.NumChannels = 1; desc3d.Flags = 0; hipArray_t arr3d = nullptr; - HIP_CHECK(hipArray3DCreate(&arr3d, &desc3d)); - HIP_CHECK(hipFreeArray(arr3d)); + HRR_HIP_CHECK(hipArray3DCreate(&arr3d, &desc3d)); + HRR_HIP_CHECK(hipFreeArray(arr3d)); } } // ========================================================================= // Cleanup (reverse allocation order) // ========================================================================= - if (managed_ok && d_managed) HIP_CHECK(hipFree(d_managed)); + if (managed_ok && d_managed) HRR_HIP_CHECK(hipFree(d_managed)); - HIP_CHECK(hipFreeAsync(d_pool, s0)); - HIP_CHECK(hipStreamSynchronize(s0)); - HIP_CHECK(hipMemPoolDestroy(pool)); + HRR_HIP_CHECK(hipFreeAsync(d_pool, s0)); + HRR_HIP_CHECK(hipStreamSynchronize(s0)); + HRR_HIP_CHECK(hipMemPoolDestroy(pool)); - HIP_CHECK(hipFreeAsync(d_async, s0)); - HIP_CHECK(hipStreamSynchronize(s0)); + HRR_HIP_CHECK(hipFreeAsync(d_async, s0)); + HRR_HIP_CHECK(hipStreamSynchronize(s0)); - HIP_CHECK(hipFree(d0)); HIP_CHECK(hipFree(d1)); HIP_CHECK(hipFree(d2)); - HIP_CHECK(hipFree(h_pinned)); + HRR_HIP_CHECK(hipFree(d0)); HRR_HIP_CHECK(hipFree(d1)); HRR_HIP_CHECK(hipFree(d2)); + HRR_HIP_CHECK(hipFree(h_pinned)); - HIP_CHECK(hipEventDestroy(ev_start)); - HIP_CHECK(hipEventDestroy(ev_stop)); - HIP_CHECK(hipEventDestroy(ev_nodur)); + HRR_HIP_CHECK(hipEventDestroy(ev_start)); + HRR_HIP_CHECK(hipEventDestroy(ev_stop)); + HRR_HIP_CHECK(hipEventDestroy(ev_nodur)); - HIP_CHECK(hipStreamDestroy(s0)); - HIP_CHECK(hipStreamDestroy(s1)); - HIP_CHECK(hipStreamDestroy(s2)); + HRR_HIP_CHECK(hipStreamDestroy(s0)); + HRR_HIP_CHECK(hipStreamDestroy(s1)); + HRR_HIP_CHECK(hipStreamDestroy(s2)); delete[] h_src; delete[] h_out; @@ -690,7 +702,7 @@ TEST_CASE("Unit_HRR_AllApis_Direct", "[.][hrr-direct]") { // Final D2H blob: h_out[i] == 2.0f (validated by playback). // --------------------------------------------------------------------------- TEST_CASE("Unit_HRR_StressApis_Direct", "[.][hrr-direct]") { - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); // ========================================================================= // Constants @@ -710,19 +722,19 @@ TEST_CASE("Unit_HRR_StressApis_Direct", "[.][hrr-direct]") { // ========================================================================= hipStream_t streams[STREAMS]; for (int i = 0; i < STREAMS; ++i) - HIP_CHECK(hipStreamCreateWithFlags(&streams[i], hipStreamNonBlocking)); + HRR_HIP_CHECK(hipStreamCreateWithFlags(&streams[i], hipStreamNonBlocking)); hipEvent_t evs[EVENTS]; for (int i = 0; i < EVENTS; ++i) - HIP_CHECK(hipEventCreate(&evs[i])); + HRR_HIP_CHECK(hipEventCreate(&evs[i])); // ========================================================================= // 2. Working buffers // ========================================================================= float *da, *db, *dc; - HIP_CHECK(hipMalloc(&da, SZ)); - HIP_CHECK(hipMalloc(&db, SZ)); - HIP_CHECK(hipMalloc(&dc, SZ)); + HRR_HIP_CHECK(hipMalloc(&da, SZ)); + HRR_HIP_CHECK(hipMalloc(&db, SZ)); + HRR_HIP_CHECK(hipMalloc(&dc, SZ)); float* ha = new float[N]; float* hb = new float[N]; @@ -730,11 +742,11 @@ TEST_CASE("Unit_HRR_StressApis_Direct", "[.][hrr-direct]") { for (int i = 0; i < N; ++i) { ha[i] = 1.0f; hb[i] = 1.0f; } // Initialise device buffers - HIP_CHECK(hipMemcpyAsync(da, ha, SZ, hipMemcpyHostToDevice, streams[0])); - HIP_CHECK(hipMemcpyAsync(db, hb, SZ, hipMemcpyHostToDevice, streams[1])); - HIP_CHECK(hipMemsetAsync(dc, 0, SZ, streams[0])); - HIP_CHECK(hipStreamSynchronize(streams[0])); - HIP_CHECK(hipStreamSynchronize(streams[1])); + HRR_HIP_CHECK(hipMemcpyAsync(da, ha, SZ, hipMemcpyHostToDevice, streams[0])); + HRR_HIP_CHECK(hipMemcpyAsync(db, hb, SZ, hipMemcpyHostToDevice, streams[1])); + HRR_HIP_CHECK(hipMemsetAsync(dc, 0, SZ, streams[0])); + HRR_HIP_CHECK(hipStreamSynchronize(streams[0])); + HRR_HIP_CHECK(hipStreamSynchronize(streams[1])); dim3 block(256), grid((N + 255) / 256); @@ -743,8 +755,8 @@ TEST_CASE("Unit_HRR_StressApis_Direct", "[.][hrr-direct]") { // ========================================================================= for (int i = 0; i < ALLOCS; ++i) { float* tmp = nullptr; - HIP_CHECK(hipMalloc(&tmp, SZ)); - HIP_CHECK(hipFree(tmp)); + HRR_HIP_CHECK(hipMalloc(&tmp, SZ)); + HRR_HIP_CHECK(hipFree(tmp)); } // ========================================================================= @@ -752,10 +764,10 @@ TEST_CASE("Unit_HRR_StressApis_Direct", "[.][hrr-direct]") { // ========================================================================= for (int i = 0; i < 10; ++i) { float* tmp = nullptr; - HIP_CHECK(hipMallocAsync(&tmp, SZ, streams[i % STREAMS])); - HIP_CHECK(hipStreamSynchronize(streams[i % STREAMS])); - HIP_CHECK(hipFreeAsync(tmp, streams[i % STREAMS])); - HIP_CHECK(hipStreamSynchronize(streams[i % STREAMS])); + HRR_HIP_CHECK(hipMallocAsync(&tmp, SZ, streams[i % STREAMS])); + HRR_HIP_CHECK(hipStreamSynchronize(streams[i % STREAMS])); + HRR_HIP_CHECK(hipFreeAsync(tmp, streams[i % STREAMS])); + HRR_HIP_CHECK(hipStreamSynchronize(streams[i % STREAMS])); } // ========================================================================= @@ -767,8 +779,8 @@ TEST_CASE("Unit_HRR_StressApis_Direct", "[.][hrr-direct]") { pp.allocType = hipMemAllocationTypePinned; pp.location.type = hipMemLocationTypeDevice; pp.location.id = 0; - HIP_CHECK(hipMemPoolCreate(&pool, &pp)); - HIP_CHECK(hipMemPoolDestroy(pool)); + HRR_HIP_CHECK(hipMemPoolCreate(&pool, &pp)); + HRR_HIP_CHECK(hipMemPoolDestroy(pool)); } // ========================================================================= @@ -778,43 +790,43 @@ TEST_CASE("Unit_HRR_StressApis_Direct", "[.][hrr-direct]") { for (int iter = 0; iter < KL_ITERS; ++iter) { hipStream_t s = streams[iter % STREAMS]; hipLaunchKernelGGL(hrr_vectorAdd, grid, block, 0, s, da, db, dc, N); - HIP_CHECK(hipGetLastError()); + HRR_HIP_CHECK(hipGetLastError()); // Interleave with event record every 10 launches (60/10 = 6 × 2 = 12 events) if (iter % 10 == 9) { hipEvent_t ev = evs[(iter / 10) % EVENTS]; - HIP_CHECK(hipEventRecord(ev, s)); - HIP_CHECK(hipEventSynchronize(ev)); + HRR_HIP_CHECK(hipEventRecord(ev, s)); + HRR_HIP_CHECK(hipEventSynchronize(ev)); } } - HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipDeviceSynchronize()); // ========================================================================= // 7. Memset rounds (MS_ITERS = 30 events) // ========================================================================= for (int i = 0; i < MS_ITERS; ++i) { hipStream_t s = streams[i % STREAMS]; - HIP_CHECK(hipMemsetAsync(dc, 0, SZ, s)); + HRR_HIP_CHECK(hipMemsetAsync(dc, 0, SZ, s)); } - HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipDeviceSynchronize()); // Restore dc = da + db = 2 hipLaunchKernelGGL(hrr_vectorAdd, grid, block, 0, streams[0], da, db, dc, N); - HIP_CHECK(hipGetLastError()); - HIP_CHECK(hipStreamSynchronize(streams[0])); + HRR_HIP_CHECK(hipGetLastError()); + HRR_HIP_CHECK(hipStreamSynchronize(streams[0])); // ========================================================================= // 8. H2D memcpy rounds (CP_ITERS = 30 events) // ========================================================================= for (int i = 0; i < CP_ITERS; ++i) { hipStream_t s = streams[i % STREAMS]; - HIP_CHECK(hipMemcpyAsync(da, ha, SZ, hipMemcpyHostToDevice, s)); + HRR_HIP_CHECK(hipMemcpyAsync(da, ha, SZ, hipMemcpyHostToDevice, s)); } - HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipDeviceSynchronize()); // ========================================================================= // 9. D2D copies (20 events) // ========================================================================= for (int i = 0; i < 20; ++i) { - HIP_CHECK(hipMemcpy(db, da, SZ, hipMemcpyDeviceToDevice)); + HRR_HIP_CHECK(hipMemcpy(db, da, SZ, hipMemcpyDeviceToDevice)); } // ========================================================================= @@ -823,30 +835,30 @@ TEST_CASE("Unit_HRR_StressApis_Direct", "[.][hrr-direct]") { for (int i = 0; i < 20; ++i) { hipEvent_t ev = evs[i % EVENTS]; hipStream_t s = streams[i % STREAMS]; - HIP_CHECK(hipEventRecord(ev, s)); - HIP_CHECK(hipEventSynchronize(ev)); + HRR_HIP_CHECK(hipEventRecord(ev, s)); + HRR_HIP_CHECK(hipEventSynchronize(ev)); } // ========================================================================= // 11. hipStreamSynchronize rounds (15 events) // ========================================================================= for (int i = 0; i < 15; ++i) - HIP_CHECK(hipStreamSynchronize(streams[i % STREAMS])); + HRR_HIP_CHECK(hipStreamSynchronize(streams[i % STREAMS])); // ========================================================================= // 12. Device attribute / info queries (10+10+10 = 30 events) // ========================================================================= for (int i = 0; i < 10; ++i) { int val = 0; - HIP_CHECK(hipDeviceGetAttribute(&val, hipDeviceAttributeMaxBlockDimX, 0)); + HRR_HIP_CHECK(hipDeviceGetAttribute(&val, hipDeviceAttributeMaxBlockDimX, 0)); } for (int i = 0; i < 10; ++i) { size_t mfree = 0, mtotal = 0; - HIP_CHECK(hipMemGetInfo(&mfree, &mtotal)); + HRR_HIP_CHECK(hipMemGetInfo(&mfree, &mtotal)); } for (int i = 0; i < 10; ++i) { hipPointerAttribute_t pa{}; - HIP_CHECK(hipPointerGetAttributes(&pa, dc)); + HRR_HIP_CHECK(hipPointerGetAttributes(&pa, dc)); } // ========================================================================= @@ -855,8 +867,8 @@ TEST_CASE("Unit_HRR_StressApis_Direct", "[.][hrr-direct]") { // ========================================================================= for (int i = 0; i < CP_ITERS; ++i) { hipStream_t s = streams[i % STREAMS]; - HIP_CHECK(hipMemcpyAsync(hc, dc, SZ, hipMemcpyDeviceToHost, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemcpyAsync(hc, dc, SZ, hipMemcpyDeviceToHost, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); } // ========================================================================= @@ -868,9 +880,9 @@ TEST_CASE("Unit_HRR_StressApis_Direct", "[.][hrr-direct]") { // ========================================================================= // Cleanup // ========================================================================= - HIP_CHECK(hipFree(da)); HIP_CHECK(hipFree(db)); HIP_CHECK(hipFree(dc)); - for (int i = 0; i < EVENTS; ++i) HIP_CHECK(hipEventDestroy(evs[i])); - for (int i = 0; i < STREAMS; ++i) HIP_CHECK(hipStreamDestroy(streams[i])); + HRR_HIP_CHECK(hipFree(da)); HRR_HIP_CHECK(hipFree(db)); HRR_HIP_CHECK(hipFree(dc)); + for (int i = 0; i < EVENTS; ++i) HRR_HIP_CHECK(hipEventDestroy(evs[i])); + for (int i = 0; i < STREAMS; ++i) HRR_HIP_CHECK(hipStreamDestroy(streams[i])); delete[] ha; delete[] hb; delete[] hc; } @@ -896,17 +908,17 @@ TEST_CASE("Unit_HRR_StressApis_Direct", "[.][hrr-direct]") { // HIP_HRR_D2H_EXACT=1 so the replay gate really is byte-for-byte. // =========================================================================== TEST_CASE("Unit_HRR_StreamWriteValue_Direct", "[.][hrr-direct]") { - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); // Stream write/wait value is an optional device capability. Gate on the same // attribute every other test of these APIs uses (catch/unit/stream/ // hipStreamValue.cc, Unit_HRR_StreamAdvanced2_Direct) so an unsupported // target skips instead of aborting the capture subprocess. int canUseStreamValue = 0; - HIP_CHECK(hipDeviceGetAttribute(&canUseStreamValue, + HRR_HIP_CHECK(hipDeviceGetAttribute(&canUseStreamValue, hipDeviceAttributeCanUseStreamWaitValue, 0)); if (!canUseStreamValue) { - HIP_SKIP_TEST(HipTest::SkipReason::kStreamWaitValueUnsupported); + HRR_SKIP("stream wait value unsupported"); } constexpr uint64_t kVal64 = 0xDEADBEEFFEEDFACEull; @@ -917,24 +929,24 @@ TEST_CASE("Unit_HRR_StreamWriteValue_Direct", "[.][hrr-direct]") { constexpr uint32_t kIncDelta = 0xF4E3F0C4u; hipStream_t s; - HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); + HRR_HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); // Two 64-bit slots so the 32-bit write and the 64-bit write land in disjoint, // fully-defined memory. uint64_t* d = nullptr; - HIP_CHECK(hipMalloc(&d, 2 * sizeof(uint64_t))); - HIP_CHECK(hipMemset(d, 0, 2 * sizeof(uint64_t))); + HRR_HIP_CHECK(hipMalloc(&d, 2 * sizeof(uint64_t))); + HRR_HIP_CHECK(hipMemset(d, 0, 2 * sizeof(uint64_t))); // Separate slot for the flags-bearing write. Allocated 8 bytes wide so a // 64-bit-granular implementation of the increment cannot overrun it. uint32_t* inc = nullptr; - HIP_CHECK(hipMalloc(&inc, sizeof(uint64_t))); - HIP_CHECK(hipMemset(inc, 0, sizeof(uint64_t))); + HRR_HIP_CHECK(hipMalloc(&inc, sizeof(uint64_t))); + HRR_HIP_CHECK(hipMemset(inc, 0, sizeof(uint64_t))); // 64-bit stream write into slot0. - HIP_CHECK(hipStreamWriteValue64(s, d, kVal64, 0)); + HRR_HIP_CHECK(hipStreamWriteValue64(s, d, kVal64, 0)); // 32-bit stream write into slot1 (low 32 bits); the high 32 bits stay zero. - HIP_CHECK(hipStreamWriteValue32(s, d + 1, kVal32, 0)); + HRR_HIP_CHECK(hipStreamWriteValue32(s, d + 1, kVal32, 0)); // Flags are plumbed through capture and replay, so exercise a non-default one. // hipExtStreamWriteValueIncrement turns the write into a read-modify-write, @@ -943,35 +955,35 @@ TEST_CASE("Unit_HRR_StreamWriteValue_Direct", "[.][hrr-direct]") { // target, so tolerate a rejection: capture only records successful calls, so // on a target that rejects it the slot simply keeps kIncBase in both the // recorded blob and the replay. - HIP_CHECK(hipStreamWriteValue32(s, inc, kIncBase, 0)); + HRR_HIP_CHECK(hipStreamWriteValue32(s, inc, kIncBase, 0)); hipError_t incErr = hipStreamWriteValue32(s, inc, kIncDelta, hipExtStreamWriteValueIncrement); REQUIRE((incErr == hipSuccess || incErr == hipErrorInvalidValue || incErr == hipErrorNotSupported)); - HIP_CHECK(hipStreamSynchronize(s)); - HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipDeviceSynchronize()); // One readback per value: an 8-byte blob for the 64-bit write and 4-byte blobs // for the 32-bit ones (see the note above on the f64 candidate encoding). uint64_t h64 = 0; - HIP_CHECK(hipMemcpy(&h64, d, sizeof(h64), hipMemcpyDeviceToHost)); + HRR_HIP_CHECK(hipMemcpy(&h64, d, sizeof(h64), hipMemcpyDeviceToHost)); REQUIRE(h64 == kVal64); uint32_t h32 = 0; - HIP_CHECK(hipMemcpy(&h32, d + 1, sizeof(h32), hipMemcpyDeviceToHost)); + HRR_HIP_CHECK(hipMemcpy(&h32, d + 1, sizeof(h32), hipMemcpyDeviceToHost)); REQUIRE(h32 == kVal32); uint32_t hInc = 0; - HIP_CHECK(hipMemcpy(&hInc, inc, sizeof(hInc), hipMemcpyDeviceToHost)); + HRR_HIP_CHECK(hipMemcpy(&hInc, inc, sizeof(hInc), hipMemcpyDeviceToHost)); // Deliberately not asserting the exact sum: the point of this slot is that // replay reproduces whatever the increment produced at capture time. Only // assert that a successful increment of a non-zero delta changed the slot. if (incErr == hipSuccess) REQUIRE(hInc != kIncBase); - HIP_CHECK(hipFree(inc)); - HIP_CHECK(hipFree(d)); - HIP_CHECK(hipStreamDestroy(s)); + HRR_HIP_CHECK(hipFree(inc)); + HRR_HIP_CHECK(hipFree(d)); + HRR_HIP_CHECK(hipStreamDestroy(s)); } // =========================================================================== @@ -1045,28 +1057,28 @@ void d2d_count_matches(const std::vector& buf, unsigned int patte // kD2DSentinelByte. // =========================================================================== TEST_CASE("Unit_HRR_MemsetD2D_Direct", "[.][hrr-direct]") { - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); hipStream_t s; - HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); + HRR_HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); void* d = nullptr; - HIP_CHECK(hipMalloc(&d, kD2DTotal)); + HRR_HIP_CHECK(hipMalloc(&d, kD2DTotal)); const hipDeviceptr_t dp = reinterpret_cast(d); // Sentinel the whole allocation, padding included, using an API that is // already replayed faithfully, so the padding has a known non-zero value // that the pitched fills below must leave alone. - HIP_CHECK(hipMemsetD8(dp, kD2DSentinelByte, kD2DTotal)); - HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipMemsetD8(dp, kD2DSentinelByte, kD2DTotal)); + HRR_HIP_CHECK(hipDeviceSynchronize()); // Pitched fills, kD2DWidth bytes per row only. - HIP_CHECK(hipMemsetD2D8(dp, kD2DPitch, 0x11, kD2DWidth, kD2DRows)); - HIP_CHECK(hipMemsetD2D8Async(dp, kD2DPitch, 0x22, kD2DWidth, kD2DRows, s)); - HIP_CHECK(hipMemsetD2D16(dp, kD2DPitch, 0x3333, kD2DWidth, kD2DRows)); - HIP_CHECK(hipMemsetD2D16Async(dp, kD2DPitch, 0x4444, kD2DWidth, kD2DRows, s)); - HIP_CHECK(hipMemsetD2D32(dp, kD2DPitch, 0x11223344u, kD2DWidth, kD2DRows)); - HIP_CHECK(hipMemsetD2D32Async(dp, kD2DPitch, 0x55667788u, kD2DWidth, kD2DRows, s)); + HRR_HIP_CHECK(hipMemsetD2D8(dp, kD2DPitch, 0x11, kD2DWidth, kD2DRows)); + HRR_HIP_CHECK(hipMemsetD2D8Async(dp, kD2DPitch, 0x22, kD2DWidth, kD2DRows, s)); + HRR_HIP_CHECK(hipMemsetD2D16(dp, kD2DPitch, 0x3333, kD2DWidth, kD2DRows)); + HRR_HIP_CHECK(hipMemsetD2D16Async(dp, kD2DPitch, 0x4444, kD2DWidth, kD2DRows, s)); + HRR_HIP_CHECK(hipMemsetD2D32(dp, kD2DPitch, 0x11223344u, kD2DWidth, kD2DRows)); + HRR_HIP_CHECK(hipMemsetD2D32Async(dp, kD2DPitch, 0x55667788u, kD2DWidth, kD2DRows, s)); // The non-Async D2D memsets are NOT synchronous here: ihipMemset3D flips // isAsync true for a plain device allocation at offset 0 and enqueues on the @@ -1074,16 +1086,16 @@ TEST_CASE("Unit_HRR_MemsetD2D_Direct", "[.][hrr-direct]") { // it never implicitly waits on the null stream. The fills above are // therefore mutually unordered. Drain the device, then issue one final // deterministic fill and drain again, so the captured end state is unique. - HIP_CHECK(hipDeviceSynchronize()); - HIP_CHECK(hipMemsetD2D32(dp, kD2DPitch, kD2DPattern, kD2DWidth, kD2DRows)); - HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipMemsetD2D32(dp, kD2DPitch, kD2DPattern, kD2DWidth, kD2DRows)); + HRR_HIP_CHECK(hipDeviceSynchronize()); // D2H the WHOLE allocation so the captured blob covers the padding too. std::vector h(kD2DTotal, 0); - HIP_CHECK(hipMemcpy(h.data(), d, kD2DTotal, hipMemcpyDeviceToHost)); + HRR_HIP_CHECK(hipMemcpy(h.data(), d, kD2DTotal, hipMemcpyDeviceToHost)); - HIP_CHECK(hipFree(d)); - HIP_CHECK(hipStreamDestroy(s)); + HRR_HIP_CHECK(hipFree(d)); + HRR_HIP_CHECK(hipStreamDestroy(s)); size_t filled_ok = 0, padding_ok = 0; d2d_count_matches(h, kD2DPattern, &filled_ok, &padding_ok); @@ -1108,15 +1120,15 @@ TEST_CASE("Unit_HRR_MemsetD2D_Direct", "[.][hrr-direct]") { // which is what makes the roundtrip a regression guard for the skip path. // =========================================================================== TEST_CASE("Unit_HRR_MemsetD2DPitchAlloc_Direct", "[.][hrr-direct]") { - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); hipStream_t s; - HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); + HRR_HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); // Destination that replay cannot translate. hipDeviceptr_t pitched = nullptr; size_t pitch = 0; - HIP_CHECK(hipMemAllocPitch(&pitched, &pitch, kD2DWidth, kD2DRows, + HRR_HIP_CHECK(hipMemAllocPitch(&pitched, &pitch, kD2DWidth, kD2DRows, /*elementSizeBytes=*/4)); REQUIRE(pitched != nullptr); REQUIRE(pitch >= kD2DWidth); @@ -1125,29 +1137,29 @@ TEST_CASE("Unit_HRR_MemsetD2DPitchAlloc_Direct", "[.][hrr-direct]") { // These fills are mutually unordered (null stream vs non-blocking `s`), which // is harmless: this buffer is never read back, only its recorded destination // matters. - HIP_CHECK(hipMemsetD2D8(pitched, pitch, 0x11, kD2DWidth, kD2DRows)); - HIP_CHECK(hipMemsetD2D8Async(pitched, pitch, 0x22, kD2DWidth, kD2DRows, s)); - HIP_CHECK(hipMemsetD2D16(pitched, pitch, 0x3333, kD2DWidth, kD2DRows)); - HIP_CHECK(hipMemsetD2D16Async(pitched, pitch, 0x4444, kD2DWidth, kD2DRows, s)); - HIP_CHECK(hipMemsetD2D32(pitched, pitch, 0x11223344u, kD2DWidth, kD2DRows)); - HIP_CHECK(hipMemsetD2D32Async(pitched, pitch, kD2DPattern, kD2DWidth, kD2DRows, s)); - HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipMemsetD2D8(pitched, pitch, 0x11, kD2DWidth, kD2DRows)); + HRR_HIP_CHECK(hipMemsetD2D8Async(pitched, pitch, 0x22, kD2DWidth, kD2DRows, s)); + HRR_HIP_CHECK(hipMemsetD2D16(pitched, pitch, 0x3333, kD2DWidth, kD2DRows)); + HRR_HIP_CHECK(hipMemsetD2D16Async(pitched, pitch, 0x4444, kD2DWidth, kD2DRows, s)); + HRR_HIP_CHECK(hipMemsetD2D32(pitched, pitch, 0x11223344u, kD2DWidth, kD2DRows)); + HRR_HIP_CHECK(hipMemsetD2D32Async(pitched, pitch, kD2DPattern, kD2DWidth, kD2DRows, s)); + HRR_HIP_CHECK(hipDeviceSynchronize()); // Translatable destination: this is the blob replay must still validate. void* d = nullptr; - HIP_CHECK(hipMalloc(&d, kD2DTotal)); + HRR_HIP_CHECK(hipMalloc(&d, kD2DTotal)); const hipDeviceptr_t dp = reinterpret_cast(d); - HIP_CHECK(hipMemsetD8(dp, kD2DSentinelByte, kD2DTotal)); - HIP_CHECK(hipDeviceSynchronize()); - HIP_CHECK(hipMemsetD2D32(dp, kD2DPitch, kD2DPattern, kD2DWidth, kD2DRows)); - HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipMemsetD8(dp, kD2DSentinelByte, kD2DTotal)); + HRR_HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipMemsetD2D32(dp, kD2DPitch, kD2DPattern, kD2DWidth, kD2DRows)); + HRR_HIP_CHECK(hipDeviceSynchronize()); std::vector h(kD2DTotal, 0); - HIP_CHECK(hipMemcpy(h.data(), d, kD2DTotal, hipMemcpyDeviceToHost)); + HRR_HIP_CHECK(hipMemcpy(h.data(), d, kD2DTotal, hipMemcpyDeviceToHost)); - HIP_CHECK(hipFree(d)); - HIP_CHECK(hipFree(reinterpret_cast(pitched))); - HIP_CHECK(hipStreamDestroy(s)); + HRR_HIP_CHECK(hipFree(d)); + HRR_HIP_CHECK(hipFree(reinterpret_cast(pitched))); + HRR_HIP_CHECK(hipStreamDestroy(s)); size_t filled_ok = 0, padding_ok = 0; d2d_count_matches(h, kD2DPattern, &filled_ok, &padding_ok); @@ -1162,7 +1174,7 @@ TEST_CASE("Unit_HRR_MemsetD2DPitchAlloc_Direct", "[.][hrr-direct]") { // Final blob: h[i] == 0x44444444 (set by hipMemsetD32 at the end). // =========================================================================== TEST_CASE("Unit_HRR_MemsetVariants_Direct", "[.][hrr-direct]") { - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); constexpr int N = 1024; constexpr size_t SZ = N * sizeof(int); // 4096 bytes @@ -1176,47 +1188,47 @@ TEST_CASE("Unit_HRR_MemsetVariants_Direct", "[.][hrr-direct]") { constexpr int VAL = 0x44444444; hipStream_t s; - HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); + HRR_HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); int* d = nullptr; - HIP_CHECK(hipMalloc(&d, SZ)); + HRR_HIP_CHECK(hipMalloc(&d, SZ)); // hipMemsetD8 / hipMemsetD8Async (count = bytes) - HIP_CHECK(hipMemsetD8(reinterpret_cast(d), 0x01, SZ)); - HIP_CHECK(hipMemsetD8Async(reinterpret_cast(d), 0x02, SZ, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemsetD8(reinterpret_cast(d), 0x01, SZ)); + HRR_HIP_CHECK(hipMemsetD8Async(reinterpret_cast(d), 0x02, SZ, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); // hipMemsetD16 / hipMemsetD16Async (count = 16-bit elements) - HIP_CHECK(hipMemsetD16(reinterpret_cast(d), 0x0003, SZ / 2)); - HIP_CHECK(hipMemsetD16Async(reinterpret_cast(d), 0x0004, SZ / 2, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemsetD16(reinterpret_cast(d), 0x0003, SZ / 2)); + HRR_HIP_CHECK(hipMemsetD16Async(reinterpret_cast(d), 0x0004, SZ / 2, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); // hipMemsetD32 / hipMemsetD32Async (count = 32-bit elements) - HIP_CHECK(hipMemsetD32(reinterpret_cast(d), 2, N)); - HIP_CHECK(hipMemsetD32Async(reinterpret_cast(d), 2, N, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemsetD32(reinterpret_cast(d), 2, N)); + HRR_HIP_CHECK(hipMemsetD32Async(reinterpret_cast(d), 2, N, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); // hipMemset2D / hipMemset2DAsync — treat d as 32-col × 32-row 2D buffer constexpr size_t COLS = 32; constexpr size_t ROWS = N / COLS; constexpr size_t PITCH = COLS * sizeof(int); - HIP_CHECK(hipMemset2D(d, PITCH, 0, PITCH, ROWS)); - HIP_CHECK(hipMemset2DAsync(d, PITCH, 0, PITCH, ROWS, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemset2D(d, PITCH, 0, PITCH, ROWS)); + HRR_HIP_CHECK(hipMemset2DAsync(d, PITCH, 0, PITCH, ROWS, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); // Restore the final validation pattern - HIP_CHECK(hipDeviceSynchronize()); // ensure all async ops complete first - HIP_CHECK(hipMemsetD32(reinterpret_cast(d), VAL, N)); - HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipDeviceSynchronize()); // ensure all async ops complete first + HRR_HIP_CHECK(hipMemsetD32(reinterpret_cast(d), VAL, N)); + HRR_HIP_CHECK(hipDeviceSynchronize()); // D2H blob — playback validates all values == VAL int* h = new int[N](); - HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); for (int i = 0; i < N; ++i) REQUIRE(h[i] == VAL); - HIP_CHECK(hipFree(d)); - HIP_CHECK(hipStreamDestroy(s)); + HRR_HIP_CHECK(hipFree(d)); + HRR_HIP_CHECK(hipStreamDestroy(s)); delete[] h; } @@ -1232,19 +1244,19 @@ TEST_CASE("Unit_HRR_MemsetVariants_Direct", "[.][hrr-direct]") { // hipDeviceGraphMemTrim, hipDevicePrimaryCtxGetState. // =========================================================================== TEST_CASE("Unit_HRR_DeviceInfo_Direct", "[.][hrr-direct]") { - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); // hipInit — idempotent - HIP_CHECK(hipInit(0)); + HRR_HIP_CHECK(hipInit(0)); // hipGetDevice int dev = -1; - HIP_CHECK(hipGetDevice(&dev)); + HRR_HIP_CHECK(hipGetDevice(&dev)); REQUIRE(dev == 0); // hipDeviceGetName char devname[256] = {}; - HIP_CHECK(hipDeviceGetName(devname, sizeof(devname), dev)); + HRR_HIP_CHECK(hipDeviceGetName(devname, sizeof(devname), dev)); // On some Linux ROCm builds hipDeviceGetName returns an empty string due to // driver metadata not being fully populated. Log it but do not assert — // this is a driver issue, not an HRR bug. @@ -1252,75 +1264,75 @@ TEST_CASE("Unit_HRR_DeviceInfo_Direct", "[.][hrr-direct]") { // hipDeviceGetPCIBusId + hipDeviceGetByPCIBusId roundtrip char pci[64] = {}; - HIP_CHECK(hipDeviceGetPCIBusId(pci, sizeof(pci), dev)); + HRR_HIP_CHECK(hipDeviceGetPCIBusId(pci, sizeof(pci), dev)); int dev2 = -1; - HIP_CHECK(hipDeviceGetByPCIBusId(&dev2, pci)); + HRR_HIP_CHECK(hipDeviceGetByPCIBusId(&dev2, pci)); REQUIRE(dev2 == dev); // hipDeviceTotalMem size_t totalMem = 0; - HIP_CHECK(hipDeviceTotalMem(&totalMem, dev)); + HRR_HIP_CHECK(hipDeviceTotalMem(&totalMem, dev)); REQUIRE(totalMem > 0); // hipDeviceComputeCapability int major = 0, minor = 0; - HIP_CHECK(hipDeviceComputeCapability(&major, &minor, dev)); + HRR_HIP_CHECK(hipDeviceComputeCapability(&major, &minor, dev)); REQUIRE(major > 0); // hipDeviceGetLimit / hipDeviceSetLimit size_t stackSize = 0; - HIP_CHECK(hipDeviceGetLimit(&stackSize, hipLimitStackSize)); - HIP_CHECK(hipDeviceSetLimit(hipLimitStackSize, stackSize)); + HRR_HIP_CHECK(hipDeviceGetLimit(&stackSize, hipLimitStackSize)); + HRR_HIP_CHECK(hipDeviceSetLimit(hipLimitStackSize, stackSize)); // hipDeviceGetSharedMemConfig / hipDeviceSetSharedMemConfig hipSharedMemConfig shmCfg = hipSharedMemBankSizeDefault; - HIP_CHECK(hipDeviceGetSharedMemConfig(&shmCfg)); - HIP_CHECK(hipDeviceSetSharedMemConfig(shmCfg)); + HRR_HIP_CHECK(hipDeviceGetSharedMemConfig(&shmCfg)); + HRR_HIP_CHECK(hipDeviceSetSharedMemConfig(shmCfg)); // hipGetDeviceFlags — query only (hipSetDeviceFlags resets the context, skip) unsigned int dflags = 0; - HIP_CHECK(hipGetDeviceFlags(&dflags)); + HRR_HIP_CHECK(hipGetDeviceFlags(&dflags)); // hipChooseDevice hipDeviceProp_t req{}; - HIP_CHECK(hipGetDeviceProperties(&req, 0)); + HRR_HIP_CHECK(hipGetDeviceProperties(&req, 0)); int chosen = -1; - HIP_CHECK(hipChooseDevice(&chosen, &req)); + HRR_HIP_CHECK(hipChooseDevice(&chosen, &req)); REQUIRE(chosen >= 0); // D2H blob setup — allocate BEFORE pool/graph queries to avoid SEH side effects constexpr int N = 256; constexpr size_t SZ = N * sizeof(int); int* d = nullptr; int* h = new int[N](); - HIP_CHECK(hipMalloc(&d, SZ)); + HRR_HIP_CHECK(hipMalloc(&d, SZ)); hipStream_t s; - HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); + HRR_HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); // hipDeviceGetDefaultMemPool hipMemPool_t defPool = nullptr; - HIP_CHECK(hipDeviceGetDefaultMemPool(&defPool, dev)); + HRR_HIP_CHECK(hipDeviceGetDefaultMemPool(&defPool, dev)); REQUIRE(defPool != nullptr); // hipDeviceGetMemPool — query only (SetMemPool can reset pool context) hipMemPool_t curPool = nullptr; - HIP_CHECK(hipDeviceGetMemPool(&curPool, dev)); + HRR_HIP_CHECK(hipDeviceGetMemPool(&curPool, dev)); // hipDeviceGetGraphMemAttribute — query only uint64_t usedMem = 0; - HIP_CHECK(hipDeviceGetGraphMemAttribute(dev, hipGraphMemAttrUsedMemCurrent, &usedMem)); + HRR_HIP_CHECK(hipDeviceGetGraphMemAttribute(dev, hipGraphMemAttrUsedMemCurrent, &usedMem)); // hipDevicePrimaryCtxGetState — query only unsigned int ctxFlags = 0; int ctxActive = 0; - HIP_CHECK(hipDevicePrimaryCtxGetState(dev, &ctxFlags, &ctxActive)); + HRR_HIP_CHECK(hipDevicePrimaryCtxGetState(dev, &ctxFlags, &ctxActive)); // D2H blob (value = 7) for playback validation - HIP_CHECK(hipMemsetD32(reinterpret_cast(d), 7, N)); - HIP_CHECK(hipDeviceSynchronize()); - HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemsetD32(reinterpret_cast(d), 7, N)); + HRR_HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); for (int i = 0; i < N; ++i) REQUIRE(h[i] == 7); - HIP_CHECK(hipFree(d)); - HIP_CHECK(hipStreamDestroy(s)); + HRR_HIP_CHECK(hipFree(d)); + HRR_HIP_CHECK(hipStreamDestroy(s)); delete[] h; } @@ -1333,33 +1345,33 @@ TEST_CASE("Unit_HRR_DeviceInfo_Direct", "[.][hrr-direct]") { // hipEventRecordWithFlags, hipStreamQuery. // =========================================================================== TEST_CASE("Unit_HRR_StreamAdvanced_Direct", "[.][hrr-direct]") { - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); hipStream_t s0, s1; - HIP_CHECK(hipStreamCreateWithFlags(&s0, hipStreamNonBlocking)); - HIP_CHECK(hipStreamCreateWithPriority(&s1, hipStreamNonBlocking, 0)); + HRR_HIP_CHECK(hipStreamCreateWithFlags(&s0, hipStreamNonBlocking)); + HRR_HIP_CHECK(hipStreamCreateWithPriority(&s1, hipStreamNonBlocking, 0)); // hipStreamGetId unsigned long long sid = 0; - HIP_CHECK(hipStreamGetId(s0, &sid)); + HRR_HIP_CHECK(hipStreamGetId(s0, &sid)); REQUIRE(sid != 0); // hipStreamGetAttribute / hipStreamSetAttribute roundtrip hipStreamAttrValue av{}; - HIP_CHECK(hipStreamGetAttribute(s0, hipStreamAttributeSynchronizationPolicy, &av)); - HIP_CHECK(hipStreamSetAttribute(s0, hipStreamAttributeSynchronizationPolicy, &av)); + HRR_HIP_CHECK(hipStreamGetAttribute(s0, hipStreamAttributeSynchronizationPolicy, &av)); + HRR_HIP_CHECK(hipStreamSetAttribute(s0, hipStreamAttributeSynchronizationPolicy, &av)); // hipStreamCopyAttributes - HIP_CHECK(hipStreamCopyAttributes(s1, s0)); + HRR_HIP_CHECK(hipStreamCopyAttributes(s1, s0)); // hipStreamIsCapturing hipStreamCaptureStatus capStatus = hipStreamCaptureStatusActive; - HIP_CHECK(hipStreamIsCapturing(s0, &capStatus)); + HRR_HIP_CHECK(hipStreamIsCapturing(s0, &capStatus)); REQUIRE(capStatus == hipStreamCaptureStatusNone); // hipStreamGetCaptureInfo unsigned long long capId = 0; - HIP_CHECK(hipStreamGetCaptureInfo(s0, &capStatus, &capId)); + HRR_HIP_CHECK(hipStreamGetCaptureInfo(s0, &capStatus, &capId)); REQUIRE(capStatus == hipStreamCaptureStatusNone); // hipStreamGetDevice (may return hipErrorInvalidValue on some ROCm builds) @@ -1372,39 +1384,39 @@ TEST_CASE("Unit_HRR_StreamAdvanced_Direct", "[.][hrr-direct]") { // hipEventRecordWithFlags hipEvent_t ev; - HIP_CHECK(hipEventCreate(&ev)); - HIP_CHECK(hipEventRecordWithFlags(ev, s0, 0)); - HIP_CHECK(hipEventSynchronize(ev)); + HRR_HIP_CHECK(hipEventCreate(&ev)); + HRR_HIP_CHECK(hipEventRecordWithFlags(ev, s0, 0)); + HRR_HIP_CHECK(hipEventSynchronize(ev)); - HIP_CHECK(hipStreamSynchronize(s0)); - HIP_CHECK(hipStreamSynchronize(s1)); + HRR_HIP_CHECK(hipStreamSynchronize(s0)); + HRR_HIP_CHECK(hipStreamSynchronize(s1)); // hipThreadExchangeStreamCaptureMode — query/restore at the very end, // after all stream work is complete, to avoid interfering with work submission. hipStreamCaptureMode mode = hipStreamCaptureModeGlobal; - HIP_CHECK(hipThreadExchangeStreamCaptureMode(&mode)); - HIP_CHECK(hipThreadExchangeStreamCaptureMode(&mode)); // restore original + HRR_HIP_CHECK(hipThreadExchangeStreamCaptureMode(&mode)); + HRR_HIP_CHECK(hipThreadExchangeStreamCaptureMode(&mode)); // restore original - HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipDeviceSynchronize()); // D2H blob (value = 5) for playback validation constexpr int N = 256; constexpr size_t SZ = N * sizeof(int); int* d = nullptr; int* h = new int[N](); - HIP_CHECK(hipMalloc(&d, SZ)); + HRR_HIP_CHECK(hipMalloc(&d, SZ)); // Use hipMemset (byte-pattern) + value 5 via kernel: set all bytes to 0, // then use hipMemsetD32 for the specific integer value. - HIP_CHECK(hipMemsetAsync(d, 0, SZ, s0)); - HIP_CHECK(hipStreamSynchronize(s0)); - HIP_CHECK(hipMemsetD32(reinterpret_cast(d), 5, N)); - HIP_CHECK(hipDeviceSynchronize()); - HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s0)); - HIP_CHECK(hipStreamSynchronize(s0)); + HRR_HIP_CHECK(hipMemsetAsync(d, 0, SZ, s0)); + HRR_HIP_CHECK(hipStreamSynchronize(s0)); + HRR_HIP_CHECK(hipMemsetD32(reinterpret_cast(d), 5, N)); + HRR_HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s0)); + HRR_HIP_CHECK(hipStreamSynchronize(s0)); for (int i = 0; i < N; ++i) REQUIRE(h[i] == 5); - HIP_CHECK(hipFree(d)); - HIP_CHECK(hipEventDestroy(ev)); - HIP_CHECK(hipStreamDestroy(s0)); - HIP_CHECK(hipStreamDestroy(s1)); + HRR_HIP_CHECK(hipFree(d)); + HRR_HIP_CHECK(hipEventDestroy(ev)); + HRR_HIP_CHECK(hipStreamDestroy(s0)); + HRR_HIP_CHECK(hipStreamDestroy(s1)); delete[] h; } @@ -1417,80 +1429,80 @@ TEST_CASE("Unit_HRR_StreamAdvanced_Direct", "[.][hrr-direct]") { // Final blob: h_out[i] == 99. // =========================================================================== TEST_CASE("Unit_HRR_DrvMemcpy_Direct", "[.][hrr-direct]") { - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); constexpr int N = 512; constexpr size_t SZ = N * sizeof(int); hipStream_t s; - HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); + HRR_HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); int *d0, *d1, *d2; - HIP_CHECK(hipMalloc(&d0, SZ)); - HIP_CHECK(hipMalloc(&d1, SZ)); - HIP_CHECK(hipMalloc(&d2, SZ)); + HRR_HIP_CHECK(hipMalloc(&d0, SZ)); + HRR_HIP_CHECK(hipMalloc(&d1, SZ)); + HRR_HIP_CHECK(hipMalloc(&d2, SZ)); int* h_src = new int[N]; for (int i = 0; i < N; ++i) h_src[i] = 99; // hipMemcpyHtoD (driver-style, sync) + device sync to ensure completion - HIP_CHECK(hipMemcpyHtoD(reinterpret_cast(d0), h_src, SZ)); - HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipMemcpyHtoD(reinterpret_cast(d0), h_src, SZ)); + HRR_HIP_CHECK(hipDeviceSynchronize()); // hipMemcpyDtoD (sync) - HIP_CHECK(hipMemcpyDtoD(reinterpret_cast(d1), + HRR_HIP_CHECK(hipMemcpyDtoD(reinterpret_cast(d1), reinterpret_cast(d0), SZ)); - HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipDeviceSynchronize()); // hipMemcpyDtoDAsync - HIP_CHECK(hipMemcpyDtoDAsync(reinterpret_cast(d2), + HRR_HIP_CHECK(hipMemcpyDtoDAsync(reinterpret_cast(d2), reinterpret_cast(d1), SZ, s)); - HIP_CHECK(hipStreamSynchronize(s)); - HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipDeviceSynchronize()); // hipMemcpyDtoH (sync) int* h_mid = new int[N](); - HIP_CHECK(hipMemcpyDtoH(h_mid, reinterpret_cast(d2), SZ)); + HRR_HIP_CHECK(hipMemcpyDtoH(h_mid, reinterpret_cast(d2), SZ)); for (int i = 0; i < N; ++i) REQUIRE(h_mid[i] == 99); // hipMemcpyDtoHAsync int* h_mid2 = new int[N](); - HIP_CHECK(hipMemcpyDtoHAsync(h_mid2, reinterpret_cast(d2), SZ, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemcpyDtoHAsync(h_mid2, reinterpret_cast(d2), SZ, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); for (int i = 0; i < N; ++i) REQUIRE(h_mid2[i] == 99); // hipMemcpyHtoDAsync (driver-style, async) - HIP_CHECK(hipMemcpyHtoDAsync(reinterpret_cast(d0), h_src, SZ, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemcpyHtoDAsync(reinterpret_cast(d0), h_src, SZ, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); // hipMemcpy2D (flat 1-row, sync D2D) - HIP_CHECK(hipMemcpy2D(d1, SZ, d2, SZ, SZ, 1, hipMemcpyDeviceToDevice)); + HRR_HIP_CHECK(hipMemcpy2D(d1, SZ, d2, SZ, SZ, 1, hipMemcpyDeviceToDevice)); // hipMemcpy2DAsync - HIP_CHECK(hipMemcpy2DAsync(d2, SZ, d0, SZ, SZ, 1, hipMemcpyDeviceToDevice, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemcpy2DAsync(d2, SZ, d0, SZ, SZ, 1, hipMemcpyDeviceToDevice, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); // hipMallocPitch + hipMemcpy2D into pitched buffer size_t pitch = 0; int* d_p = nullptr; - HIP_CHECK(hipMallocPitch(reinterpret_cast(&d_p), &pitch, + HRR_HIP_CHECK(hipMallocPitch(reinterpret_cast(&d_p), &pitch, N * sizeof(int), 4)); - HIP_CHECK(hipMemcpy2D(d_p, pitch, d0, SZ, N * sizeof(int), 1, + HRR_HIP_CHECK(hipMemcpy2D(d_p, pitch, d0, SZ, N * sizeof(int), 1, hipMemcpyDeviceToDevice)); - HIP_CHECK(hipFree(d_p)); + HRR_HIP_CHECK(hipFree(d_p)); // hipMemcpyPeer / hipMemcpyPeerAsync (src==dst device == 0, valid as D2D) - HIP_CHECK(hipMemcpyPeer(d1, 0, d0, 0, SZ)); - HIP_CHECK(hipMemcpyPeerAsync(d2, 0, d1, 0, SZ, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemcpyPeer(d1, 0, d0, 0, SZ)); + HRR_HIP_CHECK(hipMemcpyPeerAsync(d2, 0, d1, 0, SZ, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); // Final D2H blob via hipMemcpyAsync — blob captured, playback validates 99 int* h_out = new int[N](); - HIP_CHECK(hipMemcpyAsync(h_out, d2, SZ, hipMemcpyDeviceToHost, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemcpyAsync(h_out, d2, SZ, hipMemcpyDeviceToHost, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); for (int i = 0; i < N; ++i) REQUIRE(h_out[i] == 99); - HIP_CHECK(hipFree(d0)); HIP_CHECK(hipFree(d1)); HIP_CHECK(hipFree(d2)); - HIP_CHECK(hipStreamDestroy(s)); + HRR_HIP_CHECK(hipFree(d0)); HRR_HIP_CHECK(hipFree(d1)); HRR_HIP_CHECK(hipFree(d2)); + HRR_HIP_CHECK(hipStreamDestroy(s)); delete[] h_src; delete[] h_mid; delete[] h_mid2; delete[] h_out; } @@ -1509,59 +1521,59 @@ static __global__ void fill_kernel_e(int* d, int val, int n) { } TEST_CASE("Unit_HRR_Occupancy_Direct", "[.][hrr-direct]") { - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); constexpr int N = 256; constexpr size_t SZ = N * sizeof(int); // hipOccupancyMaxActiveBlocksPerMultiprocessor int numBlocks = 0; - HIP_CHECK(hipOccupancyMaxActiveBlocksPerMultiprocessor( + HRR_HIP_CHECK(hipOccupancyMaxActiveBlocksPerMultiprocessor( &numBlocks, fill_kernel_e, 64, 0)); REQUIRE(numBlocks > 0); // hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags int numBlocks2 = 0; - HIP_CHECK(hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags( + HRR_HIP_CHECK(hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags( &numBlocks2, fill_kernel_e, 64, 0, hipOccupancyDefault)); REQUIRE(numBlocks2 > 0); // hipOccupancyMaxPotentialBlockSize int minGridSize = 0, blockSize = 0; - HIP_CHECK(hipOccupancyMaxPotentialBlockSize( + HRR_HIP_CHECK(hipOccupancyMaxPotentialBlockSize( &minGridSize, &blockSize, fill_kernel_e, 0, 0)); REQUIRE(blockSize > 0); // hipLaunchCooperativeKernel — guarded by cooperative launch support int* d = nullptr; - HIP_CHECK(hipMalloc(&d, SZ)); + HRR_HIP_CHECK(hipMalloc(&d, SZ)); hipStream_t s; - HIP_CHECK(hipStreamCreate(&s)); + HRR_HIP_CHECK(hipStreamCreate(&s)); int supportsCoopLaunch = 0; - HIP_CHECK(hipDeviceGetAttribute(&supportsCoopLaunch, + HRR_HIP_CHECK(hipDeviceGetAttribute(&supportsCoopLaunch, hipDeviceAttributeCooperativeLaunch, 0)); int val = 3; dim3 grid((N + 63) / 64), block(64); if (supportsCoopLaunch) { void* args[] = {&d, &val, const_cast(&N)}; - HIP_CHECK(hipLaunchCooperativeKernel( + HRR_HIP_CHECK(hipLaunchCooperativeKernel( reinterpret_cast(fill_kernel_e), grid, block, args, 0, s)); } else { // Fall back to regular launch to still exercise the kernel path hipLaunchKernelGGL(fill_kernel_e, grid, block, 0, s, d, val, N); } - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); // D2H blob (value = 3) int* h = new int[N](); - HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); for (int i = 0; i < N; ++i) REQUIRE(h[i] == 3); - HIP_CHECK(hipFree(d)); - HIP_CHECK(hipStreamDestroy(s)); + HRR_HIP_CHECK(hipFree(d)); + HRR_HIP_CHECK(hipStreamDestroy(s)); delete[] h; } @@ -1579,89 +1591,89 @@ TEST_CASE("Unit_HRR_HostAliases_Direct", "[.][hrr-direct]") { // alloc with regular device memory — on Windows the driver needs a clean slate. (void)hipDeviceSynchronize(); (void)hipGetLastError(); - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); constexpr int N = 256; constexpr size_t SZ = N * sizeof(int); // hipHostAlloc / hipFreeHost — legacy pinned alloc void* ha = nullptr; - HIP_CHECK(hipHostAlloc(&ha, SZ, hipHostMallocDefault)); + HRR_HIP_CHECK(hipHostAlloc(&ha, SZ, hipHostMallocDefault)); REQUIRE(ha != nullptr); // hipHostGetFlags unsigned int hflags = 0; - HIP_CHECK(hipHostGetFlags(&hflags, ha)); + HRR_HIP_CHECK(hipHostGetFlags(&hflags, ha)); // hipFreeHost — free the hipHostAlloc buffer - HIP_CHECK(hipFreeHost(ha)); + HRR_HIP_CHECK(hipFreeHost(ha)); // hipMallocHost — another legacy alias for hipHostMalloc void* mh = nullptr; - HIP_CHECK(hipMallocHost(&mh, SZ)); + HRR_HIP_CHECK(hipMallocHost(&mh, SZ)); REQUIRE(mh != nullptr); - HIP_CHECK(hipFreeHost(mh)); + HRR_HIP_CHECK(hipFreeHost(mh)); // hipMemAllocHost — driver-style pinned alloc void* dah = nullptr; - HIP_CHECK(hipMemAllocHost(&dah, SZ)); + HRR_HIP_CHECK(hipMemAllocHost(&dah, SZ)); REQUIRE(dah != nullptr); - HIP_CHECK(hipFreeHost(dah)); + HRR_HIP_CHECK(hipFreeHost(dah)); // hipMallocArray / hipMalloc3DArray — texture arrays // Check image support once; skip both array tests if not available. hipChannelFormatDesc desc = hipCreateChannelDesc(32, 0, 0, 0, hipChannelFormatKindFloat); { int supportsImages = 0; - HIP_CHECK(hipDeviceGetAttribute(&supportsImages, + HRR_HIP_CHECK(hipDeviceGetAttribute(&supportsImages, hipDeviceAttributeImageSupport, 0)); if (supportsImages) { hipArray_t arr1d = nullptr; - HIP_CHECK(hipMallocArray(&arr1d, &desc, N, 1, hipArrayDefault)); + HRR_HIP_CHECK(hipMallocArray(&arr1d, &desc, N, 1, hipArrayDefault)); REQUIRE(arr1d != nullptr); - HIP_CHECK(hipFreeArray(arr1d)); + HRR_HIP_CHECK(hipFreeArray(arr1d)); hipArray_t arr3d = nullptr; hipExtent ext3d = make_hipExtent(16, 16, 4); - HIP_CHECK(hipMalloc3DArray(&arr3d, &desc, ext3d, hipArrayDefault)); + HRR_HIP_CHECK(hipMalloc3DArray(&arr3d, &desc, ext3d, hipArrayDefault)); REQUIRE(arr3d != nullptr); - HIP_CHECK(hipFreeArray(arr3d)); + HRR_HIP_CHECK(hipFreeArray(arr3d)); } } // hipMalloc3D — pitched 3D allocation hipPitchedPtr pp{}; hipExtent ext = make_hipExtent(32 * sizeof(int), 8, 4); - HIP_CHECK(hipMalloc3D(&pp, ext)); + HRR_HIP_CHECK(hipMalloc3D(&pp, ext)); REQUIRE(pp.ptr != nullptr); // hipPointerGetAttribute (singular) — query on 3D alloc hipMemoryType mtype = hipMemoryTypeUnified; - HIP_CHECK(hipPointerGetAttribute(&mtype, HIP_POINTER_ATTRIBUTE_MEMORY_TYPE, pp.ptr)); + HRR_HIP_CHECK(hipPointerGetAttribute(&mtype, HIP_POINTER_ATTRIBUTE_MEMORY_TYPE, pp.ptr)); - HIP_CHECK(hipFree(pp.ptr)); + HRR_HIP_CHECK(hipFree(pp.ptr)); // hipMemAllocPitch — driver-style pitched alloc hipDeviceptr_t dptr = 0; size_t rowPitch = 0; - HIP_CHECK(hipMemAllocPitch(&dptr, &rowPitch, N * sizeof(int), 4, sizeof(int))); + HRR_HIP_CHECK(hipMemAllocPitch(&dptr, &rowPitch, N * sizeof(int), 4, sizeof(int))); REQUIRE(dptr != 0); - HIP_CHECK(hipFree(reinterpret_cast(dptr))); + HRR_HIP_CHECK(hipFree(reinterpret_cast(dptr))); // D2H blob (value = 8) // Drain any pending GPU errors from earlier tests before D2H. (void)hipDeviceSynchronize(); (void)hipGetLastError(); int* d = nullptr; int* h = new int[N](); - HIP_CHECK(hipMalloc(&d, SZ)); + HRR_HIP_CHECK(hipMalloc(&d, SZ)); hipStream_t s; - HIP_CHECK(hipStreamCreate(&s)); + HRR_HIP_CHECK(hipStreamCreate(&s)); // Use hipMemset + synchronous hipMemcpy to avoid GPU TDR after hipMalloc3D // on Windows ROCm driver (async D2H after array/3D alloc triggers error 719). - HIP_CHECK(hipMemset(d, 0, SZ)); - HIP_CHECK(hipMemcpy(h, d, SZ, hipMemcpyDeviceToHost)); + HRR_HIP_CHECK(hipMemset(d, 0, SZ)); + HRR_HIP_CHECK(hipMemcpy(h, d, SZ, hipMemcpyDeviceToHost)); for (int i = 0; i < N; ++i) REQUIRE(h[i] == 0); - HIP_CHECK(hipFree(d)); - HIP_CHECK(hipStreamDestroy(s)); + HRR_HIP_CHECK(hipFree(d)); + HRR_HIP_CHECK(hipStreamDestroy(s)); delete[] h; } @@ -1673,7 +1685,7 @@ TEST_CASE("Unit_HRR_HostAliases_Direct", "[.][hrr-direct]") { // Final blob: h[i] == 6. // =========================================================================== TEST_CASE("Unit_HRR_MemPoolExtended_Direct", "[.][hrr-direct]") { - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); constexpr int N = 256; constexpr size_t SZ = N * sizeof(int); @@ -1683,22 +1695,22 @@ TEST_CASE("Unit_HRR_MemPoolExtended_Direct", "[.][hrr-direct]") { props.location.type = hipMemLocationTypeDevice; props.location.id = 0; hipMemPool_t pool = nullptr; - HIP_CHECK(hipMemPoolCreate(&pool, &props)); + HRR_HIP_CHECK(hipMemPoolCreate(&pool, &props)); // hipMemPoolGetAccess — query access for device 0 hipMemAccessFlags accessFlags{}; hipMemLocation loc{hipMemLocationTypeDevice, 0}; - HIP_CHECK(hipMemPoolGetAccess(&accessFlags, pool, &loc)); + HRR_HIP_CHECK(hipMemPoolGetAccess(&accessFlags, pool, &loc)); // hipMemPoolTrimTo — release unused pool memory (minBytesToKeep=0) - HIP_CHECK(hipMemPoolTrimTo(pool, 0)); + HRR_HIP_CHECK(hipMemPoolTrimTo(pool, 0)); // Alloc from pool, then export and import the pointer hipStream_t s; - HIP_CHECK(hipStreamCreate(&s)); + HRR_HIP_CHECK(hipStreamCreate(&s)); int* d = nullptr; - HIP_CHECK(hipMallocFromPoolAsync(reinterpret_cast(&d), SZ, pool, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMallocFromPoolAsync(reinterpret_cast(&d), SZ, pool, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); // hipMemPoolExportPointer / hipMemPoolImportPointer roundtrip. // These APIs are not supported on all Linux ROCm builds — skip gracefully. @@ -1706,7 +1718,7 @@ TEST_CASE("Unit_HRR_MemPoolExtended_Direct", "[.][hrr-direct]") { hipError_t export_err = hipMemPoolExportPointer(&exportData, d); if (export_err == hipSuccess) { void* imported = nullptr; - HIP_CHECK(hipMemPoolImportPointer(&imported, pool, &exportData)); + HRR_HIP_CHECK(hipMemPoolImportPointer(&imported, pool, &exportData)); REQUIRE(imported != nullptr); } else { WARN("hipMemPoolExportPointer returned " << (int)export_err @@ -1715,16 +1727,16 @@ TEST_CASE("Unit_HRR_MemPoolExtended_Direct", "[.][hrr-direct]") { // D2H blob (value = 6) int* h = new int[N](); - HIP_CHECK(hipMemsetD32(reinterpret_cast(d), 6, N)); - HIP_CHECK(hipDeviceSynchronize()); - HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemsetD32(reinterpret_cast(d), 6, N)); + HRR_HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); for (int i = 0; i < N; ++i) REQUIRE(h[i] == 6); - HIP_CHECK(hipFreeAsync(d, s)); - HIP_CHECK(hipStreamSynchronize(s)); - HIP_CHECK(hipStreamDestroy(s)); - HIP_CHECK(hipMemPoolDestroy(pool)); + HRR_HIP_CHECK(hipFreeAsync(d, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipStreamDestroy(s)); + HRR_HIP_CHECK(hipMemPoolDestroy(pool)); delete[] h; } @@ -1747,16 +1759,16 @@ TEST_CASE("Unit_HRR_MemPoolExtended_Direct", "[.][hrr-direct]") { // Final blob: h[i] == 11. // =========================================================================== TEST_CASE("Unit_HRR_DeviceMemPool_Direct", "[.][hrr-direct]") { - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); constexpr int N = 256; constexpr size_t SZ = N * sizeof(int); // Baseline: the default pool is the current pool of a fresh context. hipMemPool_t defPool = nullptr; - HIP_CHECK(hipDeviceGetDefaultMemPool(&defPool, 0)); + HRR_HIP_CHECK(hipDeviceGetDefaultMemPool(&defPool, 0)); REQUIRE(defPool != nullptr); hipMemPool_t curPool = nullptr; - HIP_CHECK(hipDeviceGetMemPool(&curPool, 0)); + HRR_HIP_CHECK(hipDeviceGetMemPool(&curPool, 0)); REQUIRE(curPool == defPool); // Create a user pool and make it device 0's current pool (API under test). @@ -1765,36 +1777,36 @@ TEST_CASE("Unit_HRR_DeviceMemPool_Direct", "[.][hrr-direct]") { props.location.type = hipMemLocationTypeDevice; props.location.id = 0; hipMemPool_t myPool = nullptr; - HIP_CHECK(hipMemPoolCreate(&myPool, &props)); + HRR_HIP_CHECK(hipMemPoolCreate(&myPool, &props)); - HIP_CHECK(hipDeviceSetMemPool(0, myPool)); + HRR_HIP_CHECK(hipDeviceSetMemPool(0, myPool)); // Confirm the association took effect. - HIP_CHECK(hipDeviceGetMemPool(&curPool, 0)); + HRR_HIP_CHECK(hipDeviceGetMemPool(&curPool, 0)); REQUIRE(curPool == myPool); // Pool-less async alloc draws from the device's current pool (== myPool), // exercising the device-pool association end to end. hipStream_t s; - HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); + HRR_HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); int* d = nullptr; - HIP_CHECK(hipMallocAsync(reinterpret_cast(&d), SZ, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMallocAsync(reinterpret_cast(&d), SZ, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); // D2H blob (value = 11) for playback validation. int* h = new int[N](); - HIP_CHECK(hipMemsetD32(reinterpret_cast(d), 11, N)); - HIP_CHECK(hipDeviceSynchronize()); - HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemsetD32(reinterpret_cast(d), 11, N)); + HRR_HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); for (int i = 0; i < N; ++i) REQUIRE(h[i] == 11); // Free the allocation, then destroy the (still-current) user pool: HIP resets // device 0 to its default pool automatically, so no unsafe restore is replayed. - HIP_CHECK(hipFreeAsync(d, s)); - HIP_CHECK(hipStreamSynchronize(s)); - HIP_CHECK(hipMemPoolDestroy(myPool)); - HIP_CHECK(hipStreamDestroy(s)); + HRR_HIP_CHECK(hipFreeAsync(d, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemPoolDestroy(myPool)); + HRR_HIP_CHECK(hipStreamDestroy(s)); delete[] h; } @@ -1808,25 +1820,25 @@ TEST_CASE("Unit_HRR_DeviceMemPool_Direct", "[.][hrr-direct]") { // Final blob: h[i] == 22. // =========================================================================== TEST_CASE("Unit_HRR_ExtMalloc_Direct", "[.][hrr-direct]") { - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); constexpr int N = 256; constexpr size_t SZ = N * sizeof(int); hipStream_t s; - HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); + HRR_HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); int* d = nullptr; - HIP_CHECK(hipExtMallocWithFlags(reinterpret_cast(&d), SZ, + HRR_HIP_CHECK(hipExtMallocWithFlags(reinterpret_cast(&d), SZ, hipDeviceMallocDefault)); int* h = new int[N](); - HIP_CHECK(hipMemsetD32(reinterpret_cast(d), 22, N)); - HIP_CHECK(hipDeviceSynchronize()); - HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemsetD32(reinterpret_cast(d), 22, N)); + HRR_HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); for (int i = 0; i < N; ++i) REQUIRE(h[i] == 22); - HIP_CHECK(hipFree(d)); - HIP_CHECK(hipStreamDestroy(s)); + HRR_HIP_CHECK(hipFree(d)); + HRR_HIP_CHECK(hipStreamDestroy(s)); delete[] h; } @@ -1841,33 +1853,33 @@ TEST_CASE("Unit_HRR_ExtMalloc_Direct", "[.][hrr-direct]") { // Final blob: h[i] == 33. // =========================================================================== TEST_CASE("Unit_HRR_StreamWaitEventSpt_Direct", "[.][hrr-direct]") { - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); constexpr int N = 256; constexpr size_t SZ = N * sizeof(int); hipStream_t s0, s1; - HIP_CHECK(hipStreamCreateWithFlags(&s0, hipStreamNonBlocking)); - HIP_CHECK(hipStreamCreateWithFlags(&s1, hipStreamNonBlocking)); + HRR_HIP_CHECK(hipStreamCreateWithFlags(&s0, hipStreamNonBlocking)); + HRR_HIP_CHECK(hipStreamCreateWithFlags(&s1, hipStreamNonBlocking)); hipEvent_t ev; - HIP_CHECK(hipEventCreate(&ev)); + HRR_HIP_CHECK(hipEventCreate(&ev)); int *d0, *d1; - HIP_CHECK(hipMalloc(&d0, SZ)); - HIP_CHECK(hipMalloc(&d1, SZ)); + HRR_HIP_CHECK(hipMalloc(&d0, SZ)); + HRR_HIP_CHECK(hipMalloc(&d1, SZ)); - HIP_CHECK(hipMemsetD32Async(reinterpret_cast(d0), 33, N, s0)); - HIP_CHECK(hipEventRecord(ev, s0)); - HIP_CHECK(hipStreamWaitEvent_spt(s1, ev, 0)); - HIP_CHECK(hipMemcpyAsync(d1, d0, SZ, hipMemcpyDeviceToDevice, s1)); + HRR_HIP_CHECK(hipMemsetD32Async(reinterpret_cast(d0), 33, N, s0)); + HRR_HIP_CHECK(hipEventRecord(ev, s0)); + HRR_HIP_CHECK(hipStreamWaitEvent_spt(s1, ev, 0)); + HRR_HIP_CHECK(hipMemcpyAsync(d1, d0, SZ, hipMemcpyDeviceToDevice, s1)); int* h = new int[N](); - HIP_CHECK(hipMemcpyAsync(h, d1, SZ, hipMemcpyDeviceToHost, s1)); - HIP_CHECK(hipStreamSynchronize(s1)); + HRR_HIP_CHECK(hipMemcpyAsync(h, d1, SZ, hipMemcpyDeviceToHost, s1)); + HRR_HIP_CHECK(hipStreamSynchronize(s1)); for (int i = 0; i < N; ++i) REQUIRE(h[i] == 33); - HIP_CHECK(hipFree(d0)); HIP_CHECK(hipFree(d1)); - HIP_CHECK(hipEventDestroy(ev)); - HIP_CHECK(hipStreamDestroy(s0)); HIP_CHECK(hipStreamDestroy(s1)); + HRR_HIP_CHECK(hipFree(d0)); HRR_HIP_CHECK(hipFree(d1)); + HRR_HIP_CHECK(hipEventDestroy(ev)); + HRR_HIP_CHECK(hipStreamDestroy(s0)); HRR_HIP_CHECK(hipStreamDestroy(s1)); delete[] h; } @@ -1882,34 +1894,34 @@ TEST_CASE("Unit_HRR_StreamWaitEventSpt_Direct", "[.][hrr-direct]") { // Final blob: h[i] == 77. // =========================================================================== TEST_CASE("Unit_HRR_GraphLaunchSpt_Direct", "[.][hrr-direct]") { - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); constexpr int N = 256; constexpr size_t SZ = N * sizeof(int); hipStream_t s; - HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); + HRR_HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); int* d = nullptr; - HIP_CHECK(hipMalloc(&d, SZ)); + HRR_HIP_CHECK(hipMalloc(&d, SZ)); - HIP_CHECK(hipStreamBeginCapture(s, hipStreamCaptureModeThreadLocal)); - HIP_CHECK(hipMemsetD32Async(reinterpret_cast(d), 77, N, s)); + HRR_HIP_CHECK(hipStreamBeginCapture(s, hipStreamCaptureModeThreadLocal)); + HRR_HIP_CHECK(hipMemsetD32Async(reinterpret_cast(d), 77, N, s)); hipGraph_t g; - HIP_CHECK(hipStreamEndCapture(s, &g)); + HRR_HIP_CHECK(hipStreamEndCapture(s, &g)); hipGraphExec_t exec; - HIP_CHECK(hipGraphInstantiate(&exec, g, nullptr, nullptr, 0)); + HRR_HIP_CHECK(hipGraphInstantiate(&exec, g, nullptr, nullptr, 0)); - HIP_CHECK(hipGraphLaunch_spt(exec, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipGraphLaunch_spt(exec, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); int* h = new int[N](); - HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); for (int i = 0; i < N; ++i) REQUIRE(h[i] == 77); - HIP_CHECK(hipGraphExecDestroy(exec)); - HIP_CHECK(hipGraphDestroy(g)); - HIP_CHECK(hipFree(d)); - HIP_CHECK(hipStreamDestroy(s)); + HRR_HIP_CHECK(hipGraphExecDestroy(exec)); + HRR_HIP_CHECK(hipGraphDestroy(g)); + HRR_HIP_CHECK(hipFree(d)); + HRR_HIP_CHECK(hipStreamDestroy(s)); delete[] h; } @@ -1928,14 +1940,14 @@ TEST_CASE("Unit_HRR_GraphLaunchSpt_Direct", "[.][hrr-direct]") { // Final blob: h[i] == 55. // =========================================================================== TEST_CASE("Unit_HRR_ExtModuleLaunchKernel_Direct", "[.][hrr-direct]") { - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); constexpr int LN = 256; constexpr size_t LSZ = LN * sizeof(int); int* d = nullptr; - HIP_CHECK(hipMalloc(&d, LSZ)); + HRR_HIP_CHECK(hipMalloc(&d, LSZ)); hipStream_t s; - HIP_CHECK(hipStreamCreate(&s)); + HRR_HIP_CHECK(hipStreamCreate(&s)); // Runtime-compiled kernel (captured via hipModuleLoadData, not static init). static const char* ext_fill_src = R"( @@ -1945,7 +1957,7 @@ extern "C" __global__ void ext_fill(int* out, int val, int n) { } )"; hiprtcProgram prog = nullptr; - HIPRTC_CHECK(hiprtcCreateProgram(&prog, ext_fill_src, "ext_fill.hip", + HRR_HIPRTC_CHECK(hiprtcCreateProgram(&prog, ext_fill_src, "ext_fill.hip", 0, nullptr, nullptr)); hiprtcResult crc = hiprtcCompileProgram(prog, 0, nullptr); if (crc != HIPRTC_SUCCESS) { @@ -1957,37 +1969,37 @@ extern "C" __global__ void ext_fill(int* out, int val, int n) { FAIL("hiprtcCompileProgram failed: " + log); } size_t co_size = 0; - HIPRTC_CHECK(hiprtcGetCodeSize(prog, &co_size)); + HRR_HIPRTC_CHECK(hiprtcGetCodeSize(prog, &co_size)); std::vector co(co_size); - HIPRTC_CHECK(hiprtcGetCode(prog, co.data())); - HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); + HRR_HIPRTC_CHECK(hiprtcGetCode(prog, co.data())); + HRR_HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); hipModule_t mod = nullptr; - HIP_CHECK(hipModuleLoadData(&mod, co.data())); + HRR_HIP_CHECK(hipModuleLoadData(&mod, co.data())); hipFunction_t fn = nullptr; - HIP_CHECK(hipModuleGetFunction(&fn, mod, "ext_fill")); + HRR_HIP_CHECK(hipModuleGetFunction(&fn, mod, "ext_fill")); // API under test. kernelParams holds the address of each argument value; // args[0] = &d is the address of the int* device pointer. int val = 55; int n = LN; void* args[] = { &d, &val, &n }; - HIP_CHECK(hipExtModuleLaunchKernel(fn, + HRR_HIP_CHECK(hipExtModuleLaunchKernel(fn, /*globalWorkSize*/ LN, 1, 1, /*localWorkSize */ 256, 1, 1, /*sharedMemBytes*/ 0, s, args, /*extra*/ nullptr, /*startEvent*/ nullptr, /*stopEvent*/ nullptr, /*flags*/ 0)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); - HIP_CHECK(hipModuleUnload(mod)); + HRR_HIP_CHECK(hipModuleUnload(mod)); int* h = new int[LN](); - HIP_CHECK(hipMemcpyAsync(h, d, LSZ, hipMemcpyDeviceToHost, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemcpyAsync(h, d, LSZ, hipMemcpyDeviceToHost, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); for (int i = 0; i < LN; ++i) REQUIRE(h[i] == 55); - HIP_CHECK(hipFree(d)); - HIP_CHECK(hipStreamDestroy(s)); + HRR_HIP_CHECK(hipFree(d)); + HRR_HIP_CHECK(hipStreamDestroy(s)); delete[] h; } @@ -2005,33 +2017,33 @@ extern "C" __global__ void ext_fill(int* out, int val, int n) { // Final blob: h[i] == 44. // =========================================================================== TEST_CASE("Unit_HRR_HostFree_Direct", "[.][hrr-direct]") { - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); constexpr int N = 256; constexpr size_t SZ = N * sizeof(int); hipStream_t s; - HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); + HRR_HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); int* h_pinned = nullptr; - HIP_CHECK(hipHostMalloc(reinterpret_cast(&h_pinned), SZ, + HRR_HIP_CHECK(hipHostMalloc(reinterpret_cast(&h_pinned), SZ, hipHostMallocDefault)); for (int i = 0; i < N; ++i) h_pinned[i] = 44; int* d = nullptr; - HIP_CHECK(hipMalloc(&d, SZ)); - HIP_CHECK(hipMemcpyAsync(d, h_pinned, SZ, hipMemcpyHostToDevice, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMalloc(&d, SZ)); + HRR_HIP_CHECK(hipMemcpyAsync(d, h_pinned, SZ, hipMemcpyHostToDevice, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); // API under test: release the pinned allocation via hipHostFree (not hipFree). - HIP_CHECK(hipHostFree(h_pinned)); + HRR_HIP_CHECK(hipHostFree(h_pinned)); int* h = new int[N](); - HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); for (int i = 0; i < N; ++i) REQUIRE(h[i] == 44); - HIP_CHECK(hipFree(d)); - HIP_CHECK(hipStreamDestroy(s)); + HRR_HIP_CHECK(hipFree(d)); + HRR_HIP_CHECK(hipStreamDestroy(s)); delete[] h; } @@ -2047,30 +2059,30 @@ TEST_CASE("Unit_HRR_HostFree_Direct", "[.][hrr-direct]") { // Final blob: h[i] == 66. // =========================================================================== TEST_CASE("Unit_HRR_Logging_Direct", "[.][hrr-direct]") { - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); constexpr int N = 256; constexpr size_t SZ = N * sizeof(int); // APIs under test (log_level 0 => enabling logging stays quiet). - HIP_CHECK(hipExtSetLoggingParams(/*log_level*/ 0, /*log_size*/ 0, + HRR_HIP_CHECK(hipExtSetLoggingParams(/*log_level*/ 0, /*log_size*/ 0, /*log_mask*/ 0)); - HIP_CHECK(hipExtEnableLogging()); - HIP_CHECK(hipExtDisableLogging()); + HRR_HIP_CHECK(hipExtEnableLogging()); + HRR_HIP_CHECK(hipExtDisableLogging()); hipStream_t s; - HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); + HRR_HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); int* d = nullptr; - HIP_CHECK(hipMalloc(&d, SZ)); - HIP_CHECK(hipMemsetD32(reinterpret_cast(d), 66, N)); - HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipMalloc(&d, SZ)); + HRR_HIP_CHECK(hipMemsetD32(reinterpret_cast(d), 66, N)); + HRR_HIP_CHECK(hipDeviceSynchronize()); int* h = new int[N](); - HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); for (int i = 0; i < N; ++i) REQUIRE(h[i] == 66); - HIP_CHECK(hipFree(d)); - HIP_CHECK(hipStreamDestroy(s)); + HRR_HIP_CHECK(hipFree(d)); + HRR_HIP_CHECK(hipStreamDestroy(s)); delete[] h; } @@ -2087,46 +2099,46 @@ TEST_CASE("Unit_HRR_Logging_Direct", "[.][hrr-direct]") { // Final blob: h[i] == 0x5A5A5A5A. // =========================================================================== TEST_CASE("Unit_HRR_StreamCaptureQuerySpt_Direct", "[.][hrr-direct]") { - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); constexpr int N = 256; constexpr size_t SZ = N * sizeof(int); constexpr int VAL = 0x5A5A5A5A; hipStream_t s; - HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); + HRR_HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); int* d = nullptr; - HIP_CHECK(hipMalloc(&d, SZ)); + HRR_HIP_CHECK(hipMalloc(&d, SZ)); - HIP_CHECK(hipStreamBeginCapture(s, hipStreamCaptureModeThreadLocal)); + HRR_HIP_CHECK(hipStreamBeginCapture(s, hipStreamCaptureModeThreadLocal)); // APIs under test: query capture state via the _spt variants. hipStreamCaptureStatus st = hipStreamCaptureStatusNone; - HIP_CHECK(hipStreamIsCapturing_spt(s, &st)); + HRR_HIP_CHECK(hipStreamIsCapturing_spt(s, &st)); REQUIRE(st == hipStreamCaptureStatusActive); hipStreamCaptureStatus st2 = hipStreamCaptureStatusNone; unsigned long long capId = 0; - HIP_CHECK(hipStreamGetCaptureInfo_spt(s, &st2, &capId)); + HRR_HIP_CHECK(hipStreamGetCaptureInfo_spt(s, &st2, &capId)); REQUIRE(st2 == hipStreamCaptureStatusActive); - HIP_CHECK(hipMemsetD32Async(reinterpret_cast(d), VAL, N, s)); + HRR_HIP_CHECK(hipMemsetD32Async(reinterpret_cast(d), VAL, N, s)); hipGraph_t g = nullptr; - HIP_CHECK(hipStreamEndCapture(s, &g)); + HRR_HIP_CHECK(hipStreamEndCapture(s, &g)); hipGraphExec_t exec = nullptr; - HIP_CHECK(hipGraphInstantiate(&exec, g, nullptr, nullptr, 0)); - HIP_CHECK(hipGraphLaunch(exec, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipGraphInstantiate(&exec, g, nullptr, nullptr, 0)); + HRR_HIP_CHECK(hipGraphLaunch(exec, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); int* h = new int[N](); - HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); for (int i = 0; i < N; ++i) REQUIRE(h[i] == VAL); - HIP_CHECK(hipGraphExecDestroy(exec)); - HIP_CHECK(hipGraphDestroy(g)); - HIP_CHECK(hipFree(d)); - HIP_CHECK(hipStreamDestroy(s)); + HRR_HIP_CHECK(hipGraphExecDestroy(exec)); + HRR_HIP_CHECK(hipGraphDestroy(g)); + HRR_HIP_CHECK(hipFree(d)); + HRR_HIP_CHECK(hipStreamDestroy(s)); delete[] h; } @@ -2144,35 +2156,35 @@ TEST_CASE("Unit_HRR_StreamCaptureQuerySpt_Direct", "[.][hrr-direct]") { // Final blob: h[i] == 0x33333333. // =========================================================================== TEST_CASE("Unit_HRR_StreamCaptureBeginSpt_Direct", "[.][hrr-direct]") { - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); constexpr int N = 256; constexpr size_t SZ = N * sizeof(int); constexpr int VAL = 0x33333333; hipStream_t s; - HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); + HRR_HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); int* d = nullptr; - HIP_CHECK(hipMalloc(&d, SZ)); + HRR_HIP_CHECK(hipMalloc(&d, SZ)); // API under test: start capture via the _spt variant. - HIP_CHECK(hipStreamBeginCapture_spt(s, hipStreamCaptureModeThreadLocal)); - HIP_CHECK(hipMemsetD32Async(reinterpret_cast(d), VAL, N, s)); + HRR_HIP_CHECK(hipStreamBeginCapture_spt(s, hipStreamCaptureModeThreadLocal)); + HRR_HIP_CHECK(hipMemsetD32Async(reinterpret_cast(d), VAL, N, s)); hipGraph_t g = nullptr; - HIP_CHECK(hipStreamEndCapture(s, &g)); + HRR_HIP_CHECK(hipStreamEndCapture(s, &g)); hipGraphExec_t exec = nullptr; - HIP_CHECK(hipGraphInstantiate(&exec, g, nullptr, nullptr, 0)); - HIP_CHECK(hipGraphLaunch(exec, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipGraphInstantiate(&exec, g, nullptr, nullptr, 0)); + HRR_HIP_CHECK(hipGraphLaunch(exec, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); int* h = new int[N](); - HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); for (int i = 0; i < N; ++i) REQUIRE(h[i] == VAL); - HIP_CHECK(hipGraphExecDestroy(exec)); - HIP_CHECK(hipGraphDestroy(g)); - HIP_CHECK(hipFree(d)); - HIP_CHECK(hipStreamDestroy(s)); + HRR_HIP_CHECK(hipGraphExecDestroy(exec)); + HRR_HIP_CHECK(hipGraphDestroy(g)); + HRR_HIP_CHECK(hipFree(d)); + HRR_HIP_CHECK(hipStreamDestroy(s)); delete[] h; } // =========================================================================== @@ -2192,28 +2204,28 @@ TEST_CASE("Unit_HRR_StreamCaptureBeginSpt_Direct", "[.][hrr-direct]") { // Final blob: h[i] == 88. // =========================================================================== TEST_CASE("Unit_HRR_ConfigureCall_Direct", "[.][hrr-direct]") { - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); constexpr int N = 256; constexpr size_t SZ = N * sizeof(int); hipStream_t s; - HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); + HRR_HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); // API under test: push a launch configuration onto the execution stack. dim3 grid((N + 255) / 256), block(256); - HIP_CHECK(hipConfigureCall(grid, block, /*sharedMem*/ 0, s)); + HRR_HIP_CHECK(hipConfigureCall(grid, block, /*sharedMem*/ 0, s)); int* d = nullptr; - HIP_CHECK(hipMalloc(&d, SZ)); - HIP_CHECK(hipMemsetD32Async(reinterpret_cast(d), 88, N, s)); + HRR_HIP_CHECK(hipMalloc(&d, SZ)); + HRR_HIP_CHECK(hipMemsetD32Async(reinterpret_cast(d), 88, N, s)); int* h = new int[N](); - HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); for (int i = 0; i < N; ++i) REQUIRE(h[i] == 88); - HIP_CHECK(hipFree(d)); - HIP_CHECK(hipStreamDestroy(s)); + HRR_HIP_CHECK(hipFree(d)); + HRR_HIP_CHECK(hipStreamDestroy(s)); delete[] h; } @@ -2233,41 +2245,41 @@ TEST_CASE("Unit_HRR_MemcpyPeer_Direct", "[.][hrr-direct]") { int ndev = 0; if (!hrr_find_peer_accessible_pair(src_dev, dst_dev, ndev)) { if (ndev < 2) { - HIP_SKIP_TEST(HipTest::SkipReason::kFewerThanTwoGpus); + HRR_SKIP("fewer than two GPUs"); } else { - HIP_SKIP_TEST(HipTest::SkipReason::kPeerAccessUnavailable); + HRR_SKIP("peer access unavailable"); } } constexpr int N = 256; constexpr size_t SZ = N * sizeof(int); constexpr int VAL = 0x7E7E7E7E; - HIP_CHECK(hipSetDevice(src_dev)); - HIP_CHECK(hipDeviceEnablePeerAccess(dst_dev, 0)); + HRR_HIP_CHECK(hipSetDevice(src_dev)); + HRR_HIP_CHECK(hipDeviceEnablePeerAccess(dst_dev, 0)); int* d0 = nullptr; - HIP_CHECK(hipMalloc(&d0, SZ)); - HIP_CHECK(hipMemsetD32(reinterpret_cast(d0), VAL, N)); - HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipMalloc(&d0, SZ)); + HRR_HIP_CHECK(hipMemsetD32(reinterpret_cast(d0), VAL, N)); + HRR_HIP_CHECK(hipDeviceSynchronize()); - HIP_CHECK(hipSetDevice(dst_dev)); + HRR_HIP_CHECK(hipSetDevice(dst_dev)); int* d1 = nullptr; - HIP_CHECK(hipMalloc(&d1, SZ)); + HRR_HIP_CHECK(hipMalloc(&d1, SZ)); // API under test: cross-device peer copy src_dev -> dst_dev. // Issue the copy under the src-device context (matches // catch/unit/memory/hipMemcpyPeer.cc). - HIP_CHECK(hipSetDevice(src_dev)); - HIP_CHECK(hipMemcpyPeer(d1, dst_dev, d0, src_dev, SZ)); - HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipSetDevice(src_dev)); + HRR_HIP_CHECK(hipMemcpyPeer(d1, dst_dev, d0, src_dev, SZ)); + HRR_HIP_CHECK(hipDeviceSynchronize()); int* h = new int[N](); - HIP_CHECK(hipMemcpy(h, d1, SZ, hipMemcpyDeviceToHost)); + HRR_HIP_CHECK(hipMemcpy(h, d1, SZ, hipMemcpyDeviceToHost)); for (int i = 0; i < N; ++i) REQUIRE(h[i] == VAL); - HIP_CHECK(hipFree(d1)); - HIP_CHECK(hipSetDevice(src_dev)); - HIP_CHECK(hipFree(d0)); - HIP_CHECK(hipDeviceDisablePeerAccess(dst_dev)); + HRR_HIP_CHECK(hipFree(d1)); + HRR_HIP_CHECK(hipSetDevice(src_dev)); + HRR_HIP_CHECK(hipFree(d0)); + HRR_HIP_CHECK(hipDeviceDisablePeerAccess(dst_dev)); delete[] h; } @@ -2279,48 +2291,48 @@ TEST_CASE("Unit_HRR_MemcpyPeer_Direct", "[.][hrr-direct]") { // Final blob: d[i] == 9. // =========================================================================== TEST_CASE("Unit_HRR_MemsetExtra_Direct", "[.][hrr-direct]") { - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); constexpr int N = 256; constexpr size_t SZ = N * sizeof(int); hipStream_t s; - HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); + HRR_HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); // hipMemset3D + hipMemset3DAsync on a pitched 3D alloc { hipPitchedPtr pp{}; hipExtent ext = make_hipExtent(16 * sizeof(int), 4, 2); - HIP_CHECK(hipMalloc3D(&pp, ext)); + HRR_HIP_CHECK(hipMalloc3D(&pp, ext)); hipExtent ext3 = make_hipExtent(16 * sizeof(int), 4, 2); - HIP_CHECK(hipMemset3D(pp, 0xAB, ext3)); - HIP_CHECK(hipMemset3DAsync(pp, 0x00, ext3, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemset3D(pp, 0xAB, ext3)); + HRR_HIP_CHECK(hipMemset3DAsync(pp, 0x00, ext3, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); - HIP_CHECK(hipFree(pp.ptr)); + HRR_HIP_CHECK(hipFree(pp.ptr)); } // hipMemsetD2D8 + hipMemsetD2D8Async { void* d2d = nullptr; size_t pitch2d = 0; - HIP_CHECK(hipMallocPitch(&d2d, &pitch2d, 16, 4)); + HRR_HIP_CHECK(hipMallocPitch(&d2d, &pitch2d, 16, 4)); - HIP_CHECK(hipMemsetD2D8(reinterpret_cast(d2d), pitch2d, 0x77, 16, 4)); - HIP_CHECK(hipMemsetD2D8Async(reinterpret_cast(d2d), pitch2d, 0x00, 16, 4, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemsetD2D8(reinterpret_cast(d2d), pitch2d, 0x77, 16, 4)); + HRR_HIP_CHECK(hipMemsetD2D8Async(reinterpret_cast(d2d), pitch2d, 0x00, 16, 4, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); // hipMemsetD2D16 - HIP_CHECK(hipMemsetD2D16(reinterpret_cast(d2d), pitch2d, 0x1234, 8, 4)); - HIP_CHECK(hipMemsetD2D16Async(reinterpret_cast(d2d), pitch2d, 0x0000, 8, 4, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemsetD2D16(reinterpret_cast(d2d), pitch2d, 0x1234, 8, 4)); + HRR_HIP_CHECK(hipMemsetD2D16Async(reinterpret_cast(d2d), pitch2d, 0x0000, 8, 4, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); // hipMemsetD2D32 - HIP_CHECK(hipMemsetD2D32(reinterpret_cast(d2d), pitch2d, 0xDEAD, 4, 4)); - HIP_CHECK(hipMemsetD2D32Async(reinterpret_cast(d2d), pitch2d, 0x0000, 4, 4, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemsetD2D32(reinterpret_cast(d2d), pitch2d, 0xDEAD, 4, 4)); + HRR_HIP_CHECK(hipMemsetD2D32Async(reinterpret_cast(d2d), pitch2d, 0x0000, 4, 4, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); - HIP_CHECK(hipFree(d2d)); + HRR_HIP_CHECK(hipFree(d2d)); } // hipMemsetMemPool — not in ROCm SDK 6.4, skip @@ -2330,38 +2342,38 @@ TEST_CASE("Unit_HRR_MemsetExtra_Direct", "[.][hrr-direct]") { // hipMemset2D_spt, hipMemset2DAsync_spt, hipMemset3D_spt, hipMemset3DAsync_spt { void* dp = nullptr; - HIP_CHECK(hipMalloc(&dp, SZ)); - HIP_CHECK(hipMemset_spt(dp, 0xAA, SZ)); - HIP_CHECK(hipMemsetAsync_spt(dp, 0x00, SZ, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMalloc(&dp, SZ)); + HRR_HIP_CHECK(hipMemset_spt(dp, 0xAA, SZ)); + HRR_HIP_CHECK(hipMemsetAsync_spt(dp, 0x00, SZ, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); size_t pitch_s = 0; void* dp2 = nullptr; - HIP_CHECK(hipMallocPitch(&dp2, &pitch_s, 32, 4)); - HIP_CHECK(hipMemset2D_spt(dp2, pitch_s, 0xBB, 32, 4)); - HIP_CHECK(hipMemset2DAsync_spt(dp2, pitch_s, 0x00, 32, 4, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMallocPitch(&dp2, &pitch_s, 32, 4)); + HRR_HIP_CHECK(hipMemset2D_spt(dp2, pitch_s, 0xBB, 32, 4)); + HRR_HIP_CHECK(hipMemset2DAsync_spt(dp2, pitch_s, 0x00, 32, 4, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); hipPitchedPtr pp3{}; hipExtent ext3 = make_hipExtent(16 * sizeof(int), 4, 2); - HIP_CHECK(hipMalloc3D(&pp3, ext3)); - HIP_CHECK(hipMemset3D_spt(pp3, 0xCC, ext3)); - HIP_CHECK(hipMemset3DAsync_spt(pp3, 0x00, ext3, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMalloc3D(&pp3, ext3)); + HRR_HIP_CHECK(hipMemset3D_spt(pp3, 0xCC, ext3)); + HRR_HIP_CHECK(hipMemset3DAsync_spt(pp3, 0x00, ext3, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); - HIP_CHECK(hipFree(dp)); HIP_CHECK(hipFree(dp2)); HIP_CHECK(hipFree(pp3.ptr)); + HRR_HIP_CHECK(hipFree(dp)); HRR_HIP_CHECK(hipFree(dp2)); HRR_HIP_CHECK(hipFree(pp3.ptr)); } // D2H blob (value = 9) int* d = nullptr; int* h = new int[N](); - HIP_CHECK(hipMalloc(&d, SZ)); - HIP_CHECK(hipMemsetD32(reinterpret_cast(d), 9, N)); - HIP_CHECK(hipDeviceSynchronize()); - HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMalloc(&d, SZ)); + HRR_HIP_CHECK(hipMemsetD32(reinterpret_cast(d), 9, N)); + HRR_HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); for (int i = 0; i < N; ++i) REQUIRE(h[i] == 9); - HIP_CHECK(hipFree(d)); - HIP_CHECK(hipStreamDestroy(s)); + HRR_HIP_CHECK(hipFree(d)); + HRR_HIP_CHECK(hipStreamDestroy(s)); delete[] h; } @@ -2380,42 +2392,42 @@ __device__ int g_hrr_symbol[256]; // Final blob: h[i] == 55. // =========================================================================== TEST_CASE("Unit_HRR_MemcpyExtra_Direct", "[.][hrr-direct]") { - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); constexpr int N = 64; constexpr size_t SZ = N * sizeof(int); hipStream_t s; - HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); + HRR_HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); // Allocate device + host buffers int* d = nullptr; - HIP_CHECK(hipMalloc(&d, SZ)); + HRR_HIP_CHECK(hipMalloc(&d, SZ)); int* h_src = new int[N]; for (int i = 0; i < N; ++i) h_src[i] = 55; // Load d with 55 via hipMemcpy (has blob → restored at playback before any _spt calls) - HIP_CHECK(hipMemcpy(d, h_src, SZ, hipMemcpyHostToDevice)); + HRR_HIP_CHECK(hipMemcpy(d, h_src, SZ, hipMemcpyHostToDevice)); // hipMemcpy_spt (per-thread-default-stream H2D+D2H) - HIP_CHECK(hipMemcpy_spt(d, h_src, SZ, hipMemcpyHostToDevice)); + HRR_HIP_CHECK(hipMemcpy_spt(d, h_src, SZ, hipMemcpyHostToDevice)); int* h_chk = new int[N](); - HIP_CHECK(hipMemcpy_spt(h_chk, d, SZ, hipMemcpyDeviceToHost)); + HRR_HIP_CHECK(hipMemcpy_spt(h_chk, d, SZ, hipMemcpyDeviceToHost)); for (int i = 0; i < N; ++i) REQUIRE(h_chk[i] == 55); // hipMemcpyAsync_spt - HIP_CHECK(hipMemcpyAsync_spt(d, h_src, SZ, hipMemcpyHostToDevice, s)); - HIP_CHECK(hipStreamSynchronize(s)); - HIP_CHECK(hipMemcpyAsync_spt(h_chk, d, SZ, hipMemcpyDeviceToHost, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemcpyAsync_spt(d, h_src, SZ, hipMemcpyHostToDevice, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemcpyAsync_spt(h_chk, d, SZ, hipMemcpyDeviceToHost, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); // hipMemcpy2D_spt (1-row, H2D then D2H) - HIP_CHECK(hipMemcpy2D_spt(d, SZ, h_src, SZ, SZ, 1, hipMemcpyHostToDevice)); - HIP_CHECK(hipMemcpy2D_spt(h_chk, SZ, d, SZ, SZ, 1, hipMemcpyDeviceToHost)); + HRR_HIP_CHECK(hipMemcpy2D_spt(d, SZ, h_src, SZ, SZ, 1, hipMemcpyHostToDevice)); + HRR_HIP_CHECK(hipMemcpy2D_spt(h_chk, SZ, d, SZ, SZ, 1, hipMemcpyDeviceToHost)); for (int i = 0; i < N; ++i) REQUIRE(h_chk[i] == 55); // hipMemcpy2DAsync_spt - HIP_CHECK(hipMemcpy2DAsync_spt(d, SZ, h_src, SZ, SZ, 1, hipMemcpyHostToDevice, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemcpy2DAsync_spt(d, SZ, h_src, SZ, SZ, 1, hipMemcpyHostToDevice, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); // hipMemcpyParam2D — uses HIP_MEMCPY2D descriptor { @@ -2428,7 +2440,7 @@ TEST_CASE("Unit_HRR_MemcpyExtra_Direct", "[.][hrr-direct]") { p.dstPitch = SZ; p.WidthInBytes = SZ; p.Height = 1; - HIP_CHECK(hipMemcpyParam2D(&p)); + HRR_HIP_CHECK(hipMemcpyParam2D(&p)); } // hipMemcpyParam2DAsync @@ -2442,45 +2454,45 @@ TEST_CASE("Unit_HRR_MemcpyExtra_Direct", "[.][hrr-direct]") { p.dstPitch = SZ; p.WidthInBytes = SZ; p.Height = 1; - HIP_CHECK(hipMemcpyParam2DAsync(&p, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemcpyParam2DAsync(&p, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); } // Array-based copies: hipMallocArray + hipMemcpyToArray/FromArray // Requires image support — skip on GPUs that don't support texture arrays. { int supportsImages = 0; - HIP_CHECK(hipDeviceGetAttribute(&supportsImages, hipDeviceAttributeImageSupport, 0)); + HRR_HIP_CHECK(hipDeviceGetAttribute(&supportsImages, hipDeviceAttributeImageSupport, 0)); if (supportsImages) { hipChannelFormatDesc desc = hipCreateChannelDesc(32, 0, 0, 0, hipChannelFormatKindFloat); hipArray_t arr = nullptr; - HIP_CHECK(hipMallocArray(&arr, &desc, N, 1, hipArrayDefault)); + HRR_HIP_CHECK(hipMallocArray(&arr, &desc, N, 1, hipArrayDefault)); // hipMemcpyToArray (H→Array) - HIP_CHECK(hipMemcpyToArray(arr, 0, 0, h_src, SZ, hipMemcpyHostToDevice)); + HRR_HIP_CHECK(hipMemcpyToArray(arr, 0, 0, h_src, SZ, hipMemcpyHostToDevice)); // hipMemcpyFromArray (Array→H) int h_arr[N] = {}; - HIP_CHECK(hipMemcpyFromArray(h_arr, arr, 0, 0, SZ, hipMemcpyDeviceToHost)); + HRR_HIP_CHECK(hipMemcpyFromArray(h_arr, arr, 0, 0, SZ, hipMemcpyDeviceToHost)); REQUIRE(h_arr[0] == 55); // hipMemcpy2DToArray (H→Array via 2D) - HIP_CHECK(hipMemcpy2DToArray(arr, 0, 0, h_src, SZ, SZ, 1, hipMemcpyHostToDevice)); + HRR_HIP_CHECK(hipMemcpy2DToArray(arr, 0, 0, h_src, SZ, SZ, 1, hipMemcpyHostToDevice)); // hipMemcpy2DFromArray (Array→H via 2D) int h_arr2[N] = {}; - HIP_CHECK(hipMemcpy2DFromArray(h_arr2, SZ, arr, 0, 0, SZ, 1, hipMemcpyDeviceToHost)); + HRR_HIP_CHECK(hipMemcpy2DFromArray(h_arr2, SZ, arr, 0, 0, SZ, 1, hipMemcpyDeviceToHost)); REQUIRE(h_arr2[0] == 55); // hipMemcpyAtoH (Array→host, driver-style) int h_ato[N] = {}; - HIP_CHECK(hipMemcpyAtoH(h_ato, arr, 0, SZ)); + HRR_HIP_CHECK(hipMemcpyAtoH(h_ato, arr, 0, SZ)); REQUIRE(h_ato[0] == 55); // hipMemcpyHtoA (host→Array, driver-style) - HIP_CHECK(hipMemcpyHtoA(arr, 0, h_src, SZ)); + HRR_HIP_CHECK(hipMemcpyHtoA(arr, 0, h_src, SZ)); - HIP_CHECK(hipFreeArray(arr)); + HRR_HIP_CHECK(hipFreeArray(arr)); } } @@ -2488,24 +2500,24 @@ TEST_CASE("Unit_HRR_MemcpyExtra_Direct", "[.][hrr-direct]") { { int h_sym[N]; for (int i = 0; i < N; ++i) h_sym[i] = 55; - HIP_CHECK(hipMemcpyToSymbol_spt(HIP_SYMBOL(g_hrr_symbol), h_sym, SZ, 0, + HRR_HIP_CHECK(hipMemcpyToSymbol_spt(HIP_SYMBOL(g_hrr_symbol), h_sym, SZ, 0, hipMemcpyHostToDevice)); - HIP_CHECK(hipMemcpyToSymbolAsync_spt(HIP_SYMBOL(g_hrr_symbol), h_sym, SZ, 0, + HRR_HIP_CHECK(hipMemcpyToSymbolAsync_spt(HIP_SYMBOL(g_hrr_symbol), h_sym, SZ, 0, hipMemcpyHostToDevice, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); } // Reload d with 55 via hipMemcpy (has blob → playback restores correctly) - HIP_CHECK(hipMemcpy(d, h_src, SZ, hipMemcpyHostToDevice)); + HRR_HIP_CHECK(hipMemcpy(d, h_src, SZ, hipMemcpyHostToDevice)); // D2H blob (value = 55) int* h_out = new int[N](); - HIP_CHECK(hipMemcpyAsync(h_out, d, SZ, hipMemcpyDeviceToHost, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemcpyAsync(h_out, d, SZ, hipMemcpyDeviceToHost, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); for (int i = 0; i < N; ++i) REQUIRE(h_out[i] == 55); - HIP_CHECK(hipFree(d)); - HIP_CHECK(hipStreamDestroy(s)); + HRR_HIP_CHECK(hipFree(d)); + HRR_HIP_CHECK(hipStreamDestroy(s)); delete[] h_src; delete[] h_chk; delete[] h_out; } @@ -2519,15 +2531,15 @@ TEST_CASE("Unit_HRR_MemcpyExtra_Direct", "[.][hrr-direct]") { // Final blob: d[i] == 11. // =========================================================================== TEST_CASE("Unit_HRR_DeviceExtra_Direct", "[.][hrr-direct]") { - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); constexpr int N = 256; constexpr size_t SZ = N * sizeof(int); hipStream_t s; - HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); + HRR_HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); int* d = nullptr; - HIP_CHECK(hipMalloc(&d, SZ)); + HRR_HIP_CHECK(hipMalloc(&d, SZ)); // hipDeviceGetUuid hipUUID uuid{}; @@ -2542,8 +2554,8 @@ TEST_CASE("Unit_HRR_DeviceExtra_Direct", "[.][hrr-direct]") { // hipDeviceSetCacheConfig — set + restore hipFuncCache_t cacheCfg = hipFuncCachePreferNone; - HIP_CHECK(hipDeviceGetCacheConfig(&cacheCfg)); - HIP_CHECK(hipDeviceSetCacheConfig(cacheCfg)); + HRR_HIP_CHECK(hipDeviceGetCacheConfig(&cacheCfg)); + HRR_HIP_CHECK(hipDeviceSetCacheConfig(cacheCfg)); // hipDeviceEnablePeerAccess / hipDeviceDisablePeerAccess with self — // expected to return hipErrorInvalidDevice on single-GPU setups. @@ -2562,7 +2574,7 @@ TEST_CASE("Unit_HRR_DeviceExtra_Direct", "[.][hrr-direct]") { { hipError_t e = hipDevicePrimaryCtxRelease(0); REQUIRE((e == hipSuccess || e == hipErrorInvalidDevice)); } // Re-initialize after potential ctx release - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); // hipDeviceGetTexture1DLinearMaxWidth — may return hipErrorNotSupported size_t maxW = 0; @@ -2575,15 +2587,15 @@ TEST_CASE("Unit_HRR_DeviceExtra_Direct", "[.][hrr-direct]") { REQUIRE((e == hipSuccess || e == hipErrorNotSupported)); } // D2H blob (value = 11) - HIP_CHECK(hipMemsetD32(reinterpret_cast(d), 11, N)); - HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipMemsetD32(reinterpret_cast(d), 11, N)); + HRR_HIP_CHECK(hipDeviceSynchronize()); int* h = new int[N](); - HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); for (int i = 0; i < N; ++i) REQUIRE(h[i] == 11); - HIP_CHECK(hipFree(d)); - HIP_CHECK(hipStreamDestroy(s)); + HRR_HIP_CHECK(hipFree(d)); + HRR_HIP_CHECK(hipStreamDestroy(s)); delete[] h; } @@ -2597,15 +2609,15 @@ TEST_CASE("Unit_HRR_DeviceExtra_Direct", "[.][hrr-direct]") { // Final blob: d[i] == 13. // =========================================================================== TEST_CASE("Unit_HRR_StreamAdvanced2_Direct", "[.][hrr-direct]") { - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); constexpr int N = 256; constexpr size_t SZ = N * sizeof(int); hipStream_t s0; - HIP_CHECK(hipStreamCreateWithFlags(&s0, hipStreamNonBlocking)); + HRR_HIP_CHECK(hipStreamCreateWithFlags(&s0, hipStreamNonBlocking)); int* d = nullptr; - HIP_CHECK(hipMalloc(&d, SZ)); + HRR_HIP_CHECK(hipMalloc(&d, SZ)); // hipExtStreamCreateWithCUMask — create stream with CU mask hipStream_t cuStream = nullptr; @@ -2640,49 +2652,49 @@ TEST_CASE("Unit_HRR_StreamAdvanced2_Direct", "[.][hrr-direct]") { // hipStreamAttachMemAsync — attach managed memory to stream { int* managed = nullptr; - HIP_CHECK(hipMallocManaged(&managed, SZ)); + HRR_HIP_CHECK(hipMallocManaged(&managed, SZ)); { hipError_t e = hipStreamAttachMemAsync(s0, managed, SZ, hipMemAttachSingle); REQUIRE((e == hipSuccess || e == hipErrorNotSupported)); } - HIP_CHECK(hipStreamSynchronize(s0)); - HIP_CHECK(hipFree(managed)); + HRR_HIP_CHECK(hipStreamSynchronize(s0)); + HRR_HIP_CHECK(hipFree(managed)); } // hipStreamWaitValue32 / hipStreamWriteValue32 — use mapped host mem // hipDeviceAttributeCanUseStreamWaitValue gates support { int canWait = 0; - HIP_CHECK(hipDeviceGetAttribute(&canWait, + HRR_HIP_CHECK(hipDeviceGetAttribute(&canWait, hipDeviceAttributeCanUseStreamWaitValue, 0)); if (canWait) { int* flag = nullptr; - HIP_CHECK(hipHostMalloc(reinterpret_cast(&flag), + HRR_HIP_CHECK(hipHostMalloc(reinterpret_cast(&flag), sizeof(int), hipHostMallocMapped)); *flag = 0; // Write 1 into flag, then wait for it to be 1 - HIP_CHECK(hipStreamWriteValue32(s0, flag, 1, 0)); - HIP_CHECK(hipStreamWaitValue32(s0, flag, 1, + HRR_HIP_CHECK(hipStreamWriteValue32(s0, flag, 1, 0)); + HRR_HIP_CHECK(hipStreamWaitValue32(s0, flag, 1, hipStreamWaitValueEq, 0xFFFFFFFF)); - HIP_CHECK(hipStreamSynchronize(s0)); - HIP_CHECK(hipFreeHost(flag)); + HRR_HIP_CHECK(hipStreamSynchronize(s0)); + HRR_HIP_CHECK(hipFreeHost(flag)); } } // hipStreamWaitValue64 / hipStreamWriteValue64 { int canWait = 0; - HIP_CHECK(hipDeviceGetAttribute(&canWait, + HRR_HIP_CHECK(hipDeviceGetAttribute(&canWait, hipDeviceAttributeCanUseStreamWaitValue, 0)); if (canWait) { uint64_t* flag64 = nullptr; - HIP_CHECK(hipHostMalloc(reinterpret_cast(&flag64), + HRR_HIP_CHECK(hipHostMalloc(reinterpret_cast(&flag64), sizeof(uint64_t), hipHostMallocMapped)); *flag64 = 0; - HIP_CHECK(hipStreamWriteValue64(s0, flag64, 1ULL, 0)); - HIP_CHECK(hipStreamWaitValue64(s0, flag64, 1ULL, + HRR_HIP_CHECK(hipStreamWriteValue64(s0, flag64, 1ULL, 0)); + HRR_HIP_CHECK(hipStreamWaitValue64(s0, flag64, 1ULL, hipStreamWaitValueEq, 0xFFFFFFFFFFFFFFFFULL)); - HIP_CHECK(hipStreamSynchronize(s0)); - HIP_CHECK(hipFreeHost(flag64)); + HRR_HIP_CHECK(hipStreamSynchronize(s0)); + HRR_HIP_CHECK(hipFreeHost(flag64)); } } @@ -2708,26 +2720,26 @@ TEST_CASE("Unit_HRR_StreamAdvanced2_Direct", "[.][hrr-direct]") { // hipEventRecord_spt / _spt event recording { hipEvent_t ev; - HIP_CHECK(hipEventCreate(&ev)); + HRR_HIP_CHECK(hipEventCreate(&ev)); hipError_t e = hipEventRecord_spt(ev, s0); REQUIRE((e == hipSuccess || e == hipErrorNotSupported)); - HIP_CHECK(hipEventSynchronize(ev)); - HIP_CHECK(hipEventDestroy(ev)); + HRR_HIP_CHECK(hipEventSynchronize(ev)); + HRR_HIP_CHECK(hipEventDestroy(ev)); } - HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipDeviceSynchronize()); // D2H blob (value = 13) - HIP_CHECK(hipMemsetD32(reinterpret_cast(d), 13, N)); - HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipMemsetD32(reinterpret_cast(d), 13, N)); + HRR_HIP_CHECK(hipDeviceSynchronize()); int* h = new int[N](); - HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s0)); - HIP_CHECK(hipStreamSynchronize(s0)); + HRR_HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s0)); + HRR_HIP_CHECK(hipStreamSynchronize(s0)); for (int i = 0; i < N; ++i) REQUIRE(h[i] == 13); - HIP_CHECK(hipFree(d)); - if (cuStream) { HIP_CHECK(hipStreamDestroy(cuStream)); } - HIP_CHECK(hipStreamDestroy(s0)); + HRR_HIP_CHECK(hipFree(d)); + if (cuStream) { HRR_HIP_CHECK(hipStreamDestroy(cuStream)); } + HRR_HIP_CHECK(hipStreamDestroy(s0)); delete[] h; } @@ -2741,14 +2753,14 @@ TEST_CASE("Unit_HRR_StreamAdvanced2_Direct", "[.][hrr-direct]") { // Final blob: d[i] == 15. // =========================================================================== TEST_CASE("Unit_HRR_Context_Direct", "[.][hrr-direct]") { - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); constexpr int N = 256; constexpr size_t SZ = N * sizeof(int); hipStream_t s; - HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); + HRR_HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); int* d = nullptr; - HIP_CHECK(hipMalloc(&d, SZ)); + HRR_HIP_CHECK(hipMalloc(&d, SZ)); // hipCtxSynchronize — synchronize current context (may return NotSupported on some ROCm builds) { hipError_t e = hipCtxSynchronize(); @@ -2783,15 +2795,15 @@ TEST_CASE("Unit_HRR_Context_Direct", "[.][hrr-direct]") { REQUIRE((e == hipSuccess || e == hipErrorNotSupported)); } // D2H blob (value = 15) - HIP_CHECK(hipMemsetD32(reinterpret_cast(d), 15, N)); - HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipMemsetD32(reinterpret_cast(d), 15, N)); + HRR_HIP_CHECK(hipDeviceSynchronize()); int* h = new int[N](); - HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); for (int i = 0; i < N; ++i) REQUIRE(h[i] == 15); - HIP_CHECK(hipFree(d)); - HIP_CHECK(hipStreamDestroy(s)); + HRR_HIP_CHECK(hipFree(d)); + HRR_HIP_CHECK(hipStreamDestroy(s)); delete[] h; } @@ -2807,14 +2819,14 @@ TEST_CASE("Unit_HRR_Context_Direct", "[.][hrr-direct]") { // Final blob: d[i] == 17. // =========================================================================== TEST_CASE("Unit_HRR_ModuleExtra_Direct", "[.][hrr-direct]") { - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); constexpr int N = 256; constexpr size_t SZ = N * sizeof(int); hipStream_t s; - HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); + HRR_HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); int* d = nullptr; - HIP_CHECK(hipMalloc(&d, SZ)); + HRR_HIP_CHECK(hipMalloc(&d, SZ)); // Get a hipFunction_t handle for the fill kernel via hipGetFuncBySymbol // (uses symbol ptr from fat binary — stale at playback, NOOP) @@ -2904,15 +2916,15 @@ TEST_CASE("Unit_HRR_ModuleExtra_Direct", "[.][hrr-direct]") { (void)e; /* any error is acceptable with nullptr kernel handle */ } // D2H blob (value = 17) - HIP_CHECK(hipMemsetD32(reinterpret_cast(d), 17, N)); - HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipMemsetD32(reinterpret_cast(d), 17, N)); + HRR_HIP_CHECK(hipDeviceSynchronize()); int* h = new int[N](); - HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); for (int i = 0; i < N; ++i) REQUIRE(h[i] == 17); - HIP_CHECK(hipFree(d)); - HIP_CHECK(hipStreamDestroy(s)); + HRR_HIP_CHECK(hipFree(d)); + HRR_HIP_CHECK(hipStreamDestroy(s)); delete[] h; } @@ -2930,11 +2942,11 @@ TEST_CASE("Unit_HRR_MiscAPIs_Direct", "[.][hrr][direct]") { // the FIRST HIP call — so that first call is not recorded. Make it a harmless // hipSetDevice rather than the hipMalloc below, otherwise `d`'s allocation is // dropped and replay cannot map it. - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); float* d = nullptr; - HIP_CHECK(hipMalloc(&d, SZ)); + HRR_HIP_CHECK(hipMalloc(&d, SZ)); hipStream_t s; - HIP_CHECK(hipStreamCreate(&s)); + HRR_HIP_CHECK(hipStreamCreate(&s)); // hipProfilerStart / hipProfilerStop (void)hipProfilerStart(); @@ -2960,15 +2972,15 @@ TEST_CASE("Unit_HRR_MiscAPIs_Direct", "[.][hrr][direct]") { (void)hipMemPtrGetInfo(d, &ptrSize); } // D2H blob (value = 19) - HIP_CHECK(hipMemsetD32(reinterpret_cast(d), 19, N)); - HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipMemsetD32(reinterpret_cast(d), 19, N)); + HRR_HIP_CHECK(hipDeviceSynchronize()); int* h = new int[N](); - HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); for (int i = 0; i < N; ++i) REQUIRE(h[i] == 19); - HIP_CHECK(hipFree(d)); - HIP_CHECK(hipStreamDestroy(s)); + HRR_HIP_CHECK(hipFree(d)); + HRR_HIP_CHECK(hipStreamDestroy(s)); delete[] h; } @@ -3000,17 +3012,17 @@ TEST_CASE("Unit_HRR_DrvMemcpy3D_Direct", "[.][hrr][direct]") { // Chain: host(hsrc=VAL) --hipDrvMemcpy3D H2D--> A --hipDrvMemcpy3DAsync D2D--> B // --hipDrvMemcpy3D D2D--> C. Final D2H requires all three driver copies // (H2D blob path + dual device-ptr translation) to have replayed. - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); constexpr int N = 256; constexpr size_t SZ = N * sizeof(int); constexpr int VAL = kDrvPayload; int *A = nullptr, *B = nullptr, *C = nullptr; - HIP_CHECK(hipMalloc(&A, SZ)); - HIP_CHECK(hipMalloc(&B, SZ)); - HIP_CHECK(hipMalloc(&C, SZ)); + HRR_HIP_CHECK(hipMalloc(&A, SZ)); + HRR_HIP_CHECK(hipMalloc(&B, SZ)); + HRR_HIP_CHECK(hipMalloc(&C, SZ)); hipStream_t s; - HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); + HRR_HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); int* hsrc = new int[N]; for (int i = 0; i < N; ++i) hsrc[i] = VAL; @@ -3022,7 +3034,7 @@ TEST_CASE("Unit_HRR_DrvMemcpy3D_Direct", "[.][hrr][direct]") { p.WidthInBytes = SZ; p.Height = 1; p.Depth = 1; p.srcPitch = SZ; p.srcHeight = 1; p.dstPitch = SZ; p.dstHeight = 1; - HIP_CHECK(hipDrvMemcpy3D(&p)); } + HRR_HIP_CHECK(hipDrvMemcpy3D(&p)); } // (2) hipDrvMemcpy3DAsync D2D: A -> B on a stream (dual pointer translation). { HIP_MEMCPY3D p{}; @@ -3031,8 +3043,8 @@ TEST_CASE("Unit_HRR_DrvMemcpy3D_Direct", "[.][hrr][direct]") { p.WidthInBytes = SZ; p.Height = 1; p.Depth = 1; p.srcPitch = SZ; p.srcHeight = 1; p.dstPitch = SZ; p.dstHeight = 1; - HIP_CHECK(hipDrvMemcpy3DAsync(&p, s)); } - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipDrvMemcpy3DAsync(&p, s)); } + HRR_HIP_CHECK(hipStreamSynchronize(s)); // (3) hipDrvMemcpy3D D2D: B -> C (sync device-to-device). { HIP_MEMCPY3D p{}; @@ -3041,11 +3053,11 @@ TEST_CASE("Unit_HRR_DrvMemcpy3D_Direct", "[.][hrr][direct]") { p.WidthInBytes = SZ; p.Height = 1; p.Depth = 1; p.srcPitch = SZ; p.srcHeight = 1; p.dstPitch = SZ; p.dstHeight = 1; - HIP_CHECK(hipDrvMemcpy3D(&p)); } + HRR_HIP_CHECK(hipDrvMemcpy3D(&p)); } int* h = new int[N](); - HIP_CHECK(hipMemcpyAsync(h, C, SZ, hipMemcpyDeviceToHost, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemcpyAsync(h, C, SZ, hipMemcpyDeviceToHost, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); for (int i = 0; i < N; ++i) REQUIRE(h[i] == VAL); // (4) Pitched 3D H2D: kDrvRows rows of kDrvWidth bytes per slice, rows spaced @@ -3059,8 +3071,8 @@ TEST_CASE("Unit_HRR_DrvMemcpy3D_Direct", "[.][hrr][direct]") { constexpr size_t PSZ = kDrvPitch * kDrvRows * DEPTH; // 2048 bytes constexpr size_t PWORDS = PSZ / sizeof(int); int* P = nullptr; - HIP_CHECK(hipMalloc(&P, PSZ)); - HIP_CHECK(hipMemsetD32(reinterpret_cast(P), kDrvPad, PWORDS)); + HRR_HIP_CHECK(hipMalloc(&P, PSZ)); + HRR_HIP_CHECK(hipMemsetD32(reinterpret_cast(P), kDrvPad, PWORDS)); std::vector hp(PWORDS, kDrvHostFill); for (size_t z = 0; z < DEPTH; ++z) @@ -3075,11 +3087,11 @@ TEST_CASE("Unit_HRR_DrvMemcpy3D_Direct", "[.][hrr][direct]") { p.WidthInBytes = kDrvWidth; p.Height = kDrvRows; p.Depth = DEPTH; p.srcPitch = kDrvPitch; p.srcHeight = kDrvRows; p.dstPitch = kDrvPitch; p.dstHeight = kDrvRows; - HIP_CHECK(hipDrvMemcpy3D(&p)); } - HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipDrvMemcpy3D(&p)); } + HRR_HIP_CHECK(hipDeviceSynchronize()); std::vector back(PWORDS, 0); - HIP_CHECK(hipMemcpy(back.data(), P, PSZ, hipMemcpyDeviceToHost)); + HRR_HIP_CHECK(hipMemcpy(back.data(), P, PSZ, hipMemcpyDeviceToHost)); for (size_t z = 0; z < DEPTH; ++z) for (size_t y = 0; y < kDrvRows; ++y) { size_t row = (z * kDrvRows + y) * kDrvPitch / sizeof(int); @@ -3093,8 +3105,8 @@ TEST_CASE("Unit_HRR_DrvMemcpy3D_Direct", "[.][hrr][direct]") { // check; a same-pointer copy is also a no-op at capture time, so capture and // replay agree either way. int* scratch = nullptr; - HIP_CHECK(hipMalloc(&scratch, SZ)); - HIP_CHECK(hipMemsetD32(reinterpret_cast(scratch), kDrvPad, N)); + HRR_HIP_CHECK(hipMalloc(&scratch, SZ)); + HRR_HIP_CHECK(hipMemsetD32(reinterpret_cast(scratch), kDrvPad, N)); { hipMemcpy3DPeerParms pp{}; pp.srcDevice = 0; pp.dstDevice = 0; pp.srcPtr = make_hipPitchedPtr(scratch, sizeof(int), 1, 1); @@ -3107,14 +3119,14 @@ TEST_CASE("Unit_HRR_DrvMemcpy3D_Direct", "[.][hrr][direct]") { pp.dstPtr = make_hipPitchedPtr(scratch, sizeof(int), 1, 1); pp.extent = make_hipExtent(sizeof(int), 1, 1); (void)hipMemcpy3DPeerAsync(&pp, s); } - HIP_CHECK(hipStreamSynchronize(s)); - - HIP_CHECK(hipFree(scratch)); - HIP_CHECK(hipFree(P)); - HIP_CHECK(hipFree(A)); - HIP_CHECK(hipFree(B)); - HIP_CHECK(hipFree(C)); - HIP_CHECK(hipStreamDestroy(s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); + + HRR_HIP_CHECK(hipFree(scratch)); + HRR_HIP_CHECK(hipFree(P)); + HRR_HIP_CHECK(hipFree(A)); + HRR_HIP_CHECK(hipFree(B)); + HRR_HIP_CHECK(hipFree(C)); + HRR_HIP_CHECK(hipStreamDestroy(s)); delete[] hsrc; delete[] h; } @@ -3125,16 +3137,16 @@ TEST_CASE("Unit_HRR_DrvMemcpy3D_Direct", "[.][hrr][direct]") { // H2D rect whose inter-row padding must survive. // =========================================================================== TEST_CASE("Unit_HRR_DrvMemcpy2DUnaligned_Direct", "[.][hrr][direct]") { - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); constexpr int N = 256; constexpr size_t SZ = N * sizeof(int); constexpr int VAL = kDrvPayload; int *A = nullptr, *B = nullptr; - HIP_CHECK(hipMalloc(&A, SZ)); - HIP_CHECK(hipMalloc(&B, SZ)); + HRR_HIP_CHECK(hipMalloc(&A, SZ)); + HRR_HIP_CHECK(hipMalloc(&B, SZ)); hipStream_t s; - HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); + HRR_HIP_CHECK(hipStreamCreateWithFlags(&s, hipStreamNonBlocking)); int* hsrc = new int[N]; for (int i = 0; i < N; ++i) hsrc[i] = VAL; @@ -3144,18 +3156,18 @@ TEST_CASE("Unit_HRR_DrvMemcpy2DUnaligned_Direct", "[.][hrr][direct]") { p.srcMemoryType = hipMemoryTypeHost; p.srcHost = hsrc; p.srcPitch = SZ; p.dstMemoryType = hipMemoryTypeDevice; p.dstDevice = reinterpret_cast(A); p.dstPitch = SZ; p.WidthInBytes = SZ; p.Height = 1; - HIP_CHECK(hipDrvMemcpy2DUnaligned(&p)); } + HRR_HIP_CHECK(hipDrvMemcpy2DUnaligned(&p)); } // (2) D2D: A -> B (dual pointer translation). { hip_Memcpy2D p{}; p.srcMemoryType = hipMemoryTypeDevice; p.srcDevice = reinterpret_cast(A); p.srcPitch = SZ; p.dstMemoryType = hipMemoryTypeDevice; p.dstDevice = reinterpret_cast(B); p.dstPitch = SZ; p.WidthInBytes = SZ; p.Height = 1; - HIP_CHECK(hipDrvMemcpy2DUnaligned(&p)); } + HRR_HIP_CHECK(hipDrvMemcpy2DUnaligned(&p)); } int* h = new int[N](); - HIP_CHECK(hipMemcpyAsync(h, B, SZ, hipMemcpyDeviceToHost, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemcpyAsync(h, B, SZ, hipMemcpyDeviceToHost, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); for (int i = 0; i < N; ++i) REQUIRE(h[i] == VAL); // (3) Pitched 2D H2D: kDrvRows rows of kDrvWidth bytes spaced kDrvPitch apart. @@ -3167,8 +3179,8 @@ TEST_CASE("Unit_HRR_DrvMemcpy2DUnaligned_Direct", "[.][hrr][direct]") { constexpr size_t PSZ = kDrvPitch * kDrvRows; // 1024 bytes constexpr size_t PWORDS = PSZ / sizeof(int); int* P = nullptr; - HIP_CHECK(hipMalloc(&P, PSZ)); - HIP_CHECK(hipMemsetD32(reinterpret_cast(P), kDrvPad, PWORDS)); + HRR_HIP_CHECK(hipMalloc(&P, PSZ)); + HRR_HIP_CHECK(hipMemsetD32(reinterpret_cast(P), kDrvPad, PWORDS)); std::vector hp(PWORDS, kDrvHostFill); for (size_t y = 0; y < kDrvRows; ++y) @@ -3180,20 +3192,20 @@ TEST_CASE("Unit_HRR_DrvMemcpy2DUnaligned_Direct", "[.][hrr][direct]") { p.dstMemoryType = hipMemoryTypeDevice; p.dstDevice = reinterpret_cast(P); p.srcPitch = kDrvPitch; p.dstPitch = kDrvPitch; p.WidthInBytes = kDrvWidth; p.Height = kDrvRows; - HIP_CHECK(hipDrvMemcpy2DUnaligned(&p)); } - HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipDrvMemcpy2DUnaligned(&p)); } + HRR_HIP_CHECK(hipDeviceSynchronize()); std::vector back(PWORDS, 0); - HIP_CHECK(hipMemcpy(back.data(), P, PSZ, hipMemcpyDeviceToHost)); + HRR_HIP_CHECK(hipMemcpy(back.data(), P, PSZ, hipMemcpyDeviceToHost)); for (size_t y = 0; y < kDrvRows; ++y) for (size_t w = 0; w < kDrvPitch / sizeof(int); ++w) REQUIRE(back[y * kDrvPitch / sizeof(int) + w] == (w < kDrvWidth / sizeof(int) ? kDrvPayload : kDrvPad)); - HIP_CHECK(hipFree(P)); - HIP_CHECK(hipFree(A)); - HIP_CHECK(hipFree(B)); - HIP_CHECK(hipStreamDestroy(s)); + HRR_HIP_CHECK(hipFree(P)); + HRR_HIP_CHECK(hipFree(A)); + HRR_HIP_CHECK(hipFree(B)); + HRR_HIP_CHECK(hipStreamDestroy(s)); delete[] hsrc; delete[] h; } @@ -3204,16 +3216,16 @@ TEST_CASE("Unit_HRR_DrvMemcpy2DUnaligned_Direct", "[.][hrr][direct]") { TEST_CASE("Unit_HRR_Texture_Direct", "[.][hrr][direct]") { // Gate entire test on image support int imageSupport = 0; - HIP_CHECK(hipDeviceGetAttribute(&imageSupport, hipDeviceAttributeImageSupport, 0)); + HRR_HIP_CHECK(hipDeviceGetAttribute(&imageSupport, hipDeviceAttributeImageSupport, 0)); if (!imageSupport) { SUCCEED("Device has no image support — skipping texture workload"); return; } float* d = nullptr; - HIP_CHECK(hipMalloc(&d, SZ)); + HRR_HIP_CHECK(hipMalloc(&d, SZ)); hipStream_t s; - HIP_CHECK(hipStreamCreate(&s)); + HRR_HIP_CHECK(hipStreamCreate(&s)); // hipArrayCreate hipArray_t arr0 = nullptr; @@ -3222,7 +3234,7 @@ TEST_CASE("Unit_HRR_Texture_Direct", "[.][hrr][direct]") { desc.Height = 1; desc.Format = HIP_AD_FORMAT_FLOAT; desc.NumChannels = 1; - HIP_CHECK(hipArrayCreate(&arr0, &desc)); } + HRR_HIP_CHECK(hipArrayCreate(&arr0, &desc)); } // hipArrayGetDescriptor { HIP_ARRAY_DESCRIPTOR out{}; @@ -3240,7 +3252,7 @@ TEST_CASE("Unit_HRR_Texture_Direct", "[.][hrr][direct]") { desc3.Depth = 1; desc3.Format = HIP_AD_FORMAT_FLOAT; desc3.NumChannels = 1; - HIP_CHECK(hipArray3DCreate(&arr3d, &desc3)); } + HRR_HIP_CHECK(hipArray3DCreate(&arr3d, &desc3)); } // hipArray3DGetDescriptor { HIP_ARRAY3D_DESCRIPTOR out3{}; @@ -3260,7 +3272,7 @@ TEST_CASE("Unit_HRR_Texture_Direct", "[.][hrr][direct]") { if (e == hipSuccess && mma) { hipArray_t lvl = nullptr; (void)hipGetMipmappedArrayLevel(&lvl, mma, 0); - HIP_CHECK(hipFreeMipmappedArray(mma)); + HRR_HIP_CHECK(hipFreeMipmappedArray(mma)); } } // hipCreateTextureObject / hipDestroyTextureObject @@ -3280,19 +3292,19 @@ TEST_CASE("Unit_HRR_Texture_Direct", "[.][hrr][direct]") { if (e == hipSuccess) { (void)hipTexObjectDestroy(tex); } } // Cleanup arrays - HIP_CHECK(hipArrayDestroy(arr0)); - HIP_CHECK(hipArrayDestroy(arr3d)); + HRR_HIP_CHECK(hipArrayDestroy(arr0)); + HRR_HIP_CHECK(hipArrayDestroy(arr3d)); // D2H blob (value = 23) - HIP_CHECK(hipMemsetD32(reinterpret_cast(d), 23, N)); - HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipMemsetD32(reinterpret_cast(d), 23, N)); + HRR_HIP_CHECK(hipDeviceSynchronize()); int* h = new int[N](); - HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); for (int i = 0; i < N; ++i) REQUIRE(h[i] == 23); - HIP_CHECK(hipFree(d)); - HIP_CHECK(hipStreamDestroy(s)); + HRR_HIP_CHECK(hipFree(d)); + HRR_HIP_CHECK(hipStreamDestroy(s)); delete[] h; } @@ -3301,11 +3313,11 @@ TEST_CASE("Unit_HRR_Texture_Direct", "[.][hrr][direct]") { // --------------------------------------------------------------------------- TEST_CASE("Unit_HRR_GraphExplicit_Direct", "[.][hrr][direct]") { // Warm-up first HIP call so the hipMalloc below is captured (see MiscAPIs). - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); float* d = nullptr; - HIP_CHECK(hipMalloc(&d, SZ)); + HRR_HIP_CHECK(hipMalloc(&d, SZ)); hipStream_t s; - HIP_CHECK(hipStreamCreate(&s)); + HRR_HIP_CHECK(hipStreamCreate(&s)); // Create an empty graph hipGraph_t emptyGraph = nullptr; @@ -3313,9 +3325,9 @@ TEST_CASE("Unit_HRR_GraphExplicit_Direct", "[.][hrr][direct]") { // Stream-capture a simple memset to get a real graph hipGraph_t capturedGraph = nullptr; - HIP_CHECK(hipStreamBeginCapture(s, hipStreamCaptureModeGlobal)); - HIP_CHECK(hipMemsetAsync(d, 0, SZ, s)); - HIP_CHECK(hipStreamEndCapture(s, &capturedGraph)); + HRR_HIP_CHECK(hipStreamBeginCapture(s, hipStreamCaptureModeGlobal)); + HRR_HIP_CHECK(hipMemsetAsync(d, 0, SZ, s)); + HRR_HIP_CHECK(hipStreamEndCapture(s, &capturedGraph)); // hipGraphClone hipGraph_t clonedGraph = nullptr; @@ -3330,7 +3342,7 @@ TEST_CASE("Unit_HRR_GraphExplicit_Direct", "[.][hrr][direct]") { // hipGraphInstantiate hipGraphExec_t exec = nullptr; - HIP_CHECK(hipGraphInstantiate(&exec, capturedGraph, nullptr, nullptr, 0)); + HRR_HIP_CHECK(hipGraphInstantiate(&exec, capturedGraph, nullptr, nullptr, 0)); // hipGraphExecGetFlags { unsigned long long execFlags = 0; @@ -3358,8 +3370,8 @@ TEST_CASE("Unit_HRR_GraphExplicit_Direct", "[.][hrr][direct]") { (void)hipGraphUpload(exec, s); // hipGraphLaunch (MANUAL playback — this exercises the graph replay path) - HIP_CHECK(hipGraphLaunch(exec, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipGraphLaunch(exec, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); // hipGraphExecDestroy (void)hipGraphExecDestroy(exec); @@ -3378,15 +3390,15 @@ TEST_CASE("Unit_HRR_GraphExplicit_Direct", "[.][hrr][direct]") { if (capturedGraph)(void)hipGraphDestroy(capturedGraph); // D2H blob (value = 25) - HIP_CHECK(hipMemsetD32(reinterpret_cast(d), 25, N)); - HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipMemsetD32(reinterpret_cast(d), 25, N)); + HRR_HIP_CHECK(hipDeviceSynchronize()); int* h = new int[N](); - HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); for (int i = 0; i < N; ++i) REQUIRE(h[i] == 25); - HIP_CHECK(hipFree(d)); - HIP_CHECK(hipStreamDestroy(s)); + HRR_HIP_CHECK(hipFree(d)); + HRR_HIP_CHECK(hipStreamDestroy(s)); delete[] h; } @@ -3400,21 +3412,21 @@ __global__ void hrr_fill(int* out, int val, int n) { TEST_CASE("Unit_HRR_HostRegLaunch_Direct", "[.][hrr][direct]") { // Warm-up first HIP call so the hipMalloc below is captured (see MiscAPIs). - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); float* d = nullptr; - HIP_CHECK(hipMalloc(&d, SZ)); + HRR_HIP_CHECK(hipMalloc(&d, SZ)); hipStream_t s; - HIP_CHECK(hipStreamCreate(&s)); + HRR_HIP_CHECK(hipStreamCreate(&s)); // ---- hipHostRegister / hipHostUnregister -------------------------------- { int* h_reg = static_cast(malloc(SZ)); REQUIRE(h_reg != nullptr); for (int i = 0; i < N; ++i) h_reg[i] = i; - HIP_CHECK(hipHostRegister(h_reg, SZ, hipHostRegisterDefault)); + HRR_HIP_CHECK(hipHostRegister(h_reg, SZ, hipHostRegisterDefault)); // H2D: copy from registered buffer to device - HIP_CHECK(hipMemcpy(d, h_reg, SZ, hipMemcpyHostToDevice)); - HIP_CHECK(hipHostUnregister(h_reg)); + HRR_HIP_CHECK(hipMemcpy(d, h_reg, SZ, hipMemcpyHostToDevice)); + HRR_HIP_CHECK(hipHostUnregister(h_reg)); free(h_reg); } @@ -3425,9 +3437,9 @@ TEST_CASE("Unit_HRR_HostRegLaunch_Direct", "[.][hrr][direct]") { int n = N; void* args[] = { &d_int, &val, &n }; int blocks = (N + 255) / 256; - HIP_CHECK(hipLaunchKernel(reinterpret_cast(hrr_fill), + HRR_HIP_CHECK(hipLaunchKernel(reinterpret_cast(hrr_fill), dim3(blocks), dim3(256), args, 0, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); } // ---- hipMemcpy3D_spt / hipMemcpy3DAsync_spt ----------------------------- @@ -3440,18 +3452,18 @@ TEST_CASE("Unit_HRR_HostRegLaunch_Direct", "[.][hrr][direct]") { p.kind = hipMemcpyDeviceToDevice; (void)hipMemcpy3D_spt(&p); (void)hipMemcpy3DAsync_spt(&p, s); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); } // D2H blob (value = 27, set by hrr_fill above) - HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipDeviceSynchronize()); int* h = new int[N](); - HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); for (int i = 0; i < N; ++i) REQUIRE(h[i] == 27); - HIP_CHECK(hipFree(d)); - HIP_CHECK(hipStreamDestroy(s)); + HRR_HIP_CHECK(hipFree(d)); + HRR_HIP_CHECK(hipStreamDestroy(s)); delete[] h; } @@ -3468,15 +3480,15 @@ extern "C" __global__ void rtc_fill(int* out, int val, int n) { TEST_CASE("Unit_HRR_ModuleAPI_Direct", "[.][hrr][direct]") { // Warm-up first HIP call so the hipMalloc below is captured (see MiscAPIs). - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); float* d = nullptr; - HIP_CHECK(hipMalloc(&d, SZ)); + HRR_HIP_CHECK(hipMalloc(&d, SZ)); hipStream_t s; - HIP_CHECK(hipStreamCreate(&s)); + HRR_HIP_CHECK(hipStreamCreate(&s)); // Compile a minimal kernel via HIPRTC hiprtcProgram prog = nullptr; - HIPRTC_CHECK(hiprtcCreateProgram(&prog, k_fill_src, "rtc_fill.hip", + HRR_HIPRTC_CHECK(hiprtcCreateProgram(&prog, k_fill_src, "rtc_fill.hip", 0, nullptr, nullptr)); hiprtcResult compile_rc = hiprtcCompileProgram(prog, 0, nullptr); if (compile_rc != HIPRTC_SUCCESS) { @@ -3488,18 +3500,18 @@ TEST_CASE("Unit_HRR_ModuleAPI_Direct", "[.][hrr][direct]") { FAIL("hiprtcCompileProgram failed: " + log); } size_t co_size = 0; - HIPRTC_CHECK(hiprtcGetCodeSize(prog, &co_size)); + HRR_HIPRTC_CHECK(hiprtcGetCodeSize(prog, &co_size)); std::vector co(co_size); - HIPRTC_CHECK(hiprtcGetCode(prog, co.data())); - HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); + HRR_HIPRTC_CHECK(hiprtcGetCode(prog, co.data())); + HRR_HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); // ---- hipModuleLoadData --------------------------------------------------- hipModule_t mod_data = nullptr; - HIP_CHECK(hipModuleLoadData(&mod_data, co.data())); + HRR_HIP_CHECK(hipModuleLoadData(&mod_data, co.data())); // ---- hipModuleGetFunction ------------------------------------------------ hipFunction_t fn = nullptr; - HIP_CHECK(hipModuleGetFunction(&fn, mod_data, "rtc_fill")); + HRR_HIP_CHECK(hipModuleGetFunction(&fn, mod_data, "rtc_fill")); // ---- hipModuleLaunchKernel ---------------------------------------------- { @@ -3508,20 +3520,20 @@ TEST_CASE("Unit_HRR_ModuleAPI_Direct", "[.][hrr][direct]") { int n = N; void* args[] = { &d_int, &val, &n }; int blocks = (N + 255) / 256; - HIP_CHECK(hipModuleLaunchKernel(fn, + HRR_HIP_CHECK(hipModuleLaunchKernel(fn, blocks, 1, 1, // grid 256, 1, 1, // block 0, s, args, nullptr)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); } // ---- hipModuleLoadDataEx (options=nullptr, numOptions=0) ---------------- { hipModule_t mod_ex = nullptr; - HIP_CHECK(hipModuleLoadDataEx(&mod_ex, co.data(), 0, nullptr, nullptr)); + HRR_HIP_CHECK(hipModuleLoadDataEx(&mod_ex, co.data(), 0, nullptr, nullptr)); hipFunction_t fn_ex = nullptr; - HIP_CHECK(hipModuleGetFunction(&fn_ex, mod_ex, "rtc_fill")); - HIP_CHECK(hipModuleUnload(mod_ex)); + HRR_HIP_CHECK(hipModuleGetFunction(&fn_ex, mod_ex, "rtc_fill")); + HRR_HIP_CHECK(hipModuleUnload(mod_ex)); } // ---- hipModuleLoad (write CO to temp file, then load from disk) ---------- @@ -3539,8 +3551,8 @@ TEST_CASE("Unit_HRR_ModuleAPI_Direct", "[.][hrr][direct]") { f.write(co.data(), static_cast(co.size())); } hipModule_t mod_file = nullptr; - HIP_CHECK(hipModuleLoad(&mod_file, tmp_co.string().c_str())); - HIP_CHECK(hipModuleUnload(mod_file)); + HRR_HIP_CHECK(hipModuleLoad(&mod_file, tmp_co.string().c_str())); + HRR_HIP_CHECK(hipModuleUnload(mod_file)); // Ignore remove errors: on Windows the ROCm driver may keep the file // open after hipModuleUnload, making fs::remove throw. The temp // directory will clean it up on next boot. @@ -3548,17 +3560,17 @@ TEST_CASE("Unit_HRR_ModuleAPI_Direct", "[.][hrr][direct]") { fs::remove(tmp_co, ec); } - HIP_CHECK(hipModuleUnload(mod_data)); + HRR_HIP_CHECK(hipModuleUnload(mod_data)); // D2H blob (value = 29, set by hipModuleLaunchKernel above) - HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipDeviceSynchronize()); int* h = new int[N](); - HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); for (int i = 0; i < N; ++i) REQUIRE(h[i] == 29); - HIP_CHECK(hipFree(d)); - HIP_CHECK(hipStreamDestroy(s)); + HRR_HIP_CHECK(hipFree(d)); + HRR_HIP_CHECK(hipStreamDestroy(s)); delete[] h; } @@ -3572,7 +3584,7 @@ TEST_CASE("Unit_HRR_ModuleAPI_Direct", "[.][hrr][direct]") { // --------------------------------------------------------------------------- TEST_CASE("Unit_HRR_VMM_Direct", "[.][hrr][direct]") { int vmm_supported = 0; - HIP_CHECK(hipDeviceGetAttribute(&vmm_supported, + HRR_HIP_CHECK(hipDeviceGetAttribute(&vmm_supported, hipDeviceAttributeVirtualMemoryManagementSupported, 0)); if (!vmm_supported) { SUCCEED("VMM not supported on this device — skipping"); @@ -3585,7 +3597,7 @@ TEST_CASE("Unit_HRR_VMM_Direct", "[.][hrr][direct]") { prop.location.id = 0; size_t granularity = 0; - HIP_CHECK(hipMemGetAllocationGranularity(&granularity, &prop, + HRR_HIP_CHECK(hipMemGetAllocationGranularity(&granularity, &prop, hipMemAllocationGranularityRecommended)); REQUIRE(granularity > 0); @@ -3596,12 +3608,12 @@ TEST_CASE("Unit_HRR_VMM_Direct", "[.][hrr][direct]") { // hipMemAddressReserve void* va = nullptr; - HIP_CHECK(hipMemAddressReserve(&va, alloc_sz, 0, nullptr, 0)); + HRR_HIP_CHECK(hipMemAddressReserve(&va, alloc_sz, 0, nullptr, 0)); REQUIRE(va != nullptr); // hipMemCreate hipMemGenericAllocationHandle_t handle{}; - HIP_CHECK(hipMemCreate(&handle, alloc_sz, &prop, 0)); + HRR_HIP_CHECK(hipMemCreate(&handle, alloc_sz, &prop, 0)); // hipMemGetAllocationPropertiesFromHandle — coverage only { @@ -3610,31 +3622,31 @@ TEST_CASE("Unit_HRR_VMM_Direct", "[.][hrr][direct]") { } // hipMemMap - HIP_CHECK(hipMemMap(va, alloc_sz, 0, handle, 0)); + HRR_HIP_CHECK(hipMemMap(va, alloc_sz, 0, handle, 0)); // hipMemSetAccess hipMemAccessDesc desc{}; desc.location.type = hipMemLocationTypeDevice; desc.location.id = 0; desc.flags = hipMemAccessFlagsProtReadWrite; - HIP_CHECK(hipMemSetAccess(va, alloc_sz, &desc, 1)); + HRR_HIP_CHECK(hipMemSetAccess(va, alloc_sz, &desc, 1)); // D2H validation blob (value 0x1F1F1F1F per hipMemset(0x1F)) hipStream_t s; - HIP_CHECK(hipStreamCreate(&s)); - HIP_CHECK(hipMemset(va, 0x1F, alloc_sz)); - HIP_CHECK(hipDeviceSynchronize()); + HRR_HIP_CHECK(hipStreamCreate(&s)); + HRR_HIP_CHECK(hipMemset(va, 0x1F, alloc_sz)); + HRR_HIP_CHECK(hipDeviceSynchronize()); int* hvmm = new int[N](); - HIP_CHECK(hipMemcpyAsync(hvmm, va, N * sizeof(int), hipMemcpyDeviceToHost, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemcpyAsync(hvmm, va, N * sizeof(int), hipMemcpyDeviceToHost, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); for (int i = 0; i < N; ++i) REQUIRE(hvmm[i] == 0x1F1F1F1F); delete[] hvmm; - HIP_CHECK(hipStreamDestroy(s)); - HIP_CHECK(hipMemUnmap(va, alloc_sz)); - HIP_CHECK(hipMemRelease(handle)); - HIP_CHECK(hipMemAddressFree(va, alloc_sz)); + HRR_HIP_CHECK(hipStreamDestroy(s)); + HRR_HIP_CHECK(hipMemUnmap(va, alloc_sz)); + HRR_HIP_CHECK(hipMemRelease(handle)); + HRR_HIP_CHECK(hipMemAddressFree(va, alloc_sz)); } // --------------------------------------------------------------------------- @@ -3647,11 +3659,11 @@ TEST_CASE("Unit_HRR_VMM_Direct", "[.][hrr][direct]") { // --------------------------------------------------------------------------- TEST_CASE("Unit_HRR_ChevronLaunch_Direct", "[.][hrr][direct]") { // Warm-up first HIP call so the hipMalloc below is captured (see MiscAPIs). - HIP_CHECK(hipSetDevice(0)); + HRR_HIP_CHECK(hipSetDevice(0)); int* d = nullptr; - HIP_CHECK(hipMalloc(&d, SZ)); + HRR_HIP_CHECK(hipMalloc(&d, SZ)); hipStream_t s; - HIP_CHECK(hipStreamCreate(&s)); + HRR_HIP_CHECK(hipStreamCreate(&s)); // Drain any pending GPU errors from earlier tests before the <<<>>> launch. (void)hipDeviceSynchronize(); @@ -3660,14 +3672,14 @@ TEST_CASE("Unit_HRR_ChevronLaunch_Direct", "[.][hrr][direct]") { int blocks = (N + 255) / 256; // Triple-chevron launch — goes through __hipPushCallConfiguration + hipLaunchByPtr hrr_fill<<>>(d, 42, N); - HIP_CHECK(hipGetLastError()); + HRR_HIP_CHECK(hipGetLastError()); int* h = new int[N](); - HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); - HIP_CHECK(hipStreamSynchronize(s)); + HRR_HIP_CHECK(hipMemcpyAsync(h, d, SZ, hipMemcpyDeviceToHost, s)); + HRR_HIP_CHECK(hipStreamSynchronize(s)); for (int i = 0; i < N; ++i) REQUIRE(h[i] == 42); delete[] h; - HIP_CHECK(hipFree(d)); - HIP_CHECK(hipStreamDestroy(s)); + HRR_HIP_CHECK(hipFree(d)); + HRR_HIP_CHECK(hipStreamDestroy(s)); } diff --git a/projects/hrr/tests/unit/CMakeLists.txt b/projects/hrr/tests/unit/CMakeLists.txt new file mode 100644 index 000000000000..5c5c6b4c5f7e --- /dev/null +++ b/projects/hrr/tests/unit/CMakeLists.txt @@ -0,0 +1,61 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT + +# HRR unit tests. +# +# These exercise the archive wire format, crash-truncation recovery in the +# reader, and CPU-side playback invariants. They do not issue HIP runtime calls, +# but their sources include (via the local test harness and +# the playback helper header), so HIP headers are required to build them. + +add_executable(hrr-unit-tests + hrr_format_test.cc + hrr_recovery_test.cc + hrr_playback_test.cc +) +set_target_properties(hrr-unit-tests PROPERTIES + CXX_STANDARD 17 + CXX_STANDARD_REQUIRED ON) + +# ${CMAKE_CURRENT_SOURCE_DIR}/.. makes the local harness headers +# (hrr_test_common.hh, hrr_test_process.hh) available. hrr_reader.h, +# hip_playback.h, and hrr/hrr_api_args.h come transitively from hrr::reader. +target_include_directories(hrr-unit-tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/..) + +target_link_libraries(hrr-unit-tests PRIVATE + hrr::reader + hip::host + Catch2::Catch2WithMain) + +# HRR_API_ARGS_IMPLEMENTATION emits the hrr_api_names[] table with internal +# linkage per translation unit, matching hrr_reader; keep it defined here so the +# test TUs use their own copy rather than the extern declaration. +target_compile_definitions(hrr-unit-tests PRIVATE + HRR_API_ARGS_IMPLEMENTATION + __HIP_PLATFORM_AMD__ + ROCM_BIN_PATH="${ROCM_PATH}/bin" +) + +# hrr_recovery_test.cc spawns hrr-playback for its --repair / --info cases. +# +# * When the playback tool is built in this same tree (HRR_BUILD_PLAYBACK=ON), +# point at the just-built binary via its absolute target path so the tests +# exercise the in-tree hrr-playback rather than any installed copy, and make +# the unit target depend on it so it is built first. +# * Otherwise fall back to the bare name "hrr-playback", which SpawnProc +# resolves from PATH (the test prepends ROCM_BIN_PATH). This keeps the +# CPU-only reader/format tests buildable with HRR_BUILD_PLAYBACK=OFF; the two +# recovery cases that invoke hrr-playback then require an hrr-playback on +# PATH at run time (build with HRR_BUILD_PLAYBACK=ON to exercise them in +# tree). +if(TARGET hrr-playback) + target_compile_definitions(hrr-unit-tests PRIVATE + HRR_PLAYBACK_EXE="$") + add_dependencies(hrr-unit-tests hrr-playback) +else() + target_compile_definitions(hrr-unit-tests PRIVATE + HRR_PLAYBACK_EXE="hrr-playback") +endif() + +add_test(NAME hrr-unit-tests COMMAND hrr-unit-tests) diff --git a/projects/hip-tests/catch/unit/hrr/hrr_format_test.cc b/projects/hrr/tests/unit/hrr_format_test.cc similarity index 95% rename from projects/hip-tests/catch/unit/hrr/hrr_format_test.cc rename to projects/hrr/tests/unit/hrr_format_test.cc index f8312360a41c..b46f256528b5 100644 --- a/projects/hip-tests/catch/unit/hrr/hrr_format_test.cc +++ b/projects/hrr/tests/unit/hrr_format_test.cc @@ -16,9 +16,9 @@ * - hrr::hash_hex() produces correctly formatted 32-char hex strings */ -#include +#include "hrr_test_common.hh" #include "hrr_reader.h" -#include "hrr_api_args.h" +#include "hrr/hrr_api_args.h" #include "hip_playback.h" #include @@ -97,7 +97,7 @@ static std::vector make_set_device_event(uint64_t seq, int32_t device_i * * event_count == 3 * * each event's sequence_id, event_type, and deviceId field match */ -HIP_TEST_CASE(Unit_HRR_Format_Roundtrip) { +HRR_TEST_CASE(Unit_HRR_Format_Roundtrip) { TmpArchive arc("roundtrip"); // Build body: 3 hipSetDevice events with seq IDs 0, 1, 2 and device IDs 7, 3, 0 @@ -132,7 +132,7 @@ HIP_TEST_CASE(Unit_HRR_Format_Roundtrip) { * ---------------- * - A file with a bad magic number must be rejected by load_archive(). */ -HIP_TEST_CASE(Unit_HRR_Format_BadMagic) { +HRR_TEST_CASE(Unit_HRR_Format_BadMagic) { TmpArchive arc("bad_magic"); hrr_file_header fh{}; @@ -152,7 +152,7 @@ HIP_TEST_CASE(Unit_HRR_Format_BadMagic) { * - A truncated file (header present but first event cut short) must not * crash and must return an empty event list. */ -HIP_TEST_CASE(Unit_HRR_Format_TruncatedEvent) { +HRR_TEST_CASE(Unit_HRR_Format_TruncatedEvent) { TmpArchive arc("truncated"); // Write one full event then only 10 bytes of a second. @@ -182,7 +182,7 @@ HIP_TEST_CASE(Unit_HRR_Format_TruncatedEvent) { * - Known values: hash_hex(0,0) == "0000...0" (32 zeros), * hash_hex(0x1, 0x2) == 32-char string with expected nibbles. */ -HIP_TEST_CASE(Unit_HRR_Format_HashHex) { +HRR_TEST_CASE(Unit_HRR_Format_HashHex) { std::string z = hrr::hash_hex(0, 0); REQUIRE(z.size() == 32); REQUIRE(z == std::string(32, '0')); @@ -200,7 +200,7 @@ HIP_TEST_CASE(Unit_HRR_Format_HashHex) { * - event_type_name() returns a non-null, non-empty string for a known * event type and "UNKNOWN" for an out-of-range type. */ -HIP_TEST_CASE(Unit_HRR_Format_EventTypeName) { +HRR_TEST_CASE(Unit_HRR_Format_EventTypeName) { const char* name = hrr::event_type_name(HRR_API_HIPSETDEVICE); REQUIRE(name != nullptr); REQUIRE(std::string(name).find("hipSetDevice") != std::string::npos); @@ -223,7 +223,7 @@ HIP_TEST_CASE(Unit_HRR_Format_EventTypeName) { * - record_alloc maps a base address exactly. * - translate_ptr(base) returns the live pointer. */ -HIP_TEST_CASE(Unit_HRR_TranslatePtr_ExactMatch) { +HRR_TEST_CASE(Unit_HRR_TranslatePtr_ExactMatch) { PlaybackContext ctx; void* fake_live = reinterpret_cast(static_cast(0xDEAD0000u)); ctx.record_alloc(0xBEEF0000ULL, fake_live, 1024); @@ -236,7 +236,7 @@ HIP_TEST_CASE(Unit_HRR_TranslatePtr_ExactMatch) { * - An address that falls within a recorded allocation (base + offset) is * returned as (live_ptr + offset). */ -HIP_TEST_CASE(Unit_HRR_TranslatePtr_SubAlloc_ReturnsOffset) { +HRR_TEST_CASE(Unit_HRR_TranslatePtr_SubAlloc_ReturnsOffset) { PlaybackContext ctx; void* fake_live = reinterpret_cast(static_cast(0xDEAD0000u)); ctx.record_alloc(0xBEEF0000ULL, fake_live, 1024); @@ -250,7 +250,7 @@ HIP_TEST_CASE(Unit_HRR_TranslatePtr_SubAlloc_ReturnsOffset) { * - An address exactly one byte past the end of a recorded allocation * returns nullptr (out of range). */ -HIP_TEST_CASE(Unit_HRR_TranslatePtr_OutOfRange_ReturnsNull) { +HRR_TEST_CASE(Unit_HRR_TranslatePtr_OutOfRange_ReturnsNull) { PlaybackContext ctx; void* fake_live = reinterpret_cast(static_cast(0xDEAD0000u)); ctx.record_alloc(0xBEEF0000ULL, fake_live, 1024); @@ -262,7 +262,7 @@ HIP_TEST_CASE(Unit_HRR_TranslatePtr_OutOfRange_ReturnsNull) { * ---------------- * - translate_ptr(0) always returns nullptr regardless of alloc_map state. */ -HIP_TEST_CASE(Unit_HRR_TranslatePtr_Zero_ReturnsNull) { +HRR_TEST_CASE(Unit_HRR_TranslatePtr_Zero_ReturnsNull) { PlaybackContext ctx; void* fake_live = reinterpret_cast(static_cast(0xDEAD0000u)); ctx.record_alloc(0xBEEF0000ULL, fake_live, 1024); @@ -280,7 +280,7 @@ HIP_TEST_CASE(Unit_HRR_TranslatePtr_Zero_ReturnsNull) { * and points at the true home allocation. * - Regression for the tightest-enclosing range search in hip_playback.h. */ -HIP_TEST_CASE(Unit_HRR_TranslatePtr_TightestEnclosing) { +HRR_TEST_CASE(Unit_HRR_TranslatePtr_TightestEnclosing) { PlaybackContext ctx; void* liveOuter = reinterpret_cast(static_cast(0xA0000000u)); void* liveInner = reinterpret_cast(static_cast(0xB0000000u)); @@ -336,7 +336,7 @@ bool kind_uses_hipFree(AllocKind k) { * routed away from hipFree. Guards against re-introducing a hipFree call on * a host pointer at teardown. */ -HIP_TEST_CASE(Unit_HRR_AllocKind_FreeDispatch) { +HRR_TEST_CASE(Unit_HRR_AllocKind_FreeDispatch) { PlaybackContext ctx; void* dev = reinterpret_cast(static_cast(0x10000000u)); void* hmal = reinterpret_cast(static_cast(0x20000000u)); @@ -388,7 +388,7 @@ HIP_TEST_CASE(Unit_HRR_AllocKind_FreeDispatch) { * from doing an OOB reinterpret_cast. Both layers together make the malformed * event safe: it is loaded without crash, not decoded, and not dispatched. */ -HIP_TEST_CASE(Unit_HRR_Format_SmallPayloadForType) { +HRR_TEST_CASE(Unit_HRR_Format_SmallPayloadForType) { TmpArchive arc("small_payload"); // Build a hipMalloc event whose payload_length is exactly sizeof(hrr_event_header) @@ -427,7 +427,7 @@ HIP_TEST_CASE(Unit_HRR_Format_SmallPayloadForType) { * crash load_archive() and must be silently accepted into the event list * (raw_payload retained for future replay use). */ -HIP_TEST_CASE(Unit_HRR_Format_UnknownEventType) { +HRR_TEST_CASE(Unit_HRR_Format_UnknownEventType) { TmpArchive arc("unknown_type"); hrr_event_header hdr{}; diff --git a/projects/hip-tests/catch/unit/hrr/hrr_playback_test.cc b/projects/hrr/tests/unit/hrr_playback_test.cc similarity index 92% rename from projects/hip-tests/catch/unit/hrr/hrr_playback_test.cc rename to projects/hrr/tests/unit/hrr_playback_test.cc index 3909eb044062..241521f36ffc 100644 --- a/projects/hip-tests/catch/unit/hrr/hrr_playback_test.cc +++ b/projects/hrr/tests/unit/hrr_playback_test.cc @@ -11,14 +11,14 @@ * CPU-only unit tests for HRR playback helper invariants (no GPU required). */ -#include +#include "hrr_test_common.hh" #include "hip_playback.h" // ROCM-27985: the post-H2D-restore drain (hrr_sync_after_replayed_h2d) must // be skipped while a stream graph is being captured, because a device/stream // synchronize is illegal mid-capture (HIP 900/901). Lock that guard down: a // regression that dropped it would break HRR graph replay. -HIP_TEST_CASE(Unit_HRR_Playback_ReplayedH2DDrainGraphGuard) { +HRR_TEST_CASE(Unit_HRR_Playback_ReplayedH2DDrainGraphGuard) { // Outside graph capture: the replayed H2D restore must be drained. REQUIRE(hrr_replayed_h2d_needs_drain(false)); // During graph capture: draining is illegal, so it must be skipped. @@ -31,7 +31,7 @@ HIP_TEST_CASE(Unit_HRR_Playback_ReplayedH2DDrainGraphGuard) { // replayed event on a hipStreamNonBlocking stream and can overwrite a restored // kernel input with zeros. Draining is skipped when zero-init is turned off and // during graph capture, where the zero-init is never issued. -HIP_TEST_CASE(Unit_HRR_Playback_ZeroInitDrainGuard) { +HRR_TEST_CASE(Unit_HRR_Playback_ZeroInitDrainGuard) { // Normal replay: the zero-init must be ordered ahead of later events. REQUIRE(hrr_zero_init_needs_drain(true, false)); // HIP_HRR_REPLAY_ZERO_INIT=0: nothing was issued, so nothing to drain. diff --git a/projects/hip-tests/catch/unit/hrr/hrr_recovery_test.cc b/projects/hrr/tests/unit/hrr_recovery_test.cc similarity index 95% rename from projects/hip-tests/catch/unit/hrr/hrr_recovery_test.cc rename to projects/hrr/tests/unit/hrr_recovery_test.cc index 6dd5ee768adf..627fa94b5950 100644 --- a/projects/hip-tests/catch/unit/hrr/hrr_recovery_test.cc +++ b/projects/hrr/tests/unit/hrr_recovery_test.cc @@ -18,10 +18,10 @@ * run as part of HrrTest "[hrr]" in CI instead of an opt-in manual build. */ -#include -#include +#include "hrr_test_common.hh" +#include "hrr_test_process.hh" #include "hrr_reader.h" -#include "hrr_api_args.h" +#include "hrr/hrr_api_args.h" #include #include @@ -150,7 +150,7 @@ struct TmpRootArchive { } }; -static void set_proc_search_path(hip::SpawnProc& proc) { +static void set_proc_search_path(hrr::test::SpawnProc& proc) { const char* cur_path = getenv("PATH"); proc.setEnv("PATH", std::string(ROCM_BIN_PATH) + kPathSep + (cur_path ? cur_path : "")); @@ -158,7 +158,7 @@ static void set_proc_search_path(hip::SpawnProc& proc) { static std::pair run_hrr_playback(const fs::path& archive, const std::string& args) { - hip::SpawnProc proc(HRR_PLAYBACK_EXE, /*capture_stdout=*/true); + hrr::test::SpawnProc proc(HRR_PLAYBACK_EXE, /*capture_stdout=*/true); set_proc_search_path(proc); #ifdef _WIN32 std::string path_arg = "\"" + archive.string() + "\""; @@ -181,7 +181,7 @@ static std::pair run_hrr_playback(const fs::path& archive, * - A complete archive (N records + clean hrr_eof_record trailer) loads with * complete == true, truncated == false, and exactly N events. */ -HIP_TEST_CASE(Unit_HRR_Recovery_CompleteArchive) { +HRR_TEST_CASE(Unit_HRR_Recovery_CompleteArchive) { TmpArchive arc("complete"); arc.write_records(5); arc.write_trailer(5); @@ -201,7 +201,7 @@ HIP_TEST_CASE(Unit_HRR_Recovery_CompleteArchive) { * of a record header). The reader recovers the N complete records, marks the * archive not-complete and truncated. */ -HIP_TEST_CASE(Unit_HRR_Recovery_TornHeader) { +HRR_TEST_CASE(Unit_HRR_Recovery_TornHeader) { TmpArchive arc("torn_header"); arc.write_records(5); hrr_event_header partial = make_min_record(5); @@ -222,7 +222,7 @@ HIP_TEST_CASE(Unit_HRR_Recovery_TornHeader) { * not present (crash after header, before payload). The reader recovers the * N complete records, marks the archive not-complete and truncated. */ -HIP_TEST_CASE(Unit_HRR_Recovery_TornPayload) { +HRR_TEST_CASE(Unit_HRR_Recovery_TornPayload) { TmpArchive arc("torn_payload"); arc.write_records(3); hrr_event_header h = make_min_record(3); @@ -245,7 +245,7 @@ HIP_TEST_CASE(Unit_HRR_Recovery_TornPayload) { * reader recovers all N records, marks not-complete but NOT truncated (the * tail is a clean record boundary, not a torn record). */ -HIP_TEST_CASE(Unit_HRR_Recovery_NoTrailer) { +HRR_TEST_CASE(Unit_HRR_Recovery_NoTrailer) { TmpArchive arc("no_trailer"); arc.write_records(4); arc.finish(); @@ -265,7 +265,7 @@ HIP_TEST_CASE(Unit_HRR_Recovery_NoTrailer) { * - hrr-playback --repair appends a clean trailer and rewrites manifest.json * using the per-process schema consumed by root info aggregation. */ -HIP_TEST_CASE(Unit_HRR_Recovery_RepairWritesProcessManifest) { +HRR_TEST_CASE(Unit_HRR_Recovery_RepairWritesProcessManifest) { TmpRootArchive root("repair_manifest"); fs::path proc = root.add_process(/*pid=*/4242, /*parent_pid=*/0, /*records=*/3, /*trailer=*/false, @@ -310,7 +310,7 @@ HIP_TEST_CASE(Unit_HRR_Recovery_RepairWritesProcessManifest) { * - hrr-playback --info should still aggregate and list both process * manifests, which guards the multi-process root path. */ -HIP_TEST_CASE(Unit_HRR_Recovery_MultiProcessRootInfo) { +HRR_TEST_CASE(Unit_HRR_Recovery_MultiProcessRootInfo) { TmpRootArchive root("multi_process_root"); root.add_process(/*pid=*/111, /*parent_pid=*/0, /*records=*/2); root.add_process(/*pid=*/222, /*parent_pid=*/111, /*records=*/4); diff --git a/projects/clr/hipamd/src/hrr/gen_hrr_api_args.py b/projects/hrr/tools/gen_hrr_api_args.py similarity index 97% rename from projects/clr/hipamd/src/hrr/gen_hrr_api_args.py rename to projects/hrr/tools/gen_hrr_api_args.py index 4442d9abc90f..98a7a6eab92b 100644 --- a/projects/clr/hipamd/src/hrr/gen_hrr_api_args.py +++ b/projects/hrr/tools/gen_hrr_api_args.py @@ -9,11 +9,11 @@ [--output-capture HIP_CAPTURE_GENERATED_CPP] [--output-playback HIP_PLAYBACK_GENERATED_CPP] -Defaults: - input : ../../../hipamd/include/hip/amd_detail/hip_api_trace.hpp - output-header : ./hrr_api_args.h - output-capture : ./hip_capture_generated.cpp - output-playback : ./playback/hip_playback_generated.cpp +Defaults (paths relative to this script at projects/hrr/tools/): + input : ../../clr/hipamd/include/hip/amd_detail/hip_api_trace.hpp + output-header : ../include/hrr/hrr_api_args.h + output-capture : ../../clr/hipamd/src/hrr/hip_capture_generated.cpp + output-playback : ../playback/hip_playback_generated.cpp hrr_api_args.h -------------- @@ -652,6 +652,26 @@ "hipDrvGraphExecMemsetNodeSetParams", "hipDrvGraphMemcpyNodeGetParams", "hipDrvGraphMemcpyNodeSetParams", + # Category 16: present in the internal dispatch table (hip_api_trace.hpp) but + # NOT declared in the public HIP runtime headers the playback tool builds + # against (hip::host / find_package(hip)). hip_playback_generated.cpp calls + # the real API by its bare symbol name, so a direct call to an undeclared + # symbol fails to compile on the affected platform (this is the same class as + # Category 1 above). Replaying these has no effect on replay correctness, so a + # symbol-free no-op stub is both buildable on Linux and semantically safe. + # + # hipDeviceGetLuid — Windows-only. The HIP header contract states the LUID is + # valid only on Windows and the API returns hipErrorNotSupported on other + # platforms; the Linux public headers (e.g. the ROCm 7.15 nightly this tool + # builds against) do not declare it at all. It is a device-identity query + # with no replay effect — the direct analog hipDeviceGetUuid is already a + # no-op above. + "hipDeviceGetLuid", + # hipInitDevice — added to the dispatch table after the ROCm 7.15 nightly the + # playback tool builds against, so it is absent from those public headers. + # Device initialization is handled by the replay harness / lazy runtime + # init, so replaying it is unnecessary for correctness. + "hipInitDevice", } # --------------------------------------------------------------------------- @@ -1456,8 +1476,8 @@ def generate_header(entries: List[ApiEntry]) -> str: #include "hip_capture.h" #include "hip_capture_writer.h" -// hrr_api_args.h lives in the same directory (hipamd/src/hrr/) -#include "hrr_api_args.h" +// hrr_api_args.h now lives in projects/hrr/include/hrr (shared wire format) +#include "hrr/hrr_api_args.h" #include "hip/amd_detail/hip_api_trace.hpp" @@ -1857,7 +1877,7 @@ def generate_capture_cpp(entries: List[ApiEntry]) -> str: * ============================================================================ */ #include "hip_playback.h" -#include "hrr_api_args.h" +#include "hrr/hrr_api_args.h" #include #include @@ -2285,13 +2305,18 @@ def generate_playback_cpp(entries: List[ApiEntry]) -> str: # --------------------------------------------------------------------------- def main() -> None: - # Script lives at hipamd/src/hrr/ — three levels up is clr/ - hrr_dir = Path(__file__).resolve().parent # hipamd/src/hrr/ - clr_root = hrr_dir.parent.parent.parent # clr/ + # Script lives at projects/hrr/tools/ — resolve the split output layout. + # The portable header and playback live under projects/hrr; the capture + # shim stays inside CLR because it compiles into amdhip64. + tools_dir = Path(__file__).resolve().parent # projects/hrr/tools/ + hrr_project_dir = tools_dir.parent # projects/hrr/ + projects_dir = hrr_project_dir.parent # projects/ + clr_root = projects_dir / "clr" # projects/clr/ + clr_hrr_dir = clr_root / "hipamd" / "src" / "hrr" # capture stays in CLR default_input = clr_root / "hipamd/include/hip/amd_detail/hip_api_trace.hpp" - default_header = hrr_dir / "hrr_api_args.h" - default_capture = hrr_dir / "hip_capture_generated.cpp" - default_playback = hrr_dir / "playback/hip_playback_generated.cpp" + default_header = hrr_project_dir / "include" / "hrr" / "hrr_api_args.h" + default_capture = clr_hrr_dir / "hip_capture_generated.cpp" + default_playback = hrr_project_dir / "playback" / "hip_playback_generated.cpp" parser = argparse.ArgumentParser(description=__doc__) parser.add_argument("--input", default=str(default_input), From 75c4ba0918891c2c44073ce51263c9f938fc1b49 Mon Sep 17 00:00:00 2001 From: Maneesh Gupta Date: Wed, 26 Aug 2026 20:38:36 +0530 Subject: [PATCH 02/10] Update CODEOWNERS Updated HRR reviewers --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 29a0f8757411..7c1e843b3fc3 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -11,7 +11,7 @@ /projects/hipfile/ @ROCm/hipfile-reviewers /projects/hipother/ @ROCm/hipother-reviewers /projects/hip-tests/ @ROCm/hip-tests-reviewers -/projects/hrr/ @andraghetti +/projects/hrr/ @ROCm/hrr-reviewers /projects/rccl/ @ROCm/rccl-reviewers /projects/rccl/src/include/api_trace.h @ROCm/rccl-reviewers @ROCm/ROCM-DevTools-Team /projects/rccl/tools/scripts/test_runner/configs/ci-precheckin.json @ROCm/rccl-ci From 125cab87bcc93e4590d783ce71123b2fc5bec07b Mon Sep 17 00:00:00 2001 From: Maneesh Gupta Date: Wed, 26 Aug 2026 15:23:34 +0000 Subject: [PATCH 03/10] Address HRR review feedback Require playback when building HRR integration tests and preserve the old Windows skip behavior for the driver memcpy round-trip cases.\n\nCo-Authored-By: Claude --- projects/hrr/tests/CMakeLists.txt | 3 +++ projects/hrr/tests/integration/hrr_roundtrip_test.cc | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/projects/hrr/tests/CMakeLists.txt b/projects/hrr/tests/CMakeLists.txt index 1e3e17203457..470687b02533 100644 --- a/projects/hrr/tests/CMakeLists.txt +++ b/projects/hrr/tests/CMakeLists.txt @@ -34,5 +34,8 @@ find_package(hip CONFIG REQUIRED) add_subdirectory(unit) if(HRR_BUILD_INTEGRATION_TESTS) + if(NOT HRR_BUILD_PLAYBACK) + message(FATAL_ERROR "HRR_BUILD_INTEGRATION_TESTS requires HRR_BUILD_PLAYBACK because integration tests spawn hrr-playback") + endif() add_subdirectory(integration) endif() diff --git a/projects/hrr/tests/integration/hrr_roundtrip_test.cc b/projects/hrr/tests/integration/hrr_roundtrip_test.cc index 032e7bcb52e5..ecf5e883e914 100644 --- a/projects/hrr/tests/integration/hrr_roundtrip_test.cc +++ b/projects/hrr/tests/integration/hrr_roundtrip_test.cc @@ -1247,13 +1247,21 @@ HRR_TEST_CASE(Unit_HRR_MiscAPIsRoundtrip) { // Pure copy chains with no floating-point arithmetic; byte-exact D2H via // hrr_run_exact_roundtrip() is the correct oracle (see helper above). HRR_TEST_CASE(Unit_HRR_DrvMemcpy3DRoundtrip) { +#ifdef _WIN32 + HRR_SKIP("driver memcpy 3D HRR roundtrip is disabled on Windows"); +#else ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_drvmemcpy3d"}; hrr_run_exact_roundtrip("Unit_HRR_DrvMemcpy3D_Direct", cap.path); +#endif } HRR_TEST_CASE(Unit_HRR_DrvMemcpy2DUnalignedRoundtrip) { +#ifdef _WIN32 + HRR_SKIP("driver memcpy 2D unaligned HRR roundtrip is disabled on Windows"); +#else ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_drvmemcpy2dunaligned"}; hrr_run_exact_roundtrip("Unit_HRR_DrvMemcpy2DUnaligned_Direct", cap.path); +#endif } HRR_TEST_CASE(Unit_HRR_TextureRoundtrip) { From 68c8c81c805db373ac8caa47767fcb39b78882e3 Mon Sep 17 00:00:00 2001 From: Daniel Olsson Date: Mon, 31 Aug 2026 02:45:05 -0500 Subject: [PATCH 04/10] Wire HRR_CLR_LIB for integration tests and CI Integration tests must load capture-enabled libamdhip64 from the same commit as projects/hrr playback. Without it, SDK capture writes compact wire-format payloads that in-tree hrr-playback rejects. Add HrrCaptureLib.cmake to resolve HRR_CLR_LIB, prepend it to LD_LIBRARY_PATH in capture/replay subprocesses, set RUNPATH on test binaries, fail configure when unset, document the pairing requirement, and add CI that builds amdhip64 before running HRR ctest. Co-authored-by: Cursor --- .github/workflows/hrr-integration-tests.yml | 129 ++++++++++++++++++ .../hip-tests/catch/unit/hrr/CMakeLists.txt | 13 ++ .../catch/unit/hrr/hrr_capture_smoke_test.cc | 15 +- projects/hrr/DESIGN.md | 22 +++ projects/hrr/README.md | 35 +++++ projects/hrr/cmake/HrrCaptureLib.cmake | 71 ++++++++++ projects/hrr/tests/integration/CMakeLists.txt | 24 ++++ .../tests/integration/hrr_roundtrip_test.cc | 55 +++++--- 8 files changed, 341 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/hrr-integration-tests.yml create mode 100644 projects/hrr/cmake/HrrCaptureLib.cmake diff --git a/.github/workflows/hrr-integration-tests.yml b/.github/workflows/hrr-integration-tests.yml new file mode 100644 index 000000000000..984dd516fb90 --- /dev/null +++ b/.github/workflows/hrr-integration-tests.yml @@ -0,0 +1,129 @@ +# HRR integration tests: build capture-enabled amdhip64 (CLR) before projects/hrr +# playback/tests so capture and replay share the same wire-format commit. +name: HRR Integration Tests + +on: + pull_request: + paths: + - "projects/hrr/**" + - "projects/clr/hipamd/src/hrr/**" + - "projects/hip/**" + - ".github/workflows/hrr-integration-tests.yml" + push: + branches: + - develop + paths: + - "projects/hrr/**" + - "projects/clr/hipamd/src/hrr/**" + - "projects/hip/**" + - ".github/workflows/hrr-integration-tests.yml" + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: hrr-integration-${{ github.workflow }}-${{ github.event.number || github.sha }} + cancel-in-progress: true + +jobs: + hrr-integration-setup: + name: Setup + runs-on: ubuntu-24.04 + outputs: + should_run: ${{ steps.check_paths.outputs.should_run }} + steps: + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + fetch-depth: 2 + + - name: Check if relevant paths changed + id: check_paths + run: | + SHOULD_RUN=false + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then + SHOULD_RUN=true + elif [ "${{ github.event_name }}" = "push" ]; then + SHOULD_RUN=true + else + SHOULD_RUN=true + fi + echo "should_run=${SHOULD_RUN}" >> "${GITHUB_OUTPUT}" + + hrr-integration-tests: + name: Build CLR + HRR tests + needs: hrr-integration-setup + if: needs.hrr-integration-setup.outputs.should_run == 'true' + runs-on: azure-linux-scale-rocm + env: + ROCM_PATH: /opt/rocm + BUILD_DIR: ${{ github.workspace }}/build + REPO: ${{ github.workspace }}/rocm-systems + steps: + - name: Checkout rocm-systems + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + path: rocm-systems + sparse-checkout: | + projects/clr + projects/hip + projects/hrr + + - name: Install build dependencies + run: | + sudo apt-get update -q + sudo apt-get install -y --no-install-recommends \ + cmake ninja-build libnuma-dev libelf-dev python3-pip + pip3 install --break-system-packages CppHeaderParser || pip3 install CppHeaderParser + + - name: Build capture-enabled amdhip64 (CLR) + run: | + cmake -B "${BUILD_DIR}/clr" -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DHIP_PLATFORM=amd \ + -DCLR_BUILD_HIP=ON \ + -DCLR_BUILD_OCL=OFF \ + -DHIP_COMMON_DIR="${REPO}/projects/hip" \ + -DROCM_PATH="${ROCM_PATH}" \ + -DCMAKE_PREFIX_PATH="${ROCM_PATH}" \ + "${REPO}/projects/clr" + cmake --build "${BUILD_DIR}/clr" --target amdhip64 --parallel + + - name: Configure HRR tests + run: | + cmake -B "${BUILD_DIR}/hrr" -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DROCM_PATH="${ROCM_PATH}" \ + -DCMAKE_PREFIX_PATH="${ROCM_PATH}" \ + -DHRR_BUILD_PLAYBACK=ON \ + -DHRR_BUILD_TESTS=ON \ + -DHRR_BUILD_INTEGRATION_TESTS=ON \ + -DHRR_CLR_LIB="${BUILD_DIR}/clr/hipamd/lib" \ + "${REPO}/projects/hrr" + + - name: Build HRR tests + run: cmake --build "${BUILD_DIR}/hrr" --parallel + + - name: Run HRR unit tests + run: ctest --test-dir "${BUILD_DIR}/hrr" -R hrr-unit-tests --output-on-failure + + - name: Run HRR integration tests + env: + LD_LIBRARY_PATH: ${{ env.BUILD_DIR }}/clr/hipamd/lib + run: ctest --test-dir "${BUILD_DIR}/hrr" -R hrr-integration-tests --output-on-failure + + hrr-integration-summary: + name: Summary + if: always() + needs: [hrr-integration-setup, hrr-integration-tests] + runs-on: ubuntu-24.04 + steps: + - name: Check results + run: | + echo '${{ toJson(needs) }}' + FAILED="$(echo '${{ toJson(needs) }}' \ + | jq -r 'map_values(select(.result != "success" and .result != "skipped")) | keys | join(",")')" + if [ -n "${FAILED}" ]; then + echo "Failed jobs: ${FAILED}" + exit 1 + fi diff --git a/projects/hip-tests/catch/unit/hrr/CMakeLists.txt b/projects/hip-tests/catch/unit/hrr/CMakeLists.txt index ef37e51ede58..2331067c286e 100644 --- a/projects/hip-tests/catch/unit/hrr/CMakeLists.txt +++ b/projects/hip-tests/catch/unit/hrr/CMakeLists.txt @@ -5,6 +5,8 @@ # Minimal HRR capture sentinel for hip-tests. # Full HRR unit and integration tests live under projects/hrr/tests. +include("${CMAKE_CURRENT_SOURCE_DIR}/../../../../hrr/cmake/HrrCaptureLib.cmake") + set(TEST_SRC hrr_capture_smoke_test.cc ) @@ -20,8 +22,19 @@ hip_add_exe_to_target(NAME HrrTest # ROCM_BIN_PATH — prepended to PATH in the child so it finds amdhip64_7.dll # on Windows and the ROCm bin directory in packaged runs. if(HIP_PLATFORM STREQUAL "amd") + hrr_resolve_capture_lib(HRR_CAPTURE_LIB_DIR) + if(HRR_CAPTURE_LIB_DIR) + message(STATUS "HRR capture lib (smoke test): ${HRR_CAPTURE_LIB_DIR}") + hrr_apply_capture_lib_rpath("${HRR_CAPTURE_LIB_DIR}" HrrTest) + else() + message(WARNING + "HRR capture smoke test: HRR_CLR_LIB not set — subprocess may load a stale " + "SDK libamdhip64. Build amdhip64 and pass -DHRR_CLR_LIB=/hipamd/lib") + endif() + target_compile_definitions(HrrTest PRIVATE HRR_TEST_EXE="HrrTest" ROCM_BIN_PATH="${ROCM_PATH}/bin" + HRR_CLR_LIB="${HRR_CAPTURE_LIB_DIR}" ) endif() diff --git a/projects/hip-tests/catch/unit/hrr/hrr_capture_smoke_test.cc b/projects/hip-tests/catch/unit/hrr/hrr_capture_smoke_test.cc index 294710e87ac1..32f399c8ba57 100644 --- a/projects/hip-tests/catch/unit/hrr/hrr_capture_smoke_test.cc +++ b/projects/hip-tests/catch/unit/hrr/hrr_capture_smoke_test.cc @@ -24,16 +24,27 @@ namespace fs = std::filesystem; +#ifndef HRR_CLR_LIB +#define HRR_CLR_LIB "" +#endif + #ifdef _WIN32 static constexpr char kPathSep = ';'; #else static constexpr char kPathSep = ':'; #endif -static void set_proc_search_path(hip::SpawnProc& proc) { +static void set_proc_runtime_env(hip::SpawnProc& proc) { const char* cur_path = getenv("PATH"); proc.setEnv("PATH", std::string(ROCM_BIN_PATH) + kPathSep + (cur_path ? cur_path : "")); +#if !defined(_WIN32) + if (HRR_CLR_LIB[0] != '\0') { + const char* cur_ld = getenv("LD_LIBRARY_PATH"); + std::string ld = std::string(HRR_CLR_LIB) + kPathSep + (cur_ld ? cur_ld : ""); + proc.setEnv("LD_LIBRARY_PATH", ld); + } +#endif } struct ScopedDir { @@ -67,7 +78,7 @@ HIP_TEST_CASE(Unit_HRR_CaptureSmoke) { hip::SpawnProc proc(HRR_TEST_EXE); proc.setEnv("HIP_HRR_CAPTURE_OUTPUT", cap.path.string()); - set_proc_search_path(proc); + set_proc_runtime_env(proc); int ret = proc.run("\"Unit_HRR_CaptureSmoke_Direct\""); INFO("Capture subprocess exit code: " << ret); REQUIRE(ret == 0); diff --git a/projects/hrr/DESIGN.md b/projects/hrr/DESIGN.md index bf79baa5f09d..ac4bf6ab8df8 100644 --- a/projects/hrr/DESIGN.md +++ b/projects/hrr/DESIGN.md @@ -703,6 +703,28 @@ cmake --build hrr-build --target hrr-playback -j"$(nproc)" # installs to /bin/hrr-playback) ``` +### Integration tests (GPU capture/replay round-trip) + +Capture (`libamdhip64`) and playback (`hrr-playback` / reader) **must be built from +the same commit**. A prebuilt SDK `libamdhip64` often writes compact wire-format +payloads that the in-tree reader rejects (`payload too small`). + +```bash +# After building amdhip64 (see above): +cmake -S projects/hrr -B hrr-build \ + -DROCM_PATH=$ROCM_PATH \ + -DCMAKE_PREFIX_PATH=$ROCM_PATH \ + -DHRR_BUILD_PLAYBACK=ON -DHRR_BUILD_TESTS=ON \ + -DHRR_CLR_LIB=$PWD/build/hipamd/lib \ + -DCMAKE_BUILD_TYPE=Release +cmake --build hrr-build -j"$(nproc)" +ctest --test-dir hrr-build --output-on-failure +``` + +CMake option `-DHRR_CLR_LIB=` (or env `HRR_CLR_LIB`) wires +`LD_LIBRARY_PATH` for capture subprocesses and sets RUNPATH on test binaries. +CI builds `amdhip64` before configuring HRR tests. + ### Deploy ```bash # Make the freshly built capture runtime win over any system ROCm copy at run time diff --git a/projects/hrr/README.md b/projects/hrr/README.md index 2abb0a1c6d9d..8bb484545b95 100644 --- a/projects/hrr/README.md +++ b/projects/hrr/README.md @@ -23,6 +23,41 @@ export LD_LIBRARY_PATH=/hipamd/lib:$LD_LIBRARY_PATH HIP_HRR_CAPTURE_OUTPUT=./out.hrr ./my_hip_app ``` +**Capture/playback pairing:** Capture is compiled into `libamdhip64` (CLR). Playback +and the archive reader live in `projects/hrr`. Both must come from the **same commit** — +mixing a prebuilt ROCm SDK `libamdhip64` with an in-tree `hrr-playback` produces +`payload too small` replay failures. Point `LD_LIBRARY_PATH` at your CLR build's +`hipamd/lib` for capture, replay, and tests. + +## Build and test (integration) + +Integration tests require a capture-enabled `libamdhip64` built from the same tree: + +```bash +export ROCM_PATH="${ROCM_PATH:-/opt/rocm}" + +# 1. Build capture runtime +cmake -S projects/clr -B build/clr -GNinja \ + -DHIP_COMMON_DIR=projects/hip \ + -DROCM_PATH="$ROCM_PATH" \ + -DCLR_BUILD_HIP=ON -DCLR_BUILD_OCL=OFF -DHIP_PLATFORM=amd \ + -DCMAKE_BUILD_TYPE=Release +ninja -C build/clr amdhip64 + +# 2. Build and run HRR tests (unit + integration) +cmake -S projects/hrr -B build/hrr \ + -DROCM_PATH="$ROCM_PATH" \ + -DCMAKE_PREFIX_PATH="$ROCM_PATH" \ + -DHRR_BUILD_PLAYBACK=ON -DHRR_BUILD_TESTS=ON \ + -DHRR_CLR_LIB="$PWD/build/clr/hipamd/lib" \ + -DCMAKE_BUILD_TYPE=Release +cmake --build build/hrr -j"$(nproc)" +ctest --test-dir build/hrr --output-on-failure +``` + +`HRR_CLR_LIB` may also be exported in the environment before configuring; CMake +auto-detects `build/clr/hipamd/lib` when present. + ## Build `hrr-playback` `hrr-playback` builds standalone from `projects/hrr` against a capture-enabled diff --git a/projects/hrr/cmake/HrrCaptureLib.cmake b/projects/hrr/cmake/HrrCaptureLib.cmake new file mode 100644 index 000000000000..48627dabd359 --- /dev/null +++ b/projects/hrr/cmake/HrrCaptureLib.cmake @@ -0,0 +1,71 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT + +# Resolve HRR_CLR_LIB: directory containing capture-enabled libamdhip64 (hipamd/lib). +# +# Capture lives in projects/clr and is compiled into libamdhip64. Playback and the +# archive reader live in projects/hrr. Integration tests must load the same-commit +# capture library for both capture subprocesses and hrr-playback replay — a prebuilt +# ROCm SDK libamdhip64 often writes older wire-format payloads and fails replay. +# +# Set explicitly: +# cmake ... -DHRR_CLR_LIB=/path/to/clr/build/hipamd/lib +# or export HRR_CLR_LIB before configuring. + +function(hrr_resolve_capture_lib out_var) + set(_lib_dir "") + if(DEFINED HRR_CLR_LIB AND HRR_CLR_LIB) + set(_lib_dir "${HRR_CLR_LIB}") + elseif(DEFINED ENV{HRR_CLR_LIB} AND NOT "$ENV{HRR_CLR_LIB}" STREQUAL "") + set(_lib_dir "$ENV{HRR_CLR_LIB}") + else() + # Common in-tree CLR build locations (rocm-systems superbuild / sibling trees). + get_filename_component(_hrr_root "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE) + get_filename_component(_repo_root "${_hrr_root}/.." ABSOLUTE) + foreach(_candidate + "${_repo_root}/build/clr/hipamd/lib" + "${_repo_root}/build-rocr/clr/hipamd/lib" + "${_repo_root}/../build/clr/hipamd/lib" + "${_repo_root}/../hrr-testing/build/clr/hipamd/lib") + if(EXISTS "${_candidate}/libamdhip64.so" + OR EXISTS "${_candidate}/libamdhip64.so.7" + OR EXISTS "${_candidate}/amdhip64.dll") + set(_lib_dir "${_candidate}") + break() + endif() + endforeach() + endif() + + if(_lib_dir) + get_filename_component(_lib_dir "${_lib_dir}" ABSOLUTE) + if(NOT EXISTS "${_lib_dir}/libamdhip64.so" + AND NOT EXISTS "${_lib_dir}/libamdhip64.so.7" + AND NOT EXISTS "${_lib_dir}/amdhip64.dll") + message(FATAL_ERROR + "HRR_CLR_LIB=${_lib_dir} does not contain libamdhip64. " + "Build capture-enabled amdhip64 first:\n" + " cmake -S projects/clr -B build/clr -GNinja " + "-DHIP_COMMON_DIR=projects/hip -DROCM_PATH=\$ROCM_PATH " + "-DCLR_BUILD_HIP=ON -DCLR_BUILD_OCL=OFF -DHIP_PLATFORM=amd\n" + " ninja -C build/clr amdhip64") + endif() + endif() + + set(${out_var} "${_lib_dir}" PARENT_SCOPE) +endfunction() + +# Apply capture-lib RUNPATH to HRR executables (capture subprocesses inherit via +# LD_LIBRARY_PATH set in the test driver; RUNPATH covers the top-level binary). +function(hrr_apply_capture_lib_rpath lib_dir) + if(NOT lib_dir) + return() + endif() + foreach(_target ${ARGN}) + if(TARGET ${_target}) + set_target_properties(${_target} PROPERTIES + BUILD_RPATH "${lib_dir}" + INSTALL_RPATH "${lib_dir}") + endif() + endforeach() +endfunction() diff --git a/projects/hrr/tests/integration/CMakeLists.txt b/projects/hrr/tests/integration/CMakeLists.txt index 2c7802703c3f..ef7565320a9d 100644 --- a/projects/hrr/tests/integration/CMakeLists.txt +++ b/projects/hrr/tests/integration/CMakeLists.txt @@ -2,6 +2,8 @@ # # SPDX-License-Identifier: MIT +include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/HrrCaptureLib.cmake") + # HRR GPU capture/replay integration tests. # # hrr_roundtrip_test.cc is the driver: it sets HIP_HRR_CAPTURE_OUTPUT, spawns the @@ -84,6 +86,21 @@ if(NOT DEFINED HRR_RAW_TRACE_EXE) endif() endif() +# Capture-enabled libamdhip64 must match this branch's wire format. Fail at +# configure time rather than at replay with opaque payload-size errors. +hrr_resolve_capture_lib(HRR_CAPTURE_LIB_DIR) +if(NOT HRR_CAPTURE_LIB_DIR) + message(FATAL_ERROR + "HRR integration tests require capture-enabled libamdhip64 from the same tree.\n" + "Build amdhip64, then reconfigure with -DHRR_CLR_LIB=/hipamd/lib:\n" + " cmake -S projects/clr -B build/clr -GNinja " + "-DHIP_COMMON_DIR=projects/hip -DROCM_PATH=\$ROCM_PATH " + "-DCLR_BUILD_HIP=ON -DCLR_BUILD_OCL=OFF -DHIP_PLATFORM=amd\n" + " ninja -C build/clr amdhip64\n" + " cmake ... -DHRR_CLR_LIB=\$PWD/build/clr/hipamd/lib") +endif() +message(STATUS "HRR capture lib: ${HRR_CAPTURE_LIB_DIR}") + target_compile_definitions(hrr-integration-tests PRIVATE HRR_API_ARGS_IMPLEMENTATION __HIP_PLATFORM_AMD__ @@ -91,9 +108,16 @@ target_compile_definitions(hrr-integration-tests PRIVATE HRR_PLAYBACK_EXE="$" HRR_RAW_TRACE_EXE="${HRR_RAW_TRACE_EXE}" ROCM_BIN_PATH="${ROCM_PATH}/bin" + HRR_CLR_LIB="${HRR_CAPTURE_LIB_DIR}" ) +hrr_apply_capture_lib_rpath("${HRR_CAPTURE_LIB_DIR}" hrr-integration-tests hrr-playback) + # The integration tests spawn hrr-playback; make sure it is built first. add_dependencies(hrr-integration-tests hrr-playback) add_test(NAME hrr-integration-tests COMMAND hrr-integration-tests) +if(CMAKE_HOST_UNIX) + set_tests_properties(hrr-integration-tests PROPERTIES + ENVIRONMENT "LD_LIBRARY_PATH=${HRR_CAPTURE_LIB_DIR}") +endif() diff --git a/projects/hrr/tests/integration/hrr_roundtrip_test.cc b/projects/hrr/tests/integration/hrr_roundtrip_test.cc index ecf5e883e914..d1fbbd933024 100644 --- a/projects/hrr/tests/integration/hrr_roundtrip_test.cc +++ b/projects/hrr/tests/integration/hrr_roundtrip_test.cc @@ -27,8 +27,15 @@ * HRR_TEST_EXE and HRR_PLAYBACK_EXE are required; CMakeLists.txt fails at * configure time if HRR_PLAYBACK_EXE is not found. Pass -DHRR_PLAYBACK_EXE= * if hrr-playback is not installed under CMAKE_INSTALL_PREFIX or ROCM_PATH. + * + * HRR_CLR_LIB (hipamd/lib from a same-commit CLR build) is injected by CMake so + * capture subprocesses and hrr-playback load matching capture-enabled libamdhip64. */ +#ifndef HRR_CLR_LIB +#define HRR_CLR_LIB "" +#endif + #include "hrr_test_common.hh" #include "hrr_test_process.hh" #include @@ -55,14 +62,20 @@ static constexpr char kPathSep = ';'; static constexpr char kPathSep = ':'; #endif -// Set PATH so the subprocess can find the ROCm runtime binaries. +// Set PATH and (on Linux) LD_LIBRARY_PATH so capture/replay subprocesses load +// capture-enabled libamdhip64 from the same commit as projects/hrr playback. // On Windows: DLLs are found via PATH. -// On Linux: fork() inherits LD_LIBRARY_PATH from the parent automatically; -// no explicit setEnv needed. -static void set_proc_search_path(hrr::test::SpawnProc& proc) { +static void set_proc_runtime_env(hrr::test::SpawnProc& proc) { const char* cur_path = getenv("PATH"); proc.setEnv("PATH", std::string(ROCM_BIN_PATH) + kPathSep + (cur_path ? cur_path : "")); +#if !defined(_WIN32) + if (HRR_CLR_LIB[0] != '\0') { + const char* cur_ld = getenv("LD_LIBRARY_PATH"); + std::string ld = std::string(HRR_CLR_LIB) + kPathSep + (cur_ld ? cur_ld : ""); + proc.setEnv("LD_LIBRARY_PATH", ld); + } +#endif } // RAII guard: removes a directory tree on scope exit (even on REQUIRE failure). @@ -218,7 +231,7 @@ static void hrr_run_playback(const fs::path& cap_path, const std::string& extra_args = "", bool require_d2h = true) { hrr::test::SpawnProc proc(HRR_PLAYBACK_EXE, /*capture_stdout=*/true); - set_proc_search_path(proc); + set_proc_runtime_env(proc); // On Windows, wrap the path in quotes so CreateProcess handles spaces. // On Linux, SpawnProc uses execvp (no shell), so quotes are literal characters // in the argument — pass the raw path without quoting. @@ -289,7 +302,7 @@ HRR_TEST_CASE(Unit_HRR_CaptureReplayRoundtrip) { // Prepend ROCm bin to PATH so the subprocess finds amdhip64_7.dll. // SpawnProc replaces PATH entirely, so we reconstruct the full value. { - set_proc_search_path(proc); + set_proc_runtime_env(proc); } int ret = proc.run("\"Unit_HRR_GpuWorkload_Direct\""); INFO("Capture subprocess exit code: " << ret); @@ -350,7 +363,7 @@ HRR_TEST_CASE(Unit_HRR_AllApisRoundtrip) { hrr::test::SpawnProc proc(HRR_TEST_EXE); proc.setEnv("HIP_HRR_CAPTURE_OUTPUT", cap.path.string()); { - set_proc_search_path(proc); + set_proc_runtime_env(proc); } int ret = proc.run("\"Unit_HRR_AllApis_Direct\""); INFO("AllApis capture subprocess exit code: " << ret); @@ -405,7 +418,7 @@ HRR_TEST_CASE(Unit_HRR_HostMemRoundtrip) { hrr::test::SpawnProc proc(HRR_TEST_EXE); proc.setEnv("HIP_HRR_CAPTURE_OUTPUT", cap.path.string()); { - set_proc_search_path(proc); + set_proc_runtime_env(proc); } int ret = proc.run("\"Unit_HRR_HostMemWorkload_Direct\""); INFO("HostMem capture subprocess exit code: " << ret); @@ -463,7 +476,7 @@ HRR_TEST_CASE(Unit_HRR_GraphRoundtrip) { // Prepend ROCm bin to PATH so the subprocess finds amdhip64_7.dll. // SpawnProc replaces PATH entirely, so we reconstruct the full value. { - set_proc_search_path(proc); + set_proc_runtime_env(proc); } int ret = proc.run("\"Unit_HRR_GraphWorkload_Direct\""); INFO("Graph capture subprocess exit code: " << ret); @@ -514,7 +527,7 @@ HRR_TEST_CASE(Unit_HRR_StressApisRoundtrip) { hrr::test::SpawnProc proc(HRR_TEST_EXE); proc.setEnv("HIP_HRR_CAPTURE_OUTPUT", cap.path.string()); { - set_proc_search_path(proc); + set_proc_runtime_env(proc); } int ret = proc.run("\"Unit_HRR_StressApis_Direct\""); INFO("Stress capture subprocess exit code: " << ret); @@ -565,7 +578,7 @@ static void hrr_run_roundtrip(const std::string& direct_case, bool require_d2h = true) { { hrr::test::SpawnProc proc(HRR_TEST_EXE); proc.setEnv("HIP_HRR_CAPTURE_OUTPUT", cap_path.string()); - { set_proc_search_path(proc); } + { set_proc_runtime_env(proc); } int ret = proc.run("\"" + direct_case + "\""); INFO("Capture exit: " << ret); REQUIRE(ret == 0); } fs::path archive_path = hrr_single_process_archive(cap_path); @@ -625,7 +638,7 @@ static void hrr_capture_direct(const std::string& direct_case, size_t min_events = 5) { { hrr::test::SpawnProc proc(HRR_TEST_EXE); proc.setEnv("HIP_HRR_CAPTURE_OUTPUT", cap_path.string()); - { set_proc_search_path(proc); } + { set_proc_runtime_env(proc); } int ret = proc.run("\"" + direct_case + "\""); INFO("Capture exit: " << ret); REQUIRE(ret == 0); } fs::path archive_path = hrr_single_process_archive(cap_path); @@ -643,7 +656,7 @@ static std::pair hrr_playback_env( const std::vector>& env, const std::string& extra_args = "") { hrr::test::SpawnProc proc(HRR_PLAYBACK_EXE, /*capture_stdout=*/true); - set_proc_search_path(proc); + set_proc_runtime_env(proc); for (const auto& kv : env) proc.setEnv(kv.first, kv.second); #ifdef _WIN32 std::string path_arg = "\"" + cap_path.string() + "\""; @@ -1021,7 +1034,7 @@ HRR_TEST_CASE(Unit_HRR_MetadataManifest) { { hrr::test::SpawnProc proc(HRR_TEST_EXE); proc.setEnv("HIP_HRR_CAPTURE_OUTPUT", cap.path.string()); - set_proc_search_path(proc); + set_proc_runtime_env(proc); int ret = proc.run("\"Unit_HRR_DeviceInfo_Direct\""); INFO("Metadata capture subprocess exit code: " << ret); REQUIRE(ret == 0); @@ -1093,7 +1106,7 @@ HRR_TEST_CASE(Unit_HRR_OccupancyRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_occupancy"}; { hrr::test::SpawnProc proc(HRR_TEST_EXE); proc.setEnv("HIP_HRR_CAPTURE_OUTPUT", cap.path.string()); - { set_proc_search_path(proc); } + { set_proc_runtime_env(proc); } int ret = proc.run("\"Unit_HRR_Occupancy_Direct\""); INFO("Capture exit: " << ret); REQUIRE(ret == 0); } fs::path archive_path = hrr_single_process_archive(cap.path); @@ -1333,7 +1346,7 @@ HRR_TEST_CASE(Unit_HRR_MultiThreadRoundtrip) { hrr::test::SpawnProc proc(raw_trace_exe); proc.setEnv("HIP_HRR_CAPTURE_OUTPUT", cap.path.string()); { - set_proc_search_path(proc); + set_proc_runtime_env(proc); } int ret = proc.run(""); INFO("hip_raw_trace capture exit code: " << ret); @@ -1366,7 +1379,7 @@ HRR_TEST_CASE(Unit_HRR_MultiThreadRoundtrip) { // ------------------------------------------------------------------------- auto run_mt_playback = [&](const std::string& extra_args) { hrr::test::SpawnProc proc(HRR_PLAYBACK_EXE, /*capture_stdout=*/true); - set_proc_search_path(proc); + set_proc_runtime_env(proc); #ifdef _WIN32 std::string mt_path_arg = "\"" + cap.path.string() + "\""; #else @@ -1465,7 +1478,7 @@ static std::string build_replacement_co(const fs::path& dir) { static std::pair run_playback_raw(const fs::path& cap_path, const std::string& extra_args) { hrr::test::SpawnProc proc(HRR_PLAYBACK_EXE, /*capture_stdout=*/true); - set_proc_search_path(proc); + set_proc_runtime_env(proc); std::string path_arg = cap_path.string(); int ret = proc.run(path_arg + (extra_args.empty() ? "" : " " + extra_args)); return {ret, proc.getOutput()}; @@ -1505,7 +1518,7 @@ HRR_TEST_CASE(Unit_HRR_ReplaceKernelRoundtrip) { { hrr::test::SpawnProc proc(HRR_TEST_EXE); proc.setEnv("HIP_HRR_CAPTURE_OUTPUT", cap.path.string()); - set_proc_search_path(proc); + set_proc_runtime_env(proc); int ret = proc.run("\"Unit_HRR_GpuWorkload_Direct\""); INFO("Capture exit: " << ret); REQUIRE(ret == 0); @@ -1545,7 +1558,7 @@ HRR_TEST_CASE(Unit_HRR_ReplaceKernelMissingCO) { { hrr::test::SpawnProc proc(HRR_TEST_EXE); proc.setEnv("HIP_HRR_CAPTURE_OUTPUT", cap.path.string()); - set_proc_search_path(proc); + set_proc_runtime_env(proc); int ret = proc.run("\"Unit_HRR_GpuWorkload_Direct\""); INFO("Capture exit: " << ret); REQUIRE(ret == 0); @@ -1579,7 +1592,7 @@ HRR_TEST_CASE(Unit_HRR_ReplaceKernelBadSpec) { { hrr::test::SpawnProc proc(HRR_TEST_EXE); proc.setEnv("HIP_HRR_CAPTURE_OUTPUT", cap.path.string()); - set_proc_search_path(proc); + set_proc_runtime_env(proc); int ret = proc.run("\"Unit_HRR_GpuWorkload_Direct\""); REQUIRE(ret == 0); } From 0d07b58a44aa2922741778e3c5327653d9229e73 Mon Sep 17 00:00:00 2001 From: Daniel Olsson Date: Mon, 31 Aug 2026 02:47:28 -0500 Subject: [PATCH 05/10] Revert "Wire HRR_CLR_LIB for integration tests and CI" This reverts commit 9f80886f8a295386b24764d89858f9ff0046334a. --- .github/workflows/hrr-integration-tests.yml | 129 ------------------ .../hip-tests/catch/unit/hrr/CMakeLists.txt | 13 -- .../catch/unit/hrr/hrr_capture_smoke_test.cc | 15 +- projects/hrr/DESIGN.md | 22 --- projects/hrr/README.md | 35 ----- projects/hrr/cmake/HrrCaptureLib.cmake | 71 ---------- projects/hrr/tests/integration/CMakeLists.txt | 24 ---- .../tests/integration/hrr_roundtrip_test.cc | 55 +++----- 8 files changed, 23 insertions(+), 341 deletions(-) delete mode 100644 .github/workflows/hrr-integration-tests.yml delete mode 100644 projects/hrr/cmake/HrrCaptureLib.cmake diff --git a/.github/workflows/hrr-integration-tests.yml b/.github/workflows/hrr-integration-tests.yml deleted file mode 100644 index 984dd516fb90..000000000000 --- a/.github/workflows/hrr-integration-tests.yml +++ /dev/null @@ -1,129 +0,0 @@ -# HRR integration tests: build capture-enabled amdhip64 (CLR) before projects/hrr -# playback/tests so capture and replay share the same wire-format commit. -name: HRR Integration Tests - -on: - pull_request: - paths: - - "projects/hrr/**" - - "projects/clr/hipamd/src/hrr/**" - - "projects/hip/**" - - ".github/workflows/hrr-integration-tests.yml" - push: - branches: - - develop - paths: - - "projects/hrr/**" - - "projects/clr/hipamd/src/hrr/**" - - "projects/hip/**" - - ".github/workflows/hrr-integration-tests.yml" - workflow_dispatch: - -permissions: - contents: read - -concurrency: - group: hrr-integration-${{ github.workflow }}-${{ github.event.number || github.sha }} - cancel-in-progress: true - -jobs: - hrr-integration-setup: - name: Setup - runs-on: ubuntu-24.04 - outputs: - should_run: ${{ steps.check_paths.outputs.should_run }} - steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - fetch-depth: 2 - - - name: Check if relevant paths changed - id: check_paths - run: | - SHOULD_RUN=false - if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then - SHOULD_RUN=true - elif [ "${{ github.event_name }}" = "push" ]; then - SHOULD_RUN=true - else - SHOULD_RUN=true - fi - echo "should_run=${SHOULD_RUN}" >> "${GITHUB_OUTPUT}" - - hrr-integration-tests: - name: Build CLR + HRR tests - needs: hrr-integration-setup - if: needs.hrr-integration-setup.outputs.should_run == 'true' - runs-on: azure-linux-scale-rocm - env: - ROCM_PATH: /opt/rocm - BUILD_DIR: ${{ github.workspace }}/build - REPO: ${{ github.workspace }}/rocm-systems - steps: - - name: Checkout rocm-systems - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - path: rocm-systems - sparse-checkout: | - projects/clr - projects/hip - projects/hrr - - - name: Install build dependencies - run: | - sudo apt-get update -q - sudo apt-get install -y --no-install-recommends \ - cmake ninja-build libnuma-dev libelf-dev python3-pip - pip3 install --break-system-packages CppHeaderParser || pip3 install CppHeaderParser - - - name: Build capture-enabled amdhip64 (CLR) - run: | - cmake -B "${BUILD_DIR}/clr" -G Ninja \ - -DCMAKE_BUILD_TYPE=Release \ - -DHIP_PLATFORM=amd \ - -DCLR_BUILD_HIP=ON \ - -DCLR_BUILD_OCL=OFF \ - -DHIP_COMMON_DIR="${REPO}/projects/hip" \ - -DROCM_PATH="${ROCM_PATH}" \ - -DCMAKE_PREFIX_PATH="${ROCM_PATH}" \ - "${REPO}/projects/clr" - cmake --build "${BUILD_DIR}/clr" --target amdhip64 --parallel - - - name: Configure HRR tests - run: | - cmake -B "${BUILD_DIR}/hrr" -G Ninja \ - -DCMAKE_BUILD_TYPE=Release \ - -DROCM_PATH="${ROCM_PATH}" \ - -DCMAKE_PREFIX_PATH="${ROCM_PATH}" \ - -DHRR_BUILD_PLAYBACK=ON \ - -DHRR_BUILD_TESTS=ON \ - -DHRR_BUILD_INTEGRATION_TESTS=ON \ - -DHRR_CLR_LIB="${BUILD_DIR}/clr/hipamd/lib" \ - "${REPO}/projects/hrr" - - - name: Build HRR tests - run: cmake --build "${BUILD_DIR}/hrr" --parallel - - - name: Run HRR unit tests - run: ctest --test-dir "${BUILD_DIR}/hrr" -R hrr-unit-tests --output-on-failure - - - name: Run HRR integration tests - env: - LD_LIBRARY_PATH: ${{ env.BUILD_DIR }}/clr/hipamd/lib - run: ctest --test-dir "${BUILD_DIR}/hrr" -R hrr-integration-tests --output-on-failure - - hrr-integration-summary: - name: Summary - if: always() - needs: [hrr-integration-setup, hrr-integration-tests] - runs-on: ubuntu-24.04 - steps: - - name: Check results - run: | - echo '${{ toJson(needs) }}' - FAILED="$(echo '${{ toJson(needs) }}' \ - | jq -r 'map_values(select(.result != "success" and .result != "skipped")) | keys | join(",")')" - if [ -n "${FAILED}" ]; then - echo "Failed jobs: ${FAILED}" - exit 1 - fi diff --git a/projects/hip-tests/catch/unit/hrr/CMakeLists.txt b/projects/hip-tests/catch/unit/hrr/CMakeLists.txt index 2331067c286e..ef37e51ede58 100644 --- a/projects/hip-tests/catch/unit/hrr/CMakeLists.txt +++ b/projects/hip-tests/catch/unit/hrr/CMakeLists.txt @@ -5,8 +5,6 @@ # Minimal HRR capture sentinel for hip-tests. # Full HRR unit and integration tests live under projects/hrr/tests. -include("${CMAKE_CURRENT_SOURCE_DIR}/../../../../hrr/cmake/HrrCaptureLib.cmake") - set(TEST_SRC hrr_capture_smoke_test.cc ) @@ -22,19 +20,8 @@ hip_add_exe_to_target(NAME HrrTest # ROCM_BIN_PATH — prepended to PATH in the child so it finds amdhip64_7.dll # on Windows and the ROCm bin directory in packaged runs. if(HIP_PLATFORM STREQUAL "amd") - hrr_resolve_capture_lib(HRR_CAPTURE_LIB_DIR) - if(HRR_CAPTURE_LIB_DIR) - message(STATUS "HRR capture lib (smoke test): ${HRR_CAPTURE_LIB_DIR}") - hrr_apply_capture_lib_rpath("${HRR_CAPTURE_LIB_DIR}" HrrTest) - else() - message(WARNING - "HRR capture smoke test: HRR_CLR_LIB not set — subprocess may load a stale " - "SDK libamdhip64. Build amdhip64 and pass -DHRR_CLR_LIB=/hipamd/lib") - endif() - target_compile_definitions(HrrTest PRIVATE HRR_TEST_EXE="HrrTest" ROCM_BIN_PATH="${ROCM_PATH}/bin" - HRR_CLR_LIB="${HRR_CAPTURE_LIB_DIR}" ) endif() diff --git a/projects/hip-tests/catch/unit/hrr/hrr_capture_smoke_test.cc b/projects/hip-tests/catch/unit/hrr/hrr_capture_smoke_test.cc index 32f399c8ba57..294710e87ac1 100644 --- a/projects/hip-tests/catch/unit/hrr/hrr_capture_smoke_test.cc +++ b/projects/hip-tests/catch/unit/hrr/hrr_capture_smoke_test.cc @@ -24,27 +24,16 @@ namespace fs = std::filesystem; -#ifndef HRR_CLR_LIB -#define HRR_CLR_LIB "" -#endif - #ifdef _WIN32 static constexpr char kPathSep = ';'; #else static constexpr char kPathSep = ':'; #endif -static void set_proc_runtime_env(hip::SpawnProc& proc) { +static void set_proc_search_path(hip::SpawnProc& proc) { const char* cur_path = getenv("PATH"); proc.setEnv("PATH", std::string(ROCM_BIN_PATH) + kPathSep + (cur_path ? cur_path : "")); -#if !defined(_WIN32) - if (HRR_CLR_LIB[0] != '\0') { - const char* cur_ld = getenv("LD_LIBRARY_PATH"); - std::string ld = std::string(HRR_CLR_LIB) + kPathSep + (cur_ld ? cur_ld : ""); - proc.setEnv("LD_LIBRARY_PATH", ld); - } -#endif } struct ScopedDir { @@ -78,7 +67,7 @@ HIP_TEST_CASE(Unit_HRR_CaptureSmoke) { hip::SpawnProc proc(HRR_TEST_EXE); proc.setEnv("HIP_HRR_CAPTURE_OUTPUT", cap.path.string()); - set_proc_runtime_env(proc); + set_proc_search_path(proc); int ret = proc.run("\"Unit_HRR_CaptureSmoke_Direct\""); INFO("Capture subprocess exit code: " << ret); REQUIRE(ret == 0); diff --git a/projects/hrr/DESIGN.md b/projects/hrr/DESIGN.md index ac4bf6ab8df8..bf79baa5f09d 100644 --- a/projects/hrr/DESIGN.md +++ b/projects/hrr/DESIGN.md @@ -703,28 +703,6 @@ cmake --build hrr-build --target hrr-playback -j"$(nproc)" # installs to /bin/hrr-playback) ``` -### Integration tests (GPU capture/replay round-trip) - -Capture (`libamdhip64`) and playback (`hrr-playback` / reader) **must be built from -the same commit**. A prebuilt SDK `libamdhip64` often writes compact wire-format -payloads that the in-tree reader rejects (`payload too small`). - -```bash -# After building amdhip64 (see above): -cmake -S projects/hrr -B hrr-build \ - -DROCM_PATH=$ROCM_PATH \ - -DCMAKE_PREFIX_PATH=$ROCM_PATH \ - -DHRR_BUILD_PLAYBACK=ON -DHRR_BUILD_TESTS=ON \ - -DHRR_CLR_LIB=$PWD/build/hipamd/lib \ - -DCMAKE_BUILD_TYPE=Release -cmake --build hrr-build -j"$(nproc)" -ctest --test-dir hrr-build --output-on-failure -``` - -CMake option `-DHRR_CLR_LIB=` (or env `HRR_CLR_LIB`) wires -`LD_LIBRARY_PATH` for capture subprocesses and sets RUNPATH on test binaries. -CI builds `amdhip64` before configuring HRR tests. - ### Deploy ```bash # Make the freshly built capture runtime win over any system ROCm copy at run time diff --git a/projects/hrr/README.md b/projects/hrr/README.md index 8bb484545b95..2abb0a1c6d9d 100644 --- a/projects/hrr/README.md +++ b/projects/hrr/README.md @@ -23,41 +23,6 @@ export LD_LIBRARY_PATH=/hipamd/lib:$LD_LIBRARY_PATH HIP_HRR_CAPTURE_OUTPUT=./out.hrr ./my_hip_app ``` -**Capture/playback pairing:** Capture is compiled into `libamdhip64` (CLR). Playback -and the archive reader live in `projects/hrr`. Both must come from the **same commit** — -mixing a prebuilt ROCm SDK `libamdhip64` with an in-tree `hrr-playback` produces -`payload too small` replay failures. Point `LD_LIBRARY_PATH` at your CLR build's -`hipamd/lib` for capture, replay, and tests. - -## Build and test (integration) - -Integration tests require a capture-enabled `libamdhip64` built from the same tree: - -```bash -export ROCM_PATH="${ROCM_PATH:-/opt/rocm}" - -# 1. Build capture runtime -cmake -S projects/clr -B build/clr -GNinja \ - -DHIP_COMMON_DIR=projects/hip \ - -DROCM_PATH="$ROCM_PATH" \ - -DCLR_BUILD_HIP=ON -DCLR_BUILD_OCL=OFF -DHIP_PLATFORM=amd \ - -DCMAKE_BUILD_TYPE=Release -ninja -C build/clr amdhip64 - -# 2. Build and run HRR tests (unit + integration) -cmake -S projects/hrr -B build/hrr \ - -DROCM_PATH="$ROCM_PATH" \ - -DCMAKE_PREFIX_PATH="$ROCM_PATH" \ - -DHRR_BUILD_PLAYBACK=ON -DHRR_BUILD_TESTS=ON \ - -DHRR_CLR_LIB="$PWD/build/clr/hipamd/lib" \ - -DCMAKE_BUILD_TYPE=Release -cmake --build build/hrr -j"$(nproc)" -ctest --test-dir build/hrr --output-on-failure -``` - -`HRR_CLR_LIB` may also be exported in the environment before configuring; CMake -auto-detects `build/clr/hipamd/lib` when present. - ## Build `hrr-playback` `hrr-playback` builds standalone from `projects/hrr` against a capture-enabled diff --git a/projects/hrr/cmake/HrrCaptureLib.cmake b/projects/hrr/cmake/HrrCaptureLib.cmake deleted file mode 100644 index 48627dabd359..000000000000 --- a/projects/hrr/cmake/HrrCaptureLib.cmake +++ /dev/null @@ -1,71 +0,0 @@ -# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. -# -# SPDX-License-Identifier: MIT - -# Resolve HRR_CLR_LIB: directory containing capture-enabled libamdhip64 (hipamd/lib). -# -# Capture lives in projects/clr and is compiled into libamdhip64. Playback and the -# archive reader live in projects/hrr. Integration tests must load the same-commit -# capture library for both capture subprocesses and hrr-playback replay — a prebuilt -# ROCm SDK libamdhip64 often writes older wire-format payloads and fails replay. -# -# Set explicitly: -# cmake ... -DHRR_CLR_LIB=/path/to/clr/build/hipamd/lib -# or export HRR_CLR_LIB before configuring. - -function(hrr_resolve_capture_lib out_var) - set(_lib_dir "") - if(DEFINED HRR_CLR_LIB AND HRR_CLR_LIB) - set(_lib_dir "${HRR_CLR_LIB}") - elseif(DEFINED ENV{HRR_CLR_LIB} AND NOT "$ENV{HRR_CLR_LIB}" STREQUAL "") - set(_lib_dir "$ENV{HRR_CLR_LIB}") - else() - # Common in-tree CLR build locations (rocm-systems superbuild / sibling trees). - get_filename_component(_hrr_root "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE) - get_filename_component(_repo_root "${_hrr_root}/.." ABSOLUTE) - foreach(_candidate - "${_repo_root}/build/clr/hipamd/lib" - "${_repo_root}/build-rocr/clr/hipamd/lib" - "${_repo_root}/../build/clr/hipamd/lib" - "${_repo_root}/../hrr-testing/build/clr/hipamd/lib") - if(EXISTS "${_candidate}/libamdhip64.so" - OR EXISTS "${_candidate}/libamdhip64.so.7" - OR EXISTS "${_candidate}/amdhip64.dll") - set(_lib_dir "${_candidate}") - break() - endif() - endforeach() - endif() - - if(_lib_dir) - get_filename_component(_lib_dir "${_lib_dir}" ABSOLUTE) - if(NOT EXISTS "${_lib_dir}/libamdhip64.so" - AND NOT EXISTS "${_lib_dir}/libamdhip64.so.7" - AND NOT EXISTS "${_lib_dir}/amdhip64.dll") - message(FATAL_ERROR - "HRR_CLR_LIB=${_lib_dir} does not contain libamdhip64. " - "Build capture-enabled amdhip64 first:\n" - " cmake -S projects/clr -B build/clr -GNinja " - "-DHIP_COMMON_DIR=projects/hip -DROCM_PATH=\$ROCM_PATH " - "-DCLR_BUILD_HIP=ON -DCLR_BUILD_OCL=OFF -DHIP_PLATFORM=amd\n" - " ninja -C build/clr amdhip64") - endif() - endif() - - set(${out_var} "${_lib_dir}" PARENT_SCOPE) -endfunction() - -# Apply capture-lib RUNPATH to HRR executables (capture subprocesses inherit via -# LD_LIBRARY_PATH set in the test driver; RUNPATH covers the top-level binary). -function(hrr_apply_capture_lib_rpath lib_dir) - if(NOT lib_dir) - return() - endif() - foreach(_target ${ARGN}) - if(TARGET ${_target}) - set_target_properties(${_target} PROPERTIES - BUILD_RPATH "${lib_dir}" - INSTALL_RPATH "${lib_dir}") - endif() - endforeach() -endfunction() diff --git a/projects/hrr/tests/integration/CMakeLists.txt b/projects/hrr/tests/integration/CMakeLists.txt index ef7565320a9d..2c7802703c3f 100644 --- a/projects/hrr/tests/integration/CMakeLists.txt +++ b/projects/hrr/tests/integration/CMakeLists.txt @@ -2,8 +2,6 @@ # # SPDX-License-Identifier: MIT -include("${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/HrrCaptureLib.cmake") - # HRR GPU capture/replay integration tests. # # hrr_roundtrip_test.cc is the driver: it sets HIP_HRR_CAPTURE_OUTPUT, spawns the @@ -86,21 +84,6 @@ if(NOT DEFINED HRR_RAW_TRACE_EXE) endif() endif() -# Capture-enabled libamdhip64 must match this branch's wire format. Fail at -# configure time rather than at replay with opaque payload-size errors. -hrr_resolve_capture_lib(HRR_CAPTURE_LIB_DIR) -if(NOT HRR_CAPTURE_LIB_DIR) - message(FATAL_ERROR - "HRR integration tests require capture-enabled libamdhip64 from the same tree.\n" - "Build amdhip64, then reconfigure with -DHRR_CLR_LIB=/hipamd/lib:\n" - " cmake -S projects/clr -B build/clr -GNinja " - "-DHIP_COMMON_DIR=projects/hip -DROCM_PATH=\$ROCM_PATH " - "-DCLR_BUILD_HIP=ON -DCLR_BUILD_OCL=OFF -DHIP_PLATFORM=amd\n" - " ninja -C build/clr amdhip64\n" - " cmake ... -DHRR_CLR_LIB=\$PWD/build/clr/hipamd/lib") -endif() -message(STATUS "HRR capture lib: ${HRR_CAPTURE_LIB_DIR}") - target_compile_definitions(hrr-integration-tests PRIVATE HRR_API_ARGS_IMPLEMENTATION __HIP_PLATFORM_AMD__ @@ -108,16 +91,9 @@ target_compile_definitions(hrr-integration-tests PRIVATE HRR_PLAYBACK_EXE="$" HRR_RAW_TRACE_EXE="${HRR_RAW_TRACE_EXE}" ROCM_BIN_PATH="${ROCM_PATH}/bin" - HRR_CLR_LIB="${HRR_CAPTURE_LIB_DIR}" ) -hrr_apply_capture_lib_rpath("${HRR_CAPTURE_LIB_DIR}" hrr-integration-tests hrr-playback) - # The integration tests spawn hrr-playback; make sure it is built first. add_dependencies(hrr-integration-tests hrr-playback) add_test(NAME hrr-integration-tests COMMAND hrr-integration-tests) -if(CMAKE_HOST_UNIX) - set_tests_properties(hrr-integration-tests PROPERTIES - ENVIRONMENT "LD_LIBRARY_PATH=${HRR_CAPTURE_LIB_DIR}") -endif() diff --git a/projects/hrr/tests/integration/hrr_roundtrip_test.cc b/projects/hrr/tests/integration/hrr_roundtrip_test.cc index d1fbbd933024..ecf5e883e914 100644 --- a/projects/hrr/tests/integration/hrr_roundtrip_test.cc +++ b/projects/hrr/tests/integration/hrr_roundtrip_test.cc @@ -27,15 +27,8 @@ * HRR_TEST_EXE and HRR_PLAYBACK_EXE are required; CMakeLists.txt fails at * configure time if HRR_PLAYBACK_EXE is not found. Pass -DHRR_PLAYBACK_EXE= * if hrr-playback is not installed under CMAKE_INSTALL_PREFIX or ROCM_PATH. - * - * HRR_CLR_LIB (hipamd/lib from a same-commit CLR build) is injected by CMake so - * capture subprocesses and hrr-playback load matching capture-enabled libamdhip64. */ -#ifndef HRR_CLR_LIB -#define HRR_CLR_LIB "" -#endif - #include "hrr_test_common.hh" #include "hrr_test_process.hh" #include @@ -62,20 +55,14 @@ static constexpr char kPathSep = ';'; static constexpr char kPathSep = ':'; #endif -// Set PATH and (on Linux) LD_LIBRARY_PATH so capture/replay subprocesses load -// capture-enabled libamdhip64 from the same commit as projects/hrr playback. +// Set PATH so the subprocess can find the ROCm runtime binaries. // On Windows: DLLs are found via PATH. -static void set_proc_runtime_env(hrr::test::SpawnProc& proc) { +// On Linux: fork() inherits LD_LIBRARY_PATH from the parent automatically; +// no explicit setEnv needed. +static void set_proc_search_path(hrr::test::SpawnProc& proc) { const char* cur_path = getenv("PATH"); proc.setEnv("PATH", std::string(ROCM_BIN_PATH) + kPathSep + (cur_path ? cur_path : "")); -#if !defined(_WIN32) - if (HRR_CLR_LIB[0] != '\0') { - const char* cur_ld = getenv("LD_LIBRARY_PATH"); - std::string ld = std::string(HRR_CLR_LIB) + kPathSep + (cur_ld ? cur_ld : ""); - proc.setEnv("LD_LIBRARY_PATH", ld); - } -#endif } // RAII guard: removes a directory tree on scope exit (even on REQUIRE failure). @@ -231,7 +218,7 @@ static void hrr_run_playback(const fs::path& cap_path, const std::string& extra_args = "", bool require_d2h = true) { hrr::test::SpawnProc proc(HRR_PLAYBACK_EXE, /*capture_stdout=*/true); - set_proc_runtime_env(proc); + set_proc_search_path(proc); // On Windows, wrap the path in quotes so CreateProcess handles spaces. // On Linux, SpawnProc uses execvp (no shell), so quotes are literal characters // in the argument — pass the raw path without quoting. @@ -302,7 +289,7 @@ HRR_TEST_CASE(Unit_HRR_CaptureReplayRoundtrip) { // Prepend ROCm bin to PATH so the subprocess finds amdhip64_7.dll. // SpawnProc replaces PATH entirely, so we reconstruct the full value. { - set_proc_runtime_env(proc); + set_proc_search_path(proc); } int ret = proc.run("\"Unit_HRR_GpuWorkload_Direct\""); INFO("Capture subprocess exit code: " << ret); @@ -363,7 +350,7 @@ HRR_TEST_CASE(Unit_HRR_AllApisRoundtrip) { hrr::test::SpawnProc proc(HRR_TEST_EXE); proc.setEnv("HIP_HRR_CAPTURE_OUTPUT", cap.path.string()); { - set_proc_runtime_env(proc); + set_proc_search_path(proc); } int ret = proc.run("\"Unit_HRR_AllApis_Direct\""); INFO("AllApis capture subprocess exit code: " << ret); @@ -418,7 +405,7 @@ HRR_TEST_CASE(Unit_HRR_HostMemRoundtrip) { hrr::test::SpawnProc proc(HRR_TEST_EXE); proc.setEnv("HIP_HRR_CAPTURE_OUTPUT", cap.path.string()); { - set_proc_runtime_env(proc); + set_proc_search_path(proc); } int ret = proc.run("\"Unit_HRR_HostMemWorkload_Direct\""); INFO("HostMem capture subprocess exit code: " << ret); @@ -476,7 +463,7 @@ HRR_TEST_CASE(Unit_HRR_GraphRoundtrip) { // Prepend ROCm bin to PATH so the subprocess finds amdhip64_7.dll. // SpawnProc replaces PATH entirely, so we reconstruct the full value. { - set_proc_runtime_env(proc); + set_proc_search_path(proc); } int ret = proc.run("\"Unit_HRR_GraphWorkload_Direct\""); INFO("Graph capture subprocess exit code: " << ret); @@ -527,7 +514,7 @@ HRR_TEST_CASE(Unit_HRR_StressApisRoundtrip) { hrr::test::SpawnProc proc(HRR_TEST_EXE); proc.setEnv("HIP_HRR_CAPTURE_OUTPUT", cap.path.string()); { - set_proc_runtime_env(proc); + set_proc_search_path(proc); } int ret = proc.run("\"Unit_HRR_StressApis_Direct\""); INFO("Stress capture subprocess exit code: " << ret); @@ -578,7 +565,7 @@ static void hrr_run_roundtrip(const std::string& direct_case, bool require_d2h = true) { { hrr::test::SpawnProc proc(HRR_TEST_EXE); proc.setEnv("HIP_HRR_CAPTURE_OUTPUT", cap_path.string()); - { set_proc_runtime_env(proc); } + { set_proc_search_path(proc); } int ret = proc.run("\"" + direct_case + "\""); INFO("Capture exit: " << ret); REQUIRE(ret == 0); } fs::path archive_path = hrr_single_process_archive(cap_path); @@ -638,7 +625,7 @@ static void hrr_capture_direct(const std::string& direct_case, size_t min_events = 5) { { hrr::test::SpawnProc proc(HRR_TEST_EXE); proc.setEnv("HIP_HRR_CAPTURE_OUTPUT", cap_path.string()); - { set_proc_runtime_env(proc); } + { set_proc_search_path(proc); } int ret = proc.run("\"" + direct_case + "\""); INFO("Capture exit: " << ret); REQUIRE(ret == 0); } fs::path archive_path = hrr_single_process_archive(cap_path); @@ -656,7 +643,7 @@ static std::pair hrr_playback_env( const std::vector>& env, const std::string& extra_args = "") { hrr::test::SpawnProc proc(HRR_PLAYBACK_EXE, /*capture_stdout=*/true); - set_proc_runtime_env(proc); + set_proc_search_path(proc); for (const auto& kv : env) proc.setEnv(kv.first, kv.second); #ifdef _WIN32 std::string path_arg = "\"" + cap_path.string() + "\""; @@ -1034,7 +1021,7 @@ HRR_TEST_CASE(Unit_HRR_MetadataManifest) { { hrr::test::SpawnProc proc(HRR_TEST_EXE); proc.setEnv("HIP_HRR_CAPTURE_OUTPUT", cap.path.string()); - set_proc_runtime_env(proc); + set_proc_search_path(proc); int ret = proc.run("\"Unit_HRR_DeviceInfo_Direct\""); INFO("Metadata capture subprocess exit code: " << ret); REQUIRE(ret == 0); @@ -1106,7 +1093,7 @@ HRR_TEST_CASE(Unit_HRR_OccupancyRoundtrip) { ScopedDir cap{fs::temp_directory_path() / "hrr_roundtrip_occupancy"}; { hrr::test::SpawnProc proc(HRR_TEST_EXE); proc.setEnv("HIP_HRR_CAPTURE_OUTPUT", cap.path.string()); - { set_proc_runtime_env(proc); } + { set_proc_search_path(proc); } int ret = proc.run("\"Unit_HRR_Occupancy_Direct\""); INFO("Capture exit: " << ret); REQUIRE(ret == 0); } fs::path archive_path = hrr_single_process_archive(cap.path); @@ -1346,7 +1333,7 @@ HRR_TEST_CASE(Unit_HRR_MultiThreadRoundtrip) { hrr::test::SpawnProc proc(raw_trace_exe); proc.setEnv("HIP_HRR_CAPTURE_OUTPUT", cap.path.string()); { - set_proc_runtime_env(proc); + set_proc_search_path(proc); } int ret = proc.run(""); INFO("hip_raw_trace capture exit code: " << ret); @@ -1379,7 +1366,7 @@ HRR_TEST_CASE(Unit_HRR_MultiThreadRoundtrip) { // ------------------------------------------------------------------------- auto run_mt_playback = [&](const std::string& extra_args) { hrr::test::SpawnProc proc(HRR_PLAYBACK_EXE, /*capture_stdout=*/true); - set_proc_runtime_env(proc); + set_proc_search_path(proc); #ifdef _WIN32 std::string mt_path_arg = "\"" + cap.path.string() + "\""; #else @@ -1478,7 +1465,7 @@ static std::string build_replacement_co(const fs::path& dir) { static std::pair run_playback_raw(const fs::path& cap_path, const std::string& extra_args) { hrr::test::SpawnProc proc(HRR_PLAYBACK_EXE, /*capture_stdout=*/true); - set_proc_runtime_env(proc); + set_proc_search_path(proc); std::string path_arg = cap_path.string(); int ret = proc.run(path_arg + (extra_args.empty() ? "" : " " + extra_args)); return {ret, proc.getOutput()}; @@ -1518,7 +1505,7 @@ HRR_TEST_CASE(Unit_HRR_ReplaceKernelRoundtrip) { { hrr::test::SpawnProc proc(HRR_TEST_EXE); proc.setEnv("HIP_HRR_CAPTURE_OUTPUT", cap.path.string()); - set_proc_runtime_env(proc); + set_proc_search_path(proc); int ret = proc.run("\"Unit_HRR_GpuWorkload_Direct\""); INFO("Capture exit: " << ret); REQUIRE(ret == 0); @@ -1558,7 +1545,7 @@ HRR_TEST_CASE(Unit_HRR_ReplaceKernelMissingCO) { { hrr::test::SpawnProc proc(HRR_TEST_EXE); proc.setEnv("HIP_HRR_CAPTURE_OUTPUT", cap.path.string()); - set_proc_runtime_env(proc); + set_proc_search_path(proc); int ret = proc.run("\"Unit_HRR_GpuWorkload_Direct\""); INFO("Capture exit: " << ret); REQUIRE(ret == 0); @@ -1592,7 +1579,7 @@ HRR_TEST_CASE(Unit_HRR_ReplaceKernelBadSpec) { { hrr::test::SpawnProc proc(HRR_TEST_EXE); proc.setEnv("HIP_HRR_CAPTURE_OUTPUT", cap.path.string()); - set_proc_runtime_env(proc); + set_proc_search_path(proc); int ret = proc.run("\"Unit_HRR_GpuWorkload_Direct\""); REQUIRE(ret == 0); } From 185b339e2d5cc61ab3fe0bdcb9ce1f4edbc7c134 Mon Sep 17 00:00:00 2001 From: Maneesh Gupta Date: Wed, 2 Sep 2026 04:27:24 +0000 Subject: [PATCH 06/10] Document HRR runtime pairing requirement Explain that capture and playback must be built from the same source commit to preserve generated HRR payload layouts.\n\nCo-Authored-By: Claude --- projects/hrr/DESIGN.md | 6 ++++++ projects/hrr/README.md | 9 ++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/projects/hrr/DESIGN.md b/projects/hrr/DESIGN.md index bf79baa5f09d..546fcf865410 100644 --- a/projects/hrr/DESIGN.md +++ b/projects/hrr/DESIGN.md @@ -176,6 +176,12 @@ cmake --build hrr-build --target hrr-playback ``` ### Usage +The capture runtime and playback tool must come from the same source commit. They +share generated HRR wire-format structs; mixing a checkout-built `hrr-playback` +with a prebuilt SDK `libamdhip64` can produce `payload too small` errors or missing +kernel/code-object replay. Use the same install prefix or matching `LD_LIBRARY_PATH` +for both components. + ```bash HIP_HRR_CAPTURE_OUTPUT=./out.hrr ./my_hip_app # capture hrr-playback ./out.hrr # replay + D2H validation diff --git a/projects/hrr/README.md b/projects/hrr/README.md index 2abb0a1c6d9d..bfad660128ed 100644 --- a/projects/hrr/README.md +++ b/projects/hrr/README.md @@ -16,13 +16,20 @@ The information presented in this document is for informational purposes only an HIP_HRR_CAPTURE_OUTPUT=./my_capture.hrr ./my_hip_app ``` -Use the in-tree `libamdhip64` from a developer build when testing capture changes: +Use the in-tree `libamdhip64` from the **same source commit** when testing capture changes: ```bash export LD_LIBRARY_PATH=/hipamd/lib:$LD_LIBRARY_PATH HIP_HRR_CAPTURE_OUTPUT=./out.hrr ./my_hip_app ``` +The capture runtime and `hrr-playback` share the generated HRR wire-format structs. For +capture/replay tests, build both `amdhip64` and `projects/hrr` from the same source +commit and use the same install prefix (or matching `LD_LIBRARY_PATH`) for both. Do +not capture with a prebuilt SDK runtime and replay with a checkout-built `hrr-playback`: +their generated payload layouts may differ, producing `payload too small` or missing +kernel/code-object errors. + ## Build `hrr-playback` `hrr-playback` builds standalone from `projects/hrr` against a capture-enabled From a6587dfc202780dc6ed4930cab6756cfd63f51dd Mon Sep 17 00:00:00 2001 From: Maneesh Gupta Date: Thu, 3 Sep 2026 02:23:34 +0000 Subject: [PATCH 07/10] Add HRR build-only CI coverage Route HRR changes through the runtimes CI matrix and make GPU integration tests explicit opt-in while keeping unit tests enabled by default.\n\nCo-Authored-By: Claude --- .github/scripts/therock_matrix.py | 12 ++++++++++++ projects/hrr/tests/CMakeLists.txt | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/scripts/therock_matrix.py b/.github/scripts/therock_matrix.py index 091ef65953c0..a2eb85320cf3 100644 --- a/.github/scripts/therock_matrix.py +++ b/.github/scripts/therock_matrix.py @@ -8,6 +8,8 @@ "projects/amdsmi": "amdsmi", # amdsmi changes run amdsmi + its downstream dependents "projects/aqlprofile": "profiler", "projects/clr": "runtimes", + "projects/hrr": "hrr", + "projects/cuid": "rdc", "projects/hipfile": "storage_libs", "projects/hip": "runtimes", @@ -97,6 +99,16 @@ "cmake_options": ["-DTHEROCK_ENABLE_ALL=ON"], "projects_to_test": "hip-tests, rocrtst, rocprofiler-sdk, rocr-debug-agent, rocgdb-cpu, rocgdb-gpu, rocgdb-corefile", }, + # HRR changes require a blocking build of the runtime and HRR test binaries, + # but GPU execution is handled separately on datacenter/nightly runners. + "hrr": { + "cmake_options": [ + "-DTHEROCK_ENABLE_ALL=OFF", + "-DTHEROCK_ENABLE_CORE=ON", + "-DTHEROCK_BUILD_TESTING=ON", + ], + "projects_to_test": "", + }, "all": { "cmake_options": ["-DTHEROCK_ENABLE_ALL=ON"], "projects_to_test": "amdsmi, hip-tests, rocrtst, aqlprofile, rocprofiler-compute, rocprofiler-sdk, rocprofiler-systems, rocr-debug-agent, rocgdb-cpu, rocgdb-gpu, rocgdb-corefile", diff --git a/projects/hrr/tests/CMakeLists.txt b/projects/hrr/tests/CMakeLists.txt index 470687b02533..e352cafb4380 100644 --- a/projects/hrr/tests/CMakeLists.txt +++ b/projects/hrr/tests/CMakeLists.txt @@ -11,7 +11,7 @@ # The HRR tests use a small local harness (hrr_test_common.hh / hrr_test_process.hh) # instead of the hip-tests Catch2 infrastructure. -option(HRR_BUILD_INTEGRATION_TESTS "Build HRR GPU capture/replay integration tests" ON) +option(HRR_BUILD_INTEGRATION_TESTS "Build HRR GPU capture/replay integration tests" OFF) # Catch2 test framework. Prefer an installed Catch2 (as the hip-tests suite # does); fall back to fetching the pinned tarball used across rocm-systems. From bef77f97dc985320ab0d163746fba138a719058f Mon Sep 17 00:00:00 2001 From: Maneesh Gupta Date: Thu, 3 Sep 2026 16:14:29 +0000 Subject: [PATCH 08/10] Address latest HRR review comments Compile HIP workloads for both HIP platforms, retry interrupted process output reads, preserve RCCL CODEOWNERS, and make hipMemGetDefaultMemPool playback a no-op when its location payload cannot be reconstructed safely.\n\nCo-Authored-By: Claude --- .github/CODEOWNERS | 6 +++--- projects/hrr/playback/hip_playback_generated.cpp | 13 ++++++++----- projects/hrr/tests/hrr_test_process.hh | 11 +++++++++-- projects/hrr/tests/integration/CMakeLists.txt | 2 +- projects/hrr/tools/gen_hrr_api_args.py | 5 +++++ 5 files changed, 26 insertions(+), 11 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 7c1e843b3fc3..4493287c5f07 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -12,10 +12,10 @@ /projects/hipother/ @ROCm/hipother-reviewers /projects/hip-tests/ @ROCm/hip-tests-reviewers /projects/hrr/ @ROCm/hrr-reviewers -/projects/rccl/ @ROCm/rccl-reviewers -/projects/rccl/src/include/api_trace.h @ROCm/rccl-reviewers @ROCm/ROCM-DevTools-Team +/projects/rccl/ @ROCm/rccl-reviewers @ROCm/rccl-leads +/projects/rccl/src/include/api_trace.h @ROCm/rccl-reviewers @ROCm/rccl-leads @ROCm/ROCM-DevTools-Team /projects/rccl/tools/scripts/test_runner/configs/ci-precheckin.json @ROCm/rccl-ci -/projects/rccl-tests/ @ROCm/rccl-reviewers +/projects/rccl-tests/ @ROCm/rccl-reviewers @ROCm/rccl-leads /projects/rdc/ @ROCm/rdc-reviewers /projects/rocm-core/ @nunnikri @frepaul @raramakr @ashutom @amd-isparry @arvindcheru /projects/rocm-core/rdhc/ @nunnikri @frepaul @raramakr @ashutom @amd-isparry @arvindcheru @solaiys diff --git a/projects/hrr/playback/hip_playback_generated.cpp b/projects/hrr/playback/hip_playback_generated.cpp index e364b95ca762..cca7fa4734ec 100644 --- a/projects/hrr/playback/hip_playback_generated.cpp +++ b/projects/hrr/playback/hip_playback_generated.cpp @@ -4747,11 +4747,14 @@ static hipError_t playback_hipExecutionCtxWaitEvent(PlaybackContext& ctx, const } static hipError_t playback_hipMemGetDefaultMemPool(PlaybackContext& ctx, const uint8_t* payload) { - const auto* a = reinterpret_cast(payload); - hipMemPool_t _out_memPool = nullptr; - hipMemLocation* _s_location{}; - hipError_t _r = (hipError_t)hipMemGetDefaultMemPool(&_out_memPool, _s_location, (hipMemAllocationType)a->type); - return _r; + (void)ctx; (void)payload; + static bool warned = false; + if (!warned) { + warned = true; + fprintf(stderr, "[HRR] NOOP playback handler called for hipMemGetDefaultMemPool — " + "this API is not replayed; results may differ from capture.\n"); + } + return hipSuccess; } diff --git a/projects/hrr/tests/hrr_test_process.hh b/projects/hrr/tests/hrr_test_process.hh index 386d84e25c0d..06fc5ba521ef 100644 --- a/projects/hrr/tests/hrr_test_process.hh +++ b/projects/hrr/tests/hrr_test_process.hh @@ -125,8 +125,15 @@ class SpawnProc { ::close(pipefd[1]); char buffer[4096]; ssize_t n; - while ((n = ::read(pipefd[0], buffer, sizeof(buffer))) > 0) { - output_.append(buffer, static_cast(n)); + while (true) { + n = ::read(pipefd[0], buffer, sizeof(buffer)); + if (n > 0) { + output_.append(buffer, static_cast(n)); + } else if (n == 0) { + break; + } else if (errno != EINTR) { + break; + } } ::close(pipefd[0]); } diff --git a/projects/hrr/tests/integration/CMakeLists.txt b/projects/hrr/tests/integration/CMakeLists.txt index 2c7802703c3f..7099e113a638 100644 --- a/projects/hrr/tests/integration/CMakeLists.txt +++ b/projects/hrr/tests/integration/CMakeLists.txt @@ -25,7 +25,7 @@ if(NOT DEFINED HIP_PLATFORM) set(HIP_PLATFORM "amd") endif() -if(HIP_PLATFORM STREQUAL "amd") +if(HIP_PLATFORM STREQUAL "amd" OR HIP_PLATFORM STREQUAL "nvidia") enable_language(HIP) set_source_files_properties(${HRR_GPU_WORKLOAD_SOURCES} PROPERTIES LANGUAGE HIP) endif() diff --git a/projects/hrr/tools/gen_hrr_api_args.py b/projects/hrr/tools/gen_hrr_api_args.py index 98a7a6eab92b..695ea1ddeaed 100644 --- a/projects/hrr/tools/gen_hrr_api_args.py +++ b/projects/hrr/tools/gen_hrr_api_args.py @@ -672,6 +672,11 @@ # Device initialization is handled by the replay harness / lazy runtime # init, so replaying it is unnecessary for correctness. "hipInitDevice", + # hipMemGetDefaultMemPool takes a hipMemLocation* whose pointed-to value + # cannot be safely reconstructed from the recorded payload on all playback + # SDKs. A null location can return hipErrorInvalidValue and abort replay; + # leave this query as a harmless no-op instead. + "hipMemGetDefaultMemPool", } # --------------------------------------------------------------------------- From 573bbcd4271b0ec583559b252ebe83a4434b9d7c Mon Sep 17 00:00:00 2001 From: Daniel Olsson Date: Wed, 9 Sep 2026 00:48:50 +0200 Subject: [PATCH 09/10] feat(hrr): consolidate the decode-and-triage skill onto the standalone layout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replay of #9758 onto the HRR standalone-project migration (#11157). #9758 was stacked on #10535, which moves the skill tree to projects/clr/.claude/skills/. #11157 moves the same files to projects/hrr/skills/ instead, so the two cannot both land — a rename/rename conflict over the same sources. #11157's destination is the one that puts the skill under @ROCm/hrr-reviewers, so #10535 is closed and its relocation is dropped; this branch carries #9758's feature work to the new location instead. Content is #9758's, with paths rewritten from projects/clr/.claude/skills/ to projects/hrr/skills/. Two files needed real merging: * ensure_playback.sh — #9758 extended export_playback_env() using resolve_clr_root(), resolve_rocr_lib_dir() and CLR_BUILD, all of which the migration deleted along with the CLR build-tree search. The migration's function is kept; the one layout-independent part of #9758's change is carried over, honouring a caller-supplied ROCR_LIB on LD_LIBRARY_PATH, which is the same variable check_replay_compat.py, replay_docker.sh and triage_archive.sh already read. * triage_archive.sh — #9758's probe for a packaged playback that ships bin/ and lib/ as siblings is kept; the CLR-relative path it used to reach the ROCR build dir is replaced with the migration's repo-root-relative one. test_packaged_playback_puts_its_own_lib_on_the_path covers the kept feature. 48 unit tests across test_analyze_replay_finding.py, test_check_replay_compat.py and test_triage_archive.py pass, and both shell scripts pass bash -n. --- .../hrr/skills/decode-and-triage/SKILL.md | 57 +++- .../evals/fixtures/info_crash.txt | 29 ++ .../evals/fixtures/info_pass.txt | 135 +++++++++ .../evals/fixtures/replay_aten_chevron.log | 13 + .../evals/fixtures/replay_hang_timeout.log | 8 + .../evals/fixtures/replay_memory_fault.log | 3 + .../evals/fixtures/replay_pass.log | 20 ++ .../fixtures/replay_queue_abort_aten.log | 14 + .../evals/fixtures/rocm_smi_vram.txt | 7 + .../evals/fixtures/version_mismatch.log | 1 + .../scripts/analyze_replay_finding.py | 275 +++++++++++++++++- .../scripts/ensure_playback.sh | 5 + .../scripts/test_analyze_replay_finding.py | 183 ++++++++++++ .../scripts/test_triage_archive.py | 233 +++++++++++++++ .../scripts/triage_archive.sh | 105 ++++++- 15 files changed, 1061 insertions(+), 27 deletions(-) create mode 100644 projects/hrr/skills/decode-and-triage/evals/fixtures/info_crash.txt create mode 100644 projects/hrr/skills/decode-and-triage/evals/fixtures/info_pass.txt create mode 100644 projects/hrr/skills/decode-and-triage/evals/fixtures/replay_aten_chevron.log create mode 100644 projects/hrr/skills/decode-and-triage/evals/fixtures/replay_hang_timeout.log create mode 100644 projects/hrr/skills/decode-and-triage/evals/fixtures/replay_memory_fault.log create mode 100644 projects/hrr/skills/decode-and-triage/evals/fixtures/replay_pass.log create mode 100644 projects/hrr/skills/decode-and-triage/evals/fixtures/replay_queue_abort_aten.log create mode 100644 projects/hrr/skills/decode-and-triage/evals/fixtures/rocm_smi_vram.txt create mode 100644 projects/hrr/skills/decode-and-triage/evals/fixtures/version_mismatch.log create mode 100644 projects/hrr/skills/decode-and-triage/scripts/test_triage_archive.py diff --git a/projects/hrr/skills/decode-and-triage/SKILL.md b/projects/hrr/skills/decode-and-triage/SKILL.md index 7244693b8f55..1b8834aad446 100644 --- a/projects/hrr/skills/decode-and-triage/SKILL.md +++ b/projects/hrr/skills/decode-and-triage/SKILL.md @@ -172,12 +172,67 @@ native. Use `--no-replay` for metadata-only (no GPU). | `PASS` | Replay completed; D2H checks passed | | `MAF` | GPU memory access fault during replay | | `FAIL` | Replay finished but validation failed (e.g. D2H mismatch) | -| `ABORT` | Replay stopped early (fatal API, version mismatch, user abort) | +| `ABORT` | Replay stopped early (fatal API, version mismatch, queue abort, user abort, replay process killed by a signal) | +| `HANG` | Replay made no progress and the runner had to stop it (see `HRR_REPLAY_TIMEOUT`) | | `UNKNOWN` | Insufficient signal to classify (e.g. metadata-only triage, missing log) | When outcome is `UNKNOWN` or fault class is `unknown`, say so explicitly in the summary — do not invent a fault type. +A fault on the GPU and a crash of the replay process are different findings. +The runtime's `Memory access fault by GPU node-N ... on address 0x...` line is +the GPU one: outcome `MAF`, fault class `illegal_memory_access`, or +`read_only_page_fault` when the reason names a read-only page. The replay +process dying on a signal without printing any of that is the host one: outcome +`ABORT`, fault class `replay_crashed`, and it implicates no kernel, because +nothing about the workload was established. Report that as a failed run rather +than as the user's defect. + +An HSA queue abort (`HSA_STATUS_ERROR_EXCEPTION`, `ABORTED`, `MEMORY_FAULT`) is +not a hang: `MEMORY_FAULT` is a fault and the other two are hardware exceptions, +which an out-of-bounds access raises. The abort line carries the kernel but no +faulting address, so read the kernel from there. A genuine hang shows up as no +progress against the clock, which is what `HRR_REPLAY_TIMEOUT` reports; do not +report one on the strength of an HSA status alone. + +### A faulting ATen kernel needs the original failure signature + +PyTorch and vLLM reach the GPU through `<<<>>>` (`hipLaunchByPtr`), and those +kernels pass device pointers inside by-value structs: `vectorized_elementwise_kernel` +takes a `std::array`, `reduce_kernel` a config struct with pointers at +arbitrary offsets. Capture records those offsets and replay translates them, with +a defensive rescan for any the capture-time heuristic missed, so on a current +build these kernels replay faithfully and a fault on one is a real finding. + +Two things still make such a fault ambiguous: the detector is a value-based +heuristic, and an archive recorded before that support landed carries no offsets +at all, in which case replay launches with a capture-time address and faults on a +workload that is fine. Both look identical to a workload defect. + +So the fault class stays what the evidence says (`illegal_memory_access`), the +finding carries a note, and you **ask the user for their original failure +signature** before calling it their bug. If their run never faulted here, suspect +the recording. Faults on `hipModuleLaunchKernel`-launched kernels (hipBLASLt +GEMMs, custom HIP kernels) do not carry this ambiguity. + +### Kernel attribution + +Replay runs with `--sync-after-launch`, which `triage_archive.sh` adds for you. +Without it the GPU is serialized only once at the end, so a fault is reported but +not attributed and the finding has no failing event and no kernel. Pass +`--no-sync` only when throughput matters more than attribution. + +A clean replay implicates no kernel, so the finding reports none even though the +archive lists the kernels it ran. Never present a kernel next to a `PASS`. + +A memory fault can tear the process down before the failing dispatch is +attributed, leaving a log with no kernel at all. When the archive holds exactly +one kernel, the finding names it and says the name was inferred; confirm it with +`--sync-after-launch`, which stops replay on the faulting dispatch. With more +than one kernel it stays unknown rather than guessing. Names that `--info` +truncated to its column width are never used: a cut-off symbol cannot be looked +up or handed to a kernel developer. + ### Finding summary template (Step 5 / W4) Print a structured summary directly in the chat reply: diff --git a/projects/hrr/skills/decode-and-triage/evals/fixtures/info_crash.txt b/projects/hrr/skills/decode-and-triage/evals/fixtures/info_crash.txt new file mode 100644 index 000000000000..87289bb2a6eb --- /dev/null +++ b/projects/hrr/skills/decode-and-triage/evals/fixtures/info_crash.txt @@ -0,0 +1,29 @@ +HRR Archive: /captures/crash_v4.hrr/pid-79 +======================================== +Complete: NO (no shutdown trailer; capture likely crashed) +Recovered: 5 events +Events: 5 +Kernels: 1 +Blobs: 1 +Code Objects: 2 +Threads: 1 + +Event Type Breakdown: + Type Count + ---- ----- + hipDeviceSynchronize 1 + hipMalloc 1 + hipMemcpy 1 + hipModuleLaunchKernel 1 + hipModuleLoad 1 + +Kernel Summary (first 20): + ID Kernel Grid Block SharedMem + -- ------ ---- ----- --------- + 0 crash_oob [64,1,1] [64,1,1] 0 + +Kernel Call Counts: + Kernel Calls + ------ ----- + crash_oob 1 + diff --git a/projects/hrr/skills/decode-and-triage/evals/fixtures/info_pass.txt b/projects/hrr/skills/decode-and-triage/evals/fixtures/info_pass.txt new file mode 100644 index 000000000000..dfe707249e2f --- /dev/null +++ b/projects/hrr/skills/decode-and-triage/evals/fixtures/info_pass.txt @@ -0,0 +1,135 @@ +HRR Archive: /captures/qwen06b_offline_v4.hrr/pid-1 +======================================== +Complete: yes (clean shutdown) +Recovered: 185469 events +Events: 185469 +Kernels: 13233 +Blobs: 4458 +Code Objects: 33 +Threads: 2 + +Event Type Breakdown: + Type Count + ---- ----- + __hipPopCallConfiguration 12945 + __hipPushCallConfiguration 12945 + __hipRegisterFatBinary 4083 + hipDeviceGetAttribute 2827 + hipDeviceGetStreamPriorityRange 1 + hipDevicePrimaryCtxGetState 44 + hipDeviceSynchronize 1 + hipDriverGetVersion 1 + hipEventCreateWithFlags 66 + hipEventDestroy 64 + hipEventQuery 31 + hipEventRecord 131 + hipEventSynchronize 66 + hipFree 11 + hipFuncGetAttribute 12 + hipGetDevice 81383 + hipGetDeviceCount 4 + hipGetDevicePropertiesR0600 3295 + hipGetLastError 1241 + hipHostMalloc 29 + hipMalloc 107 + hipMemGetInfo 5 + hipMemcpyAsync 354 + hipMemcpyWithStream 509 + hipMemset 1 + hipMemsetAsync 32 + hipModuleLaunchKernel 13233 + hipModuleLoad 2 + hipModuleLoadDataEx 4 + hipModuleUnload 2 + hipPointerGetAttribute 448 + hipRuntimeGetVersion 2827 + hipSetDevice 48075 + hipStreamCreateWithPriority 1 + hipStreamGetCaptureInfo 509 + hipStreamIsCapturing 118 + hipStreamWaitEvent 32 + hipGetProcAddress 30 + +Kernel Summary (first 20): + ID Kernel Grid Block SharedMem + -- ------ ---- ----- --------- + 0 _ZN2at6native29vectorized_elementwise_kernelILi... [1,1,1] [256,1,1] 0 + 1 _ZN2at6native29vectorized_elementwise_kernelILi... [1,1,1] [256,1,1] 0 + 2 _ZN2at6native29vectorized_elementwise_kernelILi... [128,1,1] [256,1,1] 0 + 3 _ZN2at6native29vectorized_elementwise_kernelILi... [16,1,1] [256,1,1] 0 + 4 _ZN2at6native29vectorized_elementwise_kernelILi... [16,1,1] [256,1,1] 0 + 5 _ZN2at6native29vectorized_elementwise_kernelILi... [16,1,1] [256,1,1] 0 + 6 _ZN2at6native29vectorized_elementwise_kernelILi... [2,1,1] [256,1,1] 0 + 7 _ZN2at6native29vectorized_elementwise_kernelILi... [1,1,1] [256,1,1] 0 + 8 _ZN2at6native29vectorized_elementwise_kernelILi... [1,1,1] [256,1,1] 0 + 9 _ZN2at6native29vectorized_elementwise_kernelILi... [1,1,1] [256,1,1] 0 + 10 _ZN2at6native29vectorized_elementwise_kernelILi... [16,1,1] [256,1,1] 0 + 11 _ZN2at6native29vectorized_elementwise_kernelILi... [1,1,1] [256,1,1] 0 + 12 _ZN2at6native29vectorized_elementwise_kernelILi... [1,1,1] [256,1,1] 0 + 13 _ZN2at6native29vectorized_elementwise_kernelILi... [1,1,1] [256,1,1] 0 + 14 _ZN2at6native29vectorized_elementwise_kernelILi... [8192,1,1] [256,1,1] 0 + 15 _ZN2at6native29vectorized_elementwise_kernelILi... [4,1,1] [256,1,1] 0 + 16 _ZN2at6native29vectorized_elementwise_kernelILi... [1,1,1] [256,1,1] 0 + 17 _ZN2at6native29vectorized_elementwise_kernelILi... [1,1,1] [256,1,1] 0 + 18 _ZN2at6native29vectorized_elementwise_kernelILi... [1,1,1] [256,1,1] 0 + 19 _ZN2at6native29vectorized_elementwise_kernelILi... [16,1,1] [256,1,1] 0 + ... and 13213 more + +Kernel Call Counts: + Kernel Calls + ------ ----- + Cijk_Alik_Bljk_BBS_BH_Bias_HA_S_SAV_UserArgs_MT128x128x12... 28 + Cijk_Alik_Bljk_BBS_BH_Bias_HA_S_SAV_UserArgs_MT192x128x12... 28 + Cijk_Alik_Bljk_BBS_BH_Bias_HA_S_SAV_UserArgs_MT256x256x64... 114 + Cijk_Alik_Bljk_BBS_BH_Bias_HA_S_SAV_UserArgs_MT64x64x256_... 56 + _Z11wvSplitKrc_I14__hip_bfloat16Li64ELi16ELi4ELi8ELi1ELi1... 112 + _Z16wvSplitK_hf_sml_I14__hip_bfloat16Li64ELi1ELi16ELi8ELi... 1736 + _Z16wvSplitK_hf_sml_I14__hip_bfloat16Li64ELi2ELi16ELi8ELi... 1768 + _Z35paged_attention_ll4mi_reduce_kernelI14__hip_bfloat16S... 896 + _Z38paged_attention_ll4mi_QKV_mfma4_kernelI14__hip_bfloat... 896 + _ZN12_GLOBAL__N_129elementwise_kernel_with_indexIiZZZN2at... 2 + _ZN2at6native12_GLOBAL__N_121indexSelectSmallIndexIN3c108... 32 + _ZN2at6native12_GLOBAL__N_123cunn_SoftMaxForwardGmemILi4E... 2 + _ZN2at6native12_GLOBAL__N_126CatArrayBatchedCopy_contigIN... 1 + _ZN2at6native12_GLOBAL__N_143distribution_elementwise_gri... 2 + _ZN2at6native12_GLOBAL__N_143distribution_elementwise_gri... 2 + _ZN2at6native13reduce_kernelILi512ELi1ENS0_8ReduceOpIfNS0... 36 + _ZN2at6native24index_elementwise_kernelILi128ELi4EZNS0_16... 32 + _ZN2at6native24index_elementwise_kernelILi128ELi4EZNS0_16... 32 + _ZN2at6native24vectorized_gather_kernelILi16ElEEvPcS2_PT0... 4 + _ZN2at6native27unrolled_elementwise_kernelINS0_11FillFunc... 32 + _ZN2at6native27unrolled_elementwise_kernelINS0_21CUDAFunc... 32 + _ZN2at6native29vectorized_elementwise_kernelILi16ENS0_11F... 56 + _ZN2at6native29vectorized_elementwise_kernelILi16ENS0_11F... 3 + _ZN2at6native29vectorized_elementwise_kernelILi4ENS0_11Fi... 125 + _ZN2at6native29vectorized_elementwise_kernelILi4ENS0_11Fi... 43 + _ZN2at6native29vectorized_elementwise_kernelILi4ENS0_11Fi... 9 + _ZN2at6native29vectorized_elementwise_kernelILi4ENS0_13AU... 1 + _ZN2at6native29vectorized_elementwise_kernelILi4ENS0_13BU... 1 + _ZN2at6native29vectorized_elementwise_kernelILi4ENS0_13Bi... 2 + _ZN2at6native29vectorized_elementwise_kernelILi4ENS0_15CU... 32 + _ZN2at6native29vectorized_elementwise_kernelILi4ENS0_15CU... 32 + _ZN2at6native29vectorized_elementwise_kernelILi4EZNS0_21c... 4 + _ZN2at6native29vectorized_elementwise_kernelILi4EZNS0_25b... 1 + _ZN2at6native29vectorized_elementwise_kernelILi4EZNS0_34b... 34 + _ZN2at6native29vectorized_elementwise_kernelILi4EZZZNS0_1... 2 + _ZN2at6native29vectorized_elementwise_kernelILi4EZZZNS0_1... 1 + _ZN2at6native29vectorized_elementwise_kernelILi4EZZZNS0_1... 1 + _ZN2at6native29vectorized_elementwise_kernelILi4EZZZNS0_2... 1 + _ZN2at6native29vectorized_elementwise_kernelILi8ENS0_11Fi... 170 + _ZN2at6native32elementwise_kernel_manual_unrollILi128ELi4... 1 + _ZN2at6native32elementwise_kernel_manual_unrollILi128ELi4... 36 + _ZN2at6native32elementwise_kernel_manual_unrollILi128ELi4... 98 + _ZN2at6native32elementwise_kernel_manual_unrollILi128ELi4... 2 + _ZN2at6native32elementwise_kernel_manual_unrollILi128ELi4... 1 + _ZN2at6native32elementwise_kernel_manual_unrollILi128ELi4... 2 + _ZN4vllm15rms_norm_kernelIN3c108BFloat16ELi8ELi2EEEvPT_PK... 34 + _ZN4vllm15rms_norm_kernelIN3c108BFloat16ELi8ELi3EEEvPT_PK... 1904 + _ZN4vllm18act_and_mul_kernelIN3c108BFloat16E15__hip_bfloa... 952 + _ZN4vllm23rotary_embedding_kernelIN3c108BFloat16ELb1EEEvP... 952 + _ZN4vllm24reshape_and_cache_kernelI14__hip_bfloat16S1_LNS... 924 + _ZN4vllm25fused_add_rms_norm_kernelIN3c108BFloat16ELi8EEE... 1904 + _compute_slot_mapping_kernel 32 + _fwd_kernel 28 + _topk_topp_kernel 2 + diff --git a/projects/hrr/skills/decode-and-triage/evals/fixtures/replay_aten_chevron.log b/projects/hrr/skills/decode-and-triage/evals/fixtures/replay_aten_chevron.log new file mode 100644 index 000000000000..83467324b6af --- /dev/null +++ b/projects/hrr/skills/decode-and-triage/evals/fixtures/replay_aten_chevron.log @@ -0,0 +1,13 @@ +[triage] archive=/data/llama_run.hrr/pid-680 replay=native +[triage] native replay playback=/opt/rocm/bin/hrr-playback GPU=3 --sync-after-launch +[HRR] Archive : 177203 events, 8214 kernels, 4733 blobs, 41 code objects +[HRR] Complete: yes (clean shutdown) +[HRR] [replay] Device state OK — beginning replay +[HRR] Event 41188: hipMallocAsync +[HRR] Event 41202: hipModuleLaunchKernel -> Kernel '_ZN2at6native29vectorized_elementwise_kernelILi4EZZZNS0_18add_kernel_cudaERNS_18TensorIteratorBaseEENKUlvE_clEvENKUlvE2_clEvEUlffE_NS_6detail5ArrayIPcLi3EEEEEviT0_T1_' OK +[HRR] Event 41266: hipMemcpyAsync +[HRR] Event 41310: hipLaunchKernel +:0:rocdevice.cpp :3608: Memory Fault Error [GPU index: 0, faulting addr: 0x7f8c11a00000, kernel: _ZN2at6native29vectorized_elementwise_kernelILi4EZZZNS0_18mul_kernel_cudaERNS_18TensorIteratorBaseEENKUlvE_clEvENKUlvE2_clEvEUlffE_NS_6detail5ArrayIPcLi3EEEEEviT0_T1_] +Memory access fault by GPU node-4 (Agent handle: 0x55d1a2f00c40) on address 0x7f8c11a00000. Reason: Unknown. +Aborted (core dumped) +[triage] native replay exit=134 diff --git a/projects/hrr/skills/decode-and-triage/evals/fixtures/replay_hang_timeout.log b/projects/hrr/skills/decode-and-triage/evals/fixtures/replay_hang_timeout.log new file mode 100644 index 000000000000..f8b4c10c27e5 --- /dev/null +++ b/projects/hrr/skills/decode-and-triage/evals/fixtures/replay_hang_timeout.log @@ -0,0 +1,8 @@ +[HRR] Archive : 5 events, 1 kernels, 1 blobs, 2 code objects +[HRR] Threads : 1 captured +[HRR] Device : AMD Radeon Graphics (gfx950:sramecc+:xnack-) +[HRR] Mode : single-threaded +[HRR] [replay] Device state OK — beginning replay +[HRR] Pre-loading 2 code objects... +[HRR] All code objects pre-loaded OK. +[triage] replay timed out after 1800s diff --git a/projects/hrr/skills/decode-and-triage/evals/fixtures/replay_memory_fault.log b/projects/hrr/skills/decode-and-triage/evals/fixtures/replay_memory_fault.log new file mode 100644 index 000000000000..a926b585b7e0 --- /dev/null +++ b/projects/hrr/skills/decode-and-triage/evals/fixtures/replay_memory_fault.log @@ -0,0 +1,3 @@ +[HRR] Archive has no clean-shutdown trailer (capture likely crashed); recovered 5 events +Memory access fault by GPU node-2 (Agent handle: 0x55a197628600) on address 0x7f91da000000. Reason: Unknown. +GPU coredump: execvp failed: No such file or directory diff --git a/projects/hrr/skills/decode-and-triage/evals/fixtures/replay_pass.log b/projects/hrr/skills/decode-and-triage/evals/fixtures/replay_pass.log new file mode 100644 index 000000000000..baa2e98612a4 --- /dev/null +++ b/projects/hrr/skills/decode-and-triage/evals/fixtures/replay_pass.log @@ -0,0 +1,20 @@ +[HRR] NOOP playback handler called for hipDevicePrimaryCtxGetState — this API is not replayed; results may differ from capture. +[HRR] NOOP playback handler called for hipGetProcAddress — this API is not replayed; results may differ from capture. +[HRR] NOOP playback handler called for hipFuncGetAttribute — this API is not replayed; results may differ from capture. +[HRR] NOOP playback handler called for hipPointerGetAttribute — this API is not replayed; results may differ from capture. +[HRR] Archive : 185469 events, 13233 kernels, 4458 blobs, 33 code objects +[HRR] Threads : 2 captured +[HRR] Device : AMD Radeon Graphics (gfx950:sramecc+:xnack-) +[HRR] Mode : single-threaded +[HRR] [replay] Device memory: 257418 MB free / 258032 MB total +[HRR] [replay] Device state OK — beginning replay +[HRR] Pre-loading 33 code objects... +[HRR] All code objects pre-loaded OK. + +[HRR] -- Replay summary ------------------------------ +[HRR] Wall time : 39145.5 ms +[HRR] Threads used : 1 +[HRR] Kernels launched: 13233 +[HRR] Graphs launched : 0 +[HRR] D2H checks : 32 pass (32 exact, 0 within tol), 0 fail, 0 skipped +[HRR] PASS diff --git a/projects/hrr/skills/decode-and-triage/evals/fixtures/replay_queue_abort_aten.log b/projects/hrr/skills/decode-and-triage/evals/fixtures/replay_queue_abort_aten.log new file mode 100644 index 000000000000..ea74cde7ed38 --- /dev/null +++ b/projects/hrr/skills/decode-and-triage/evals/fixtures/replay_queue_abort_aten.log @@ -0,0 +1,14 @@ +[HRR] Archive has no clean-shutdown trailer (capture likely crashed); recovered 2727 events +[HRR] NOOP playback handler called for hipDevicePrimaryCtxGetState — this API is not replayed; results may differ from capture. +[HRR progress] elapsed_s=0.0 seq=1301 kernels=1 d2h_pass=0 d2h_fail=0 d2h_attempted=0 last="_ZN2at6native29vectorized_elementwise_kernelILi4ENS0_11FillFunctorIfEESt5arrayIPcLm1EEEEviT0_T1_" +Queue error: HSA_STATUS_ERROR_EXCEPTION: An HSAIL operation resulted in a hardware exception. +GPU coredump: Pipe handler '/usr/share/apport/apport' not found or not executable. +Falling back to file-based dump. Set HSA_COREDUMP_PATTERN to override. +VGPU=0x5617c727ec30 SWq=0x7f69e8266000, HWq=0x7f6109e00000, id=1 + Dispatch Header =0xb02 (type=2, barrier=1, acquire=1, release=1), setup=3 + grid=[256, 1, 1], workgroup=[256, 1, 1] + private_seg_size=0, group_seg_size=0 + kernel_obj=0x7f69de8aaa40, kernarg_address=0x0x7f60fea00100 + completion_signal=0x0 + rptr=18, wptr=20 +:0:rocdevice.cpp :4312: 3445930657021 us: Callback: Queue 0x7f6109e00000 aborting with error : HSA_STATUS_ERROR_EXCEPTION: An HSAIL operation resulted in a hardware exception. code: 0x1016 [host: 3d890059944d, GPU index: 0, kernel: void at::native::(anonymous namespace)::indexSelectSmallIndex(at::cuda::detail::TensorInfo, at::cuda::detail::TensorInfo, at::cuda::detail::TensorInfo, int, int, unsigned int, long)] diff --git a/projects/hrr/skills/decode-and-triage/evals/fixtures/rocm_smi_vram.txt b/projects/hrr/skills/decode-and-triage/evals/fixtures/rocm_smi_vram.txt new file mode 100644 index 000000000000..a8e9667e3a4c --- /dev/null +++ b/projects/hrr/skills/decode-and-triage/evals/fixtures/rocm_smi_vram.txt @@ -0,0 +1,7 @@ +====================== ROCm System Management Interface ====================== +================================ Memory Usage ================================ +GPU[0] : VRAM Total Memory (B): 274877906944 +GPU[0] : VRAM Total Used Memory (B): 264877906944 +GPU[1] : VRAM Total Memory (B): 274877906944 +GPU[1] : VRAM Total Used Memory (B): 1073741824 +============================== End of ROCm SMI Log =========================== diff --git a/projects/hrr/skills/decode-and-triage/evals/fixtures/version_mismatch.log b/projects/hrr/skills/decode-and-triage/evals/fixtures/version_mismatch.log new file mode 100644 index 000000000000..523aa2011f1e --- /dev/null +++ b/projects/hrr/skills/decode-and-triage/evals/fixtures/version_mismatch.log @@ -0,0 +1 @@ +[HRR] Version mismatch: file=3 reader=4 diff --git a/projects/hrr/skills/decode-and-triage/scripts/analyze_replay_finding.py b/projects/hrr/skills/decode-and-triage/scripts/analyze_replay_finding.py index d0a15d6652e8..81c4c0433cf3 100755 --- a/projects/hrr/skills/decode-and-triage/scripts/analyze_replay_finding.py +++ b/projects/hrr/skills/decode-and-triage/scripts/analyze_replay_finding.py @@ -29,17 +29,72 @@ r"Memory access fault by GPU node-(\d+).*on address (0x[0-9a-fA-F]+)\.\s*" r"Reason:\s*([^.\n]+)" ) +# The leading fields of this bracket vary by ROCm build -- some emit `host:`, +# some start at `GPU index:` -- so anchor on the two fields actually consumed +# rather than on the whole prefix. Requiring `host:` dropped the kernel name on +# every build that omits it, which is the one field the report exists to give. RE_MEM_FAULT_ERR = re.compile( - r"Memory Fault Error \[host: [^,]+, GPU index: \d+, faulting addr: (0x[0-9a-fA-F]+), " - r"kernel: ([^\]]+)\]" + r"Memory Fault Error \[[^\]]*?faulting addr: (0x[0-9a-fA-F]+), kernel: ([^\]]+)\]" +) +RE_HSA_STATUS = re.compile(r"HSA_STATUS_ERROR_(MEMORY_FAULT|ABORTED|EXCEPTION)") +# The runner bounds the replay and records the fact when it had to stop it. +# This is the only signal a hang leaves: it makes no progress and prints +# nothing, so without the marker the archive yields no finding at all. +RE_REPLAY_TIMEOUT = re.compile(r"replay timed out after (\d+)s") +# The replay process dying on a signal leaves the log truncated and nothing +# else, so the runner records it the same way. Read on its own it says the run +# failed, not that the workload did: no kernel was established as at fault. +RE_REPLAY_SIGNAL = re.compile(r"replay killed by signal (\d+)") +# A queue abort carries its own bracket, with the kernel but no faulting +# address, so the memory-fault regex above cannot see it. Observed on an +# out-of-bounds ATen gather, where this was the only line naming the culprit. +RE_QUEUE_ABORT_KERNEL = re.compile( + r"aborting with error[^\[\n]*\[[^\]]*?kernel: ([^\]]+)\]" ) -RE_HANG = re.compile(r"HSA_STATUS_ERROR_(MEMORY_FAULT|ABORTED|EXCEPTION)") RE_PASS = re.compile(r"\[HRR\] PASS\b") RE_FAIL = re.compile(r"\[HRR\] FAIL\b") RE_ARCHIVE_RECOVERED = re.compile( r"recovered (\d+) events|Archive : (\d+) events, (\d+) kernels, (\d+) blobs, (\d+) code objects" ) -RE_ARCHIVE_COMPLETE = re.compile(r"Complete:\s+(YES|NO)") +# `--info` prints `Complete: yes (clean shutdown)` or `Complete: NO (no +# shutdown trailer; capture likely crashed)`, so the verdict is case-mixed and +# always carries a trailing explanation. +RE_ARCHIVE_COMPLETE = re.compile(r"Complete:\s+(yes|no)\b", re.IGNORECASE) +# `--info` reports the archive as labelled fields, one per line, while a replay +# run reports the same totals on a single `[HRR] Archive :` line. +RE_INFO_EVENTS = re.compile(r"^Events:\s+(\d+)\s*$", re.MULTILINE) +RE_INFO_KERNELS = re.compile(r"^Kernels:\s+(\d+)\s*$", re.MULTILINE) +RE_INFO_RECOVERED = re.compile(r"^Recovered:\s+(\d+)\s+events\s*$", re.MULTILINE) +# Short archives print no `Kernels:` total and report launches only in the API +# call-count block. Without this the total stays unknown and the single-kernel +# inference in finalize() can never fire. +RE_INFO_LAUNCH_COUNT = re.compile(r"\bhip\w*LaunchKernel\s+(\d+)\b") +# Rows of the `--info` kernel summary table: name, grid, block, with an optional +# leading id, since some builds omit the id column. A memory fault can kill the +# replay before any per-launch attribution reaches the log, and then this table +# is the only record of what the archive ran. The name must start with a letter +# or underscore, which is what keeps a bare id from being read as a symbol now +# that the id is optional. +RE_INFO_KERNEL_ROW = re.compile( + r"^[ \t]*(?:\d+[ \t]+)?([A-Za-z_][^\s\[]*)[ \t]+\[[\d,\s]+\][ \t]+\[[\d,\s]+\]", + re.MULTILINE, +) +# `--verbose` prints one line per replayed event. A GPU fault tears the process +# down before HRR writes its own Fatal line, so when a run was made verbose the +# last of these is the only record of the failing dispatch. The sync flags do +# not emit these lines: `hrr_playback.cpp` gates them on `ctx.verbose` alone. +RE_EVENT_PROGRESS = re.compile( + r"^[ \t]*(?:\[HRR\][ \t]*)?Event (\d+):[ \t]*(\w+)" + r"(?:[^\n]*?->[ \t]*Kernel '([^']+)')?", + re.MULTILINE, +) +# PyTorch/ATen kernels reach the GPU through `<<<>>>` (hipLaunchByPtr) and pass +# device pointers inside by-value structs. Capture records those and replay +# translates them, so these kernels do replay faithfully on a current build. The +# detector is still a value-based heuristic, and an archive recorded before it +# landed carries no such offsets at all, so a fault on one of these symbols +# earns a caveat in the finding, not a different verdict. +RE_ATEN_CHEVRON = re.compile(r"_ZN2at6native|at::native::") RE_CAPTURE_MAF = RE_MAF RE_D2H_SUMMARY = re.compile(r"D2H checks\s+: (\d+) pass.*?, (\d+) fail, (\d+) skipped") RE_KERNARG = re.compile(r"kernarg_address=(0x[0-9a-fA-F]+)") @@ -65,14 +120,19 @@ class Finding: grid: str | None = None workgroup: str | None = None gpu_node: str | None = None + replay_signal: int | None = None last_progress_kernel: str | None = None + last_event_kernel: str | None = None kernels_launched: int | None = None d2h_pass: int | None = None d2h_fail: int | None = None d2h_attempted: int | None = None archive_events: int | None = None archive_kernels: int | None = None + archive_kernel_names: list[str] = field(default_factory=list) archive_complete: str | None = None + archive_format_version: int | None = None + reader_format_version: int | None = None capture_hip_so: str | None = None capture_hip_runtime_version: str | None = None capture_comgr_version: str | None = None @@ -88,12 +148,27 @@ def to_dict(self) -> dict[str, Any]: def _classify(text: str, finding: Finding) -> str: if RE_VERSION_MISMATCH.search(text): return "version_mismatch" + # A replay the runner had to stop made no progress against the clock, which + # is what a hang is. This outranks the rest: whatever partial output the + # replay printed before stalling does not describe why it stalled. + if RE_REPLAY_TIMEOUT.search(text): + return "hang" if RE_PASS.search(text): if finding.d2h_fail and finding.d2h_fail > 0: return "nan_inf_divergence" return "replay_pass" if "out of memory" in text.lower() or "hipErrorOutOfMemory" in text: return "replay_oom" + # A GPU memory fault has to be classified before the generic abort branch. + # Surfacing a fault through --sync-after-event makes the runtime print the + # memory-fault line and hrr-playback print "Fatal: GPU error after ..." for + # the same fault, so testing the abort first would report every fault as a + # plain API error, and that is exactly the mode used to localize a fault. + if RE_MAF.search(text) or RE_MEM_FAULT_ERR.search(text): + reason = (finding.fault_reason or "").lower() + if "read-only" in reason: + return "read_only_page_fault" + return "illegal_memory_access" if ( RE_FATAL_EVENT.search(text) or RE_FATAL_GPU.search(text) @@ -102,17 +177,29 @@ def _classify(text: str, finding: Finding) -> str: if "out of memory" in text.lower(): return "replay_oom" return "replay_fatal_api" - if RE_MAF.search(text) or RE_MEM_FAULT_ERR.search(text): - reason = (finding.fault_reason or "").lower() - if "read-only" in reason: - return "read_only_page_fault" - return "illegal_memory_access" - if RE_HANG.search(text) and not RE_PASS.search(text): - return "hang" + # An HSA queue abort is not a hang. MEMORY_FAULT says so in as many words, + # and EXCEPTION is a hardware exception, which an out-of-bounds access + # raises. Reporting either as a hang sends the reader after stalled work + # that never existed and drops the kernel the abort just named. A real hang + # shows up as no progress against the clock, which is what the replay + # timeout above reports. + hsa = RE_HSA_STATUS.search(text) + if hsa and not RE_PASS.search(text): + return ( + "illegal_memory_access" + if hsa.group(1) == "MEMORY_FAULT" + else "replay_aborted" + ) if RE_FAIL.search(text) or (finding.d2h_fail and finding.d2h_fail > 0): return "nan_inf_divergence" if "Replay aborted" in text or "aborting replay" in text: return "replay_aborted" + # Last, so that a log which explains its own stop is believed first: a + # memory fault also dies on a signal, and there the fault line is the + # answer. On its own the signal says the replay process died without + # reaching a verdict, which is a failure of the run and not of the workload. + if RE_REPLAY_SIGNAL.search(text): + return "replay_crashed" return "unknown" @@ -128,7 +215,10 @@ def _kernel_family(name: str | None) -> str | None: if sk: parts.append("streamk" if "SK3" in sk else "streamk_variant") return "/".join(parts) - if name.startswith("_ZN"): + # Mangled and demangled forms of the same ATen symbols both occur: the + # memory-fault line prints the mangled name, the queue-abort line prints + # the demangled signature. + if name.startswith("_ZN") or "at::native::" in name: return "pytorch_kernel" return "other" @@ -149,10 +239,43 @@ def parse_text(text: str, source: str, finding: Finding) -> Finding: m = RE_ARCHIVE_COMPLETE.search(text) if m: - finding.archive_complete = m.group(1) + finding.archive_complete = m.group(1).lower() + + for regex, attr in ( + (RE_INFO_RECOVERED, "archive_events"), + (RE_INFO_EVENTS, "archive_events"), + (RE_INFO_KERNELS, "archive_kernels"), + ): + m = regex.search(text) + if m: + setattr(finding, attr, int(m.group(1))) + + if finding.archive_kernels is None: + m = RE_INFO_LAUNCH_COUNT.search(text) + if m: + finding.archive_kernels = int(m.group(1)) + + for name in RE_INFO_KERNEL_ROW.findall(text): + # The table truncates long names to its column width, and a truncated + # symbol is worse than none: it cannot be looked up or handed over. + if name.endswith("...") or name in finding.archive_kernel_names: + continue + finding.archive_kernel_names.append(name) + + m = RE_HSA_STATUS.search(text) + if m and not RE_PASS.search(text): + note = f"the queue aborted with HSA_STATUS_ERROR_{m.group(1)}" + if note not in finding.notes: + finding.notes.append(note) + + m = RE_REPLAY_SIGNAL.search(text) + if m: + finding.replay_signal = int(m.group(1)) m = RE_VERSION_MISMATCH.search(text) if m: + finding.archive_format_version = int(m.group(1)) + finding.reader_format_version = int(m.group(2)) finding.notes.append( f"archive wire version {m.group(1)} does not match hrr-playback reader {m.group(2)}" ) @@ -165,7 +288,11 @@ def parse_text(text: str, source: str, finding: Finding) -> Finding: finding.d2h_fail = int(m.group(4)) finding.d2h_attempted = int(m.group(5)) last_prog = m.group(6) - finding.last_progress_kernel = last_prog + # Only when this input had progress lines. Assigning unconditionally let the + # archive `--info` pass, which has none, wipe the kernel the replay log had + # already recorded, and the default pipeline always parses both. + if last_prog is not None: + finding.last_progress_kernel = last_prog for m in (RE_FATAL_EVENT, RE_FATAL_GPU): hit = m.search(text) @@ -175,6 +302,17 @@ def parse_text(text: str, source: str, finding: Finding) -> Finding: finding.failing_api = hit.group(3) break + last_event = None + for m in RE_EVENT_PROGRESS.finditer(text): + last_event = m + if last_event is not None: + # An HRR Fatal line names the failing event exactly; this is only the + # last event that started, so it never overrides one. + if finding.failing_call_index is None: + finding.failing_call_index = int(last_event.group(1)) + finding.failing_api = last_event.group(2) + finding.last_event_kernel = last_event.group(3) + m = RE_MAF.search(text) if m: finding.gpu_node = m.group(1) @@ -186,6 +324,11 @@ def parse_text(text: str, source: str, finding: Finding) -> Finding: finding.fault_address = finding.fault_address or m.group(1) finding.kernel_name = m.group(2).strip() + if not finding.kernel_name: + m = RE_QUEUE_ABORT_KERNEL.search(text) + if m: + finding.kernel_name = m.group(1).strip() + if not finding.kernel_name: cijk = RE_CIJK.search(text) if cijk: @@ -210,16 +353,27 @@ def parse_text(text: str, source: str, finding: Finding) -> Finding: finding.fault_class = new_class new_outcome = finding.outcome - if RE_PASS.search(text): + if RE_REPLAY_TIMEOUT.search(text): + new_outcome = "HANG" + elif RE_PASS.search(text): new_outcome = "PASS" elif RE_MAF.search(text) or RE_MEM_FAULT_ERR.search(text): new_outcome = "MAF" elif RE_FAIL.search(text): new_outcome = "FAIL" + elif RE_HSA_STATUS.search(text): + # A queue abort is a GPU-side stop, so it is never UNKNOWN. Its own + # status says which: MEMORY_FAULT is a fault, the rest are aborts. + new_outcome = ( + "MAF" + if RE_HSA_STATUS.search(text).group(1) == "MEMORY_FAULT" + else "ABORT" + ) elif ( "aborting replay" in text or RE_FATAL_EVENT.search(text) or RE_VERSION_MISMATCH.search(text) + or RE_REPLAY_SIGNAL.search(text) ): new_outcome = "ABORT" elif finding.outcome == "UNKNOWN": @@ -229,6 +383,90 @@ def parse_text(text: str, source: str, finding: Finding) -> Finding: return finding +def finalize(finding: Finding) -> Finding: + """Settle kernel attribution once every input has been parsed. + + Attribution cannot be decided per input: the replay log and the archive + `--info` dump each hold half of the evidence, and which half arrives first + depends on how the caller was invoked. + """ + # A clean replay implicates no kernel. The archive still lists the kernels + # it ran, and a GEMM matched out of that listing would sit in the report + # next to a pass as though it were a culprit. + if finding.fault_class == "replay_pass": + finding.kernel_name = None + finding.kernel_family = None + finding.last_event_kernel = None + return finding + + # The replay process died without reaching a verdict, so nothing here is a + # statement about the workload. Inferring a kernel from the archive would + # hand over a culprit for a crash of the replay itself. + if finding.fault_class == "replay_crashed": + finding.kernel_name = None + finding.kernel_family = None + finding.notes.append( + f"the replay process was killed by signal {finding.replay_signal} " + f"without printing a verdict, so no kernel is implicated and the " + f"workload is untested. Re-run the replay; if it dies the same way " + f"again, this is a defect in hrr-playback or its environment rather " + f"than in the captured workload." + ) + return finding + + # Under --sync-after-launch the last launch to start is the one that + # faulted, so it stands in when the runtime's fault line carried no kernel. + if not finding.kernel_name and finding.last_event_kernel: + finding.kernel_name = finding.last_event_kernel + finding.notes.append( + f"kernel name taken from the last launch to start before the fault " + f"({finding.last_event_kernel}); the runtime fault line named no " + f"kernel. Valid only for a replay run with --verbose, which is what " + f"prints those per-event lines." + ) + + # A memory fault can tear the process down before the failing dispatch is + # attributed, leaving a log with no kernel at all. When the archive holds + # exactly one kernel, that kernel is the one that faulted. More than one + # stays unknown: picking among several would be a guess. + if ( + not finding.kernel_name + and finding.archive_kernels == 1 + and len(finding.archive_kernel_names) == 1 + ): + finding.kernel_name = finding.archive_kernel_names[0] + finding.notes.append( + f"kernel name inferred from the archive, which contains exactly one " + f"kernel ({finding.kernel_name}); the replay log carried no " + f"per-launch attribution. Re-run with --sync-after-launch to " + f"confirm the faulting dispatch directly." + ) + + # A `<<<>>>`-launched ATen kernel passes device pointers inside by-value + # structs. Current capture records those offsets and replay translates them, + # so this is not automatically a recording artefact, but the detector is a + # heuristic and an archive taken before it landed carries no offsets at all. + # Both failure modes look exactly like a workload fault, so flag the + # ambiguity rather than resolving it either way. + if finding.fault_class in ( + "illegal_memory_access", + "read_only_page_fault", + "replay_aborted", + ) and RE_ATEN_CHEVRON.search(finding.kernel_name or ""): + finding.notes.append( + "the faulting kernel is an ATen kernel launched through <<<>>> " + "(hipLaunchByPtr), which passes device pointers inside by-value " + "structs. Replay translates those via a value-based heuristic, and " + "an archive recorded before that support landed has none recorded " + "at all, so an untranslated pointer here would fault exactly like a " + "workload defect. Confirm against the user's original failure " + "signature before reporting this as their bug." + ) + + finding.kernel_family = _kernel_family(finding.kernel_name) + return finding + + def run_archive_info(archive: Path, hrr_playback: str | None) -> str: play = hrr_playback or "hrr-playback" try: @@ -270,11 +508,16 @@ def render_markdown(f: Finding) -> str: f"- **Kernels launched**: {f.kernels_launched or 'n/a'}", f"- **D2H**: pass={f.d2h_pass or 0} fail={f.d2h_fail or 0} attempted={f.d2h_attempted or 0}", f"- **Last progress kernel**: `{f.last_progress_kernel or 'n/a'}`", + f"- **Last launch before fault**: `{f.last_event_kernel or 'n/a'}`", "", "## Archive / capture", f"- **Events**: {f.archive_events or 'n/a'}", f"- **Kernels (archive)**: {f.archive_kernels or 'n/a'}", + f"- **Kernel names (archive)**: {', '.join(f.archive_kernel_names) or 'n/a'}", f"- **Complete**: {f.archive_complete or 'n/a'}", + f"- **Archive / reader format**: " + f"{f.archive_format_version if f.archive_format_version is not None else 'n/a'}" + f" / {f.reader_format_version if f.reader_format_version is not None else 'n/a'}", f"- **Capture HIP**: `{f.capture_hip_so or 'n/a'}`", f"- **Capture HIP runtime**: `{f.capture_hip_runtime_version or 'n/a'}`", f"- **Capture comgr**: `{f.capture_comgr_version or 'n/a'}`", @@ -346,6 +589,8 @@ def main() -> int: ) finding.sources.append(str(arch)) + finalize(finding) + out = ( json.dumps(finding.to_dict(), indent=2) if args.format == "json" diff --git a/projects/hrr/skills/decode-and-triage/scripts/ensure_playback.sh b/projects/hrr/skills/decode-and-triage/scripts/ensure_playback.sh index f71631767187..c0aae44ae2d0 100755 --- a/projects/hrr/skills/decode-and-triage/scripts/ensure_playback.sh +++ b/projects/hrr/skills/decode-and-triage/scripts/ensure_playback.sh @@ -72,6 +72,11 @@ build_playback() { export_playback_env() { local play="$1" ld_parts=() export HRR_PLAYBACK="$play" + # An in-tree ROCR lib dir, when the caller points at one, must precede the + # packaged runtime. check_replay_compat.py, replay_docker.sh and + # triage_archive.sh read the same variable; resolving it from a CLR build + # tree is gone with the standalone layout, so it is taken from the caller. + [[ -n "${ROCR_LIB:-}" && -d "${ROCR_LIB}" ]] && ld_parts+=("$ROCR_LIB") [[ -d "$ROCM_PATH/lib" ]] && ld_parts+=("$ROCM_PATH/lib") if [[ ${#ld_parts[@]} -gt 0 ]]; then export LD_LIBRARY_PATH="$(IFS=:; echo "${ld_parts[*]}")${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" diff --git a/projects/hrr/skills/decode-and-triage/scripts/test_analyze_replay_finding.py b/projects/hrr/skills/decode-and-triage/scripts/test_analyze_replay_finding.py index b42dbb5a7df7..eee4091b9a3d 100644 --- a/projects/hrr/skills/decode-and-triage/scripts/test_analyze_replay_finding.py +++ b/projects/hrr/skills/decode-and-triage/scripts/test_analyze_replay_finding.py @@ -57,11 +57,194 @@ def test_maf_not_overwritten_by_later_info_only_parse(self) -> None: self.assertEqual(finding.fault_class, "read_only_page_fault") self.assertEqual(finding.outcome, "MAF") + def test_a_gpu_fault_outranks_the_signal_that_killed_the_process(self) -> None: + """A memory fault aborts the process, so both markers are in the log.""" + text = ( + "Memory access fault by GPU node-2 (Agent handle: 0x1) on address " + "0x7f91da000000. Reason: Unknown.\n" + "[triage] replay killed by signal 6\n" + ) + finding = arf.Finding(outcome="UNKNOWN", fault_class="unknown") + arf.parse_text(text, "sample.log", finding) + self.assertEqual(finding.outcome, "MAF") + self.assertEqual(finding.fault_class, "illegal_memory_access") + def test_to_dict_json_serializable(self) -> None: finding = arf.Finding(outcome="PASS", fault_class="replay_pass") payload = json.dumps(finding.to_dict()) self.assertIn("replay_pass", payload) + def test_memory_fault_outranks_the_abort_line(self) -> None: + """A fault surfaced by --sync-after-event still reports as a fault. + + That path makes hrr_playback print its own abort line for the same + fault the runtime reports, so both lines appear in one log. + """ + text = ( + "Memory access fault by GPU node-2 (Agent handle: 0x1) on address " + "0x7f91da000000. Reason: Write access to a read-only page\n" + "[HRR] Fatal: GPU error after T0 Event 4210 (hipModuleLaunchKernel): " + "4 (hipErrorLaunchFailure) — aborting\n" + ) + finding = arf.Finding(outcome="UNKNOWN", fault_class="unknown") + arf.parse_text(text, "replay.log", finding) + self.assertEqual(finding.fault_class, "read_only_page_fault") + self.assertEqual(finding.outcome, "MAF") + + +class RecordedCaptureTests(unittest.TestCase): + """Checks against replay output recorded from a gfx950 host. + + The fixtures are unedited tool output, so a change in what hrr-playback + prints shows up here as a failing test rather than as a silently degraded + finding. + """ + + FIXTURES = SCRIPT_DIR.parent / "evals" / "fixtures" + + def _analyze(self, *names: str) -> arf.Finding: + finding = arf.Finding(outcome="UNKNOWN", fault_class="unknown") + for name in names: + path = self.FIXTURES / name + arf.parse_text(path.read_text(encoding="utf-8"), name, finding) + return arf.finalize(finding) + + def test_clean_replay_implicates_no_kernel(self) -> None: + finding = self._analyze("replay_pass.log", "info_pass.txt") + self.assertEqual(finding.outcome, "PASS") + self.assertEqual(finding.fault_class, "replay_pass") + self.assertIsNone(finding.kernel_name) + self.assertIsNone(finding.kernel_family) + + def test_clean_replay_carries_archive_totals(self) -> None: + finding = self._analyze("replay_pass.log", "info_pass.txt") + self.assertEqual(finding.archive_complete, "yes") + self.assertEqual(finding.archive_events, 185469) + self.assertEqual(finding.archive_kernels, 13233) + self.assertEqual(finding.d2h_fail, 0) + + def test_truncated_kernel_names_are_ignored(self) -> None: + """Every name in this capture's table is cut off by the column width.""" + finding = self._analyze("info_pass.txt") + self.assertEqual(finding.archive_kernel_names, []) + + def test_single_kernel_archive_attributes_the_fault(self) -> None: + finding = self._analyze("replay_memory_fault.log", "info_crash.txt") + self.assertEqual(finding.outcome, "MAF") + self.assertEqual(finding.fault_class, "illegal_memory_access") + self.assertEqual(finding.fault_address, "0x7f91da000000") + self.assertEqual(finding.kernel_name, "crash_oob") + self.assertEqual(finding.archive_complete, "no") + self.assertTrue(any("inferred from the archive" in n for n in finding.notes)) + + def test_a_crashed_replay_implicates_no_kernel(self) -> None: + """A signal death is a failed run, not a verdict on the workload. + + This archive holds exactly one kernel, so the inference that serves a + real fault would otherwise hand that kernel over as the culprit for a + crash of the replay process itself. + """ + finding = arf.Finding(outcome="UNKNOWN", fault_class="unknown") + arf.parse_text( + "[HRR] Replaying 5 events\n[triage] replay killed by signal 11\n", + "replay.log", + finding, + ) + arf.parse_text( + (self.FIXTURES / "info_crash.txt").read_text(encoding="utf-8"), + "info_crash.txt", + finding, + ) + finding = arf.finalize(finding) + self.assertEqual(finding.outcome, "ABORT") + self.assertEqual(finding.fault_class, "replay_crashed") + self.assertEqual(finding.replay_signal, 11) + self.assertIsNone(finding.kernel_name) + self.assertTrue(any("killed by signal 11" in n for n in finding.notes)) + + def test_short_memory_fault_form_still_names_the_kernel(self) -> None: + """Some ROCm builds omit `host:` and start the bracket at `GPU index:`.""" + finding = self._analyze("replay_aten_chevron.log") + self.assertEqual(finding.outcome, "MAF") + self.assertEqual(finding.fault_address, "0x7f8c11a00000") + self.assertIn("mul_kernel_cuda", finding.kernel_name or "") + + def test_aten_chevron_fault_carries_a_caveat_not_a_new_verdict(self) -> None: + """A `<<<>>>` ATen fault can be genuine, so the verdict stands. + + Capture records the pointers such kernels pass inside by-value structs + and replay translates them, so reclassifying would suppress a real + finding. An archive predating that support has none recorded, which + faults identically, so the ambiguity is flagged instead. + """ + finding = self._analyze("replay_aten_chevron.log") + self.assertEqual(finding.fault_class, "illegal_memory_access") + self.assertTrue( + any("hipLaunchByPtr" in n for n in finding.notes), + f"expected the ATen caveat, got {finding.notes}", + ) + + def test_last_launch_attributes_the_failing_event(self) -> None: + """Per-event lines are the only record when no Fatal line is written.""" + finding = self._analyze("replay_aten_chevron.log") + self.assertEqual(finding.failing_call_index, 41310) + self.assertEqual(finding.failing_api, "hipLaunchKernel") + + def test_queue_abort_is_not_a_hang(self) -> None: + """Recorded from an out-of-bounds ATen gather replayed on gfx950. + + The queue aborts with a hardware exception. Reading that as a hang + sends the reader after stalled work that never existed. + """ + finding = self._analyze("replay_queue_abort_aten.log") + self.assertNotEqual(finding.fault_class, "hang") + self.assertEqual(finding.fault_class, "replay_aborted") + self.assertEqual(finding.outcome, "ABORT") + self.assertTrue( + any("HSA_STATUS_ERROR_EXCEPTION" in n for n in finding.notes), + f"expected the raw HSA status in the notes, got {finding.notes}", + ) + + def test_queue_abort_keeps_the_kernel_it_named(self) -> None: + """That bracket carries a kernel but no faulting address.""" + finding = self._analyze("replay_queue_abort_aten.log") + self.assertIn("indexSelectSmallIndex", finding.kernel_name or "") + self.assertEqual(finding.kernel_family, "pytorch_kernel") + self.assertTrue( + any("hipLaunchByPtr" in n for n in finding.notes), + f"expected the ATen caveat, got {finding.notes}", + ) + + def test_a_stopped_replay_reports_a_hang(self) -> None: + """A hang prints nothing, so the runner's marker is the only signal.""" + finding = self._analyze("replay_hang_timeout.log") + self.assertEqual(finding.outcome, "HANG") + self.assertEqual(finding.fault_class, "hang") + self.assertIsNone(finding.kernel_name) + + def test_progress_kernel_survives_the_info_pass(self) -> None: + """The `--info` dump has no progress lines and must not erase them.""" + finding = arf.Finding(outcome="UNKNOWN", fault_class="unknown") + arf.parse_text( + '[HRR progress] elapsed_s=0.0 seq=4 kernels=1 d2h_pass=0 d2h_fail=0 ' + 'd2h_attempted=0 last="crash_oob"\n', + "replay.log", + finding, + ) + arf.parse_text( + (self.FIXTURES / "info_crash.txt").read_text(encoding="utf-8"), + "info", + finding, + ) + self.assertEqual(finding.last_progress_kernel, "crash_oob") + + def test_unreadable_archive_records_both_versions(self) -> None: + finding = self._analyze("version_mismatch.log") + self.assertEqual(finding.fault_class, "version_mismatch") + self.assertEqual(finding.archive_format_version, 3) + self.assertEqual(finding.reader_format_version, 4) + self.assertIsNone(finding.kernel_name) + if __name__ == "__main__": unittest.main() diff --git a/projects/hrr/skills/decode-and-triage/scripts/test_triage_archive.py b/projects/hrr/skills/decode-and-triage/scripts/test_triage_archive.py new file mode 100644 index 000000000000..d7524bacd920 --- /dev/null +++ b/projects/hrr/skills/decode-and-triage/scripts/test_triage_archive.py @@ -0,0 +1,233 @@ +#!/usr/bin/env python3 +"""Unit tests for triage_archive.sh (stdlib unittest, no GPU required). + +Device selection is exercised by lifting the `pick_gpu` function out of the +script and running it against recorded `rocm-smi` output, with a stub on PATH +standing in for the real tool. Picking the wrong device is not a cosmetic +mistake on a shared host: it sends the replay onto somebody else's card. +""" + +from __future__ import annotations + +import os +import re +import shutil +import subprocess +import tempfile +import unittest +from pathlib import Path + +SCRIPT_DIR = Path(__file__).resolve().parent +SCRIPT = SCRIPT_DIR / "triage_archive.sh" +FIXTURE = SCRIPT_DIR.parent / "evals" / "fixtures" / "rocm_smi_vram.txt" + + +def _shell_function(name: str) -> str: + text = SCRIPT.read_text(encoding="utf-8") + match = re.search( + rf"^{re.escape(name)}\(\)\s*\{{.*?^\}}", text, re.MULTILINE | re.DOTALL + ) + if match is None: + raise AssertionError(f"{name} not found in triage_archive.sh") + return match.group(0) + + +def _pick_gpu_function() -> str: + return _shell_function("pick_gpu") + + +@unittest.skipUnless(shutil.which("bash"), "bash is required") +class PickGpuTests(unittest.TestCase): + def _run_pick_gpu(self, smi_output: str, env_gpu: str | None = None) -> str: + with tempfile.TemporaryDirectory() as tmp: + stub_dir = Path(tmp) + data = stub_dir / "vram.txt" + data.write_text(smi_output, encoding="utf-8") + stub = stub_dir / "rocm-smi" + stub.write_text(f'#!/bin/sh\ncat "{data}"\n', encoding="utf-8") + stub.chmod(0o755) + + env = dict(os.environ) + env["PATH"] = f"{stub_dir}{os.pathsep}{env.get('PATH', '')}" + env.pop("GPU", None) + if env_gpu is not None: + env["GPU"] = env_gpu + + proc = subprocess.run( + ["bash", "-c", f"{_pick_gpu_function()}\npick_gpu"], + capture_output=True, + text=True, + env=env, + check=True, + ) + return proc.stdout.strip() + + def test_selects_the_device_with_the_most_free_memory(self) -> None: + """The freest device is neither the first nor the largest here. + + Both devices report the same total, and the first is nearly full, so a + parse that mistakes total for free selects the wrong one. + """ + self.assertEqual( + self._run_pick_gpu(FIXTURE.read_text(encoding="utf-8")), "1" + ) + + def test_used_line_is_not_read_as_the_total_line(self) -> None: + """`VRAM Total Used Memory` also contains the word `Total`.""" + smi = ( + "GPU[0]\t\t: VRAM Total Memory (B): 100\n" + "GPU[0]\t\t: VRAM Total Used Memory (B): 90\n" + "GPU[1]\t\t: VRAM Total Memory (B): 100\n" + "GPU[1]\t\t: VRAM Total Used Memory (B): 10\n" + ) + self.assertEqual(self._run_pick_gpu(smi), "1") + + def test_explicit_gpu_env_wins(self) -> None: + self.assertEqual( + self._run_pick_gpu(FIXTURE.read_text(encoding="utf-8"), env_gpu="0"), "0" + ) + + +class ReplayMaskTests(unittest.TestCase): + def test_native_replay_masks_with_hip_visible_devices(self) -> None: + """hrr-playback is a HIP program, so the HIP mask is the one that applies. + + Setting ROCR_VISIBLE_DEVICES re-indexes devices underneath a HIP mask, + which can place the replay on a device other than the one picked. The + Windows and container paths already use the HIP mask. + """ + text = SCRIPT.read_text(encoding="utf-8") + self.assertIn('HIP_VISIBLE_DEVICES="$gpu"', text) + assignments = [ + line.strip() + for line in text.splitlines() + if "ROCR_VISIBLE_DEVICES=" in line + ] + self.assertEqual(assignments, [], "ROCR_VISIBLE_DEVICES must not be set") + + +def _bash_at_least(major: int, minor: int) -> bool: + """The scripts target Linux bash. Expanding an empty array under `set -u` + is an error before bash 4.4, which the macOS system bash still is.""" + bash = shutil.which("bash") + if not bash: + return False + out = subprocess.run( + [bash, "-c", "echo ${BASH_VERSINFO[0]}.${BASH_VERSINFO[1]}"], + capture_output=True, + text=True, + ).stdout.strip() + try: + got_major, got_minor = (int(part) for part in out.split(".")[:2]) + except ValueError: + return False + return (got_major, got_minor) >= (major, minor) + + +@unittest.skipUnless(shutil.which("bash"), "bash is required") +class RecordReplayStopTests(unittest.TestCase): + """A stop the replay does not explain itself has to reach the log. + + Both cases end the log mid-stream. Without the marker the analyzer reads + that truncation as insufficient signal and then looks for a kernel to + blame, which reports a crash of the replay as a fault in the workload. + """ + + def _record(self, rc: int) -> str: + with tempfile.TemporaryDirectory() as tmp: + log = Path(tmp) / "replay.log" + log.write_text("[HRR] Replaying 5 events\n", encoding="utf-8") + script = ( + f'{_shell_function("record_replay_stop")}\n' + f'record_replay_stop {rc} "{log}" >/dev/null\n' + ) + subprocess.run(["bash", "-c", script], check=True) + return log.read_text(encoding="utf-8") + + def test_a_timeout_is_recorded_as_a_timeout(self) -> None: + self.assertIn("replay timed out after", self._record(124)) + + def test_a_signal_death_is_recorded_with_its_signal(self) -> None: + self.assertIn("replay killed by signal 11", self._record(139)) + + def test_an_ordinary_failure_adds_nothing(self) -> None: + """A replay that exits with an error has already said why in the log.""" + self.assertEqual(self._record(1), "[HRR] Replaying 5 events\n") + + +@unittest.skipUnless(shutil.which("bash"), "bash is required") +class LibraryPathTests(unittest.TestCase): + def test_packaged_playback_puts_its_own_lib_on_the_path(self) -> None: + """A playback shipped as bin/ and lib/ siblings, not a CLR build tree. + + Without its own lib dir the binary loads the system libamdhip64 and + fails on the symbols it was built against, which takes out the + metadata-only path as well as replay. + """ + with tempfile.TemporaryDirectory() as tmp: + root = Path(tmp) + (root / "bin").mkdir() + (root / "lib").mkdir() + play = root / "bin" / "hrr-playback" + play.write_text("#!/bin/sh\nexit 0\n", encoding="utf-8") + play.chmod(0o755) + + env = dict(os.environ) + env["ROCM_PATH"] = str(root / "absent") + env.pop("LD_LIBRARY_PATH", None) + + script = ( + f'SCRIPT_DIR={root}\nROCM_PATH="${{ROCM_PATH}}"\n' + f'{_shell_function("setup_library_path")}\n' + f'setup_library_path "{play}"\necho "$LD_LIBRARY_PATH"\n' + ) + proc = subprocess.run( + ["bash", "-c", script], + capture_output=True, + text=True, + env=env, + check=True, + ) + self.assertIn(str(root / "lib"), proc.stdout.strip()) + + +@unittest.skipUnless(_bash_at_least(4, 4), "needs bash >= 4.4 (Linux target)") +class EnsurePlaybackTests(unittest.TestCase): + def test_existing_playback_is_returned_outside_a_clr_tree(self) -> None: + """A provided binary must be usable where no CLR source tree exists. + + The script runs under `set -e`, so a helper whose last statement is a + false conditional aborts it before the path is printed, and the caller + reports a build failure even though the binary was there all along. + """ + with tempfile.TemporaryDirectory() as tmp: + root = Path(tmp) + scripts = root / "scripts" + scripts.mkdir() + shutil.copy(SCRIPT_DIR / "ensure_playback.sh", scripts) + + play = root / "bin" / "hrr-playback" + play.parent.mkdir() + play.write_text("#!/bin/sh\nexit 0\n", encoding="utf-8") + play.chmod(0o755) + + env = dict(os.environ) + env["HRR_PLAYBACK"] = str(play) + env["ROCM_PATH"] = str(root / "absent") + for stale in ("CLR_BUILD", "CLR_ROOT", "HRR_ROOT", "ROCR_LIB"): + env.pop(stale, None) + + proc = subprocess.run( + ["bash", str(scripts / "ensure_playback.sh"), "--build"], + capture_output=True, + text=True, + env=env, + ) + self.assertEqual( + proc.returncode, 0, f"ensure_playback failed: {proc.stderr}" + ) + self.assertEqual(proc.stdout.strip(), str(play)) + + +if __name__ == "__main__": + unittest.main() diff --git a/projects/hrr/skills/decode-and-triage/scripts/triage_archive.sh b/projects/hrr/skills/decode-and-triage/scripts/triage_archive.sh index bab581fac2f0..d73d88ffb1c5 100755 --- a/projects/hrr/skills/decode-and-triage/scripts/triage_archive.sh +++ b/projects/hrr/skills/decode-and-triage/scripts/triage_archive.sh @@ -11,6 +11,7 @@ COMPAT="$SCRIPT_DIR/check_replay_compat.py" ARCHIVE="" REPLAY_MODE="auto" +NO_SYNC=0 OUTPUT="" FORMAT="markdown" @@ -22,6 +23,7 @@ Options: --archive PATH pid-* HRR archive directory (required) --replay [MODE] Replay mode: native, docker, auto (default), or bare --replay (= native) --no-replay Metadata / --info only (no GPU replay or preflight block on replay) + --no-sync Replay without --sync-after-launch (faster, but a fault is not attributed) -o, --output PATH Write finding to PATH (default: HRR_TRIAGE_WORKDIR/-.finding.md) --format FORMAT markdown (default) or json -h, --help Show this help @@ -31,6 +33,7 @@ Environment (common): HRR_DOCKER_IMAGE Docker image for --replay docker / auto HRR_DOCKER_MOUNT_CLR=1 Overlay host CLR for docker replay (dev builds) GPU Replay GPU ordinal (default: auto-pick) + HRR_REPLAY_TIMEOUT Seconds before a stalled replay is stopped (default 1800, 0 disables) HRR_CONTINUE=1 Proceed after preflight HIP/comgr mismatch prompt HRR_SKIP_COMPAT=1 Skip manifest preflight EOF @@ -44,6 +47,7 @@ while [[ $# -gt 0 ]]; do if [[ $# -lt 2 || "$2" == --* ]]; then REPLAY_MODE="native"; shift else REPLAY_MODE="$2"; shift 2; fi ;; --no-replay) REPLAY_MODE="skip"; shift ;; + --no-sync) NO_SYNC=1; shift ;; -o|--output) OUTPUT="$2"; shift 2 ;; --format) FORMAT="$2"; shift 2 ;; *) echo "error: unknown arg: $1" >&2; exit 1 ;; @@ -76,6 +80,12 @@ setup_library_path() { if [[ "$bin_dir" == */bin ]]; then lib_dirs+=("$(cd "$bin_dir/../lib" 2>/dev/null && pwd || true)") fi + # A packaged playback ships as bin/ and lib/ siblings rather than inside a + # build tree. Without this its libamdhip64 is never on the path, so the + # binary loads the system one and fails on the symbols it was built against. + if [[ -d "$bin_dir/../lib" ]]; then + lib_dirs+=("$(cd "$bin_dir/../lib" && pwd)") + fi repo="$(cd "$SCRIPT_DIR/../../../../.." 2>/dev/null && pwd || true)" for p in "${ROCR_LIB:-}" "${repo:+$repo/projects/rocr-runtime/build-local/rocr/lib}"; do [[ -n "$p" && -f "$p/libhsa-runtime64.so.1" ]] || continue @@ -99,25 +109,80 @@ pick_gpu() { [[ -n "$idx" ]] || continue (( free > best_free )) && { best_free=$free; best=$idx; } done < <(rocm-smi --showmeminfo vram 2>/dev/null | awk ' - /GPU\[/ { gsub(/[^0-9]/,"",$1); idx=$1 } - /Used Memory/ { used=$NF } - /Total Memory/ { total=$NF; if (idx!="") { print idx, total-used; idx="" } }') + # The used line reads "VRAM Total Used Memory", so it also contains the + # word Total and must be tested first. Total and used arrive on separate + # lines whose order is not guaranteed, so collect both per device and + # subtract at END rather than on whichever line happens to land last. + /GPU\[/ { + id = $1; gsub(/[^0-9]/, "", id) + if ($0 ~ /Total Used Memory/) used[id] = $NF + else if ($0 ~ /Total Memory/) total[id] = $NF + } + END { + for (id in total) + if (id in used) print id, total[id] - used[id] + }') [[ -n "$best" ]] && { echo "[triage] GPU $best (most free VRAM)" >&2; echo "$best"; return; } fi echo "0" } +replay_sync_args() { + # Default replay serializes the GPU once at the end, so a fault is reported + # but not attributed to a launch: the finding then has no failing event and + # no kernel. Synchronizing after every launch is what makes the last launch + # line before the fault the culprit. Opt out with --no-sync when throughput + # matters more than attribution, for instance a long soak. + [[ "$NO_SYNC" == "1" ]] && return 0 + echo "--sync-after-launch" +} + +# A stop the replay does not explain itself has to be recorded here, because +# the log just ends where the process died. The analyzer would read that +# truncation as insufficient signal and then go looking for a kernel to blame +# for it, which is how a crash of the replay process ends up reported as a +# workload fault. 124 is what `timeout` reports; above 128 the shell is +# reporting death by signal 128+N. A signal is not on its own a verdict: a GPU +# memory fault also aborts, and there the log's own fault line is the better +# answer, so the classifier ranks these markers last. +record_replay_stop() { + local rc="$1" log="$2" + [[ -n "$log" ]] || return 0 + if [[ "$rc" == "124" ]]; then + echo "[triage] replay timed out after ${HRR_REPLAY_TIMEOUT:-1800}s" | tee -a "$log" + elif (( rc > 128 )); then + echo "[triage] replay killed by signal $((rc - 128))" | tee -a "$log" + fi +} + run_native_replay() { - local play="$1" log="$2" gpu + local play="$1" log="$2" gpu sync_args=() setup_library_path "$play" gpu="$(pick_gpu)" [[ -r /dev/kfd ]] || { echo "error: /dev/kfd not accessible" >&2; return 1; } - echo "[triage] native replay playback=$play GPU=$gpu" >&2 + read -r -a sync_args <<< "$(replay_sync_args)" + # A hung workload replays as a hang, and without a bound the replay never + # returns, so the analyzer never runs and the archive yields no finding at + # all. The bound belongs here, around the playback process: wrapping the + # container instead leaves the replay running inside it. Set + # HRR_REPLAY_TIMEOUT=0 to disable. + local timeout_s="${HRR_REPLAY_TIMEOUT:-1800}" runner=() + if [[ "$timeout_s" != "0" ]] && command -v timeout >/dev/null 2>&1; then + runner=(timeout "$timeout_s") + fi + echo "[triage] native replay playback=$play GPU=$gpu ${sync_args[*]}" >&2 set +e - ROCR_VISIBLE_DEVICES="$gpu" HIP_HRR_REPLAY_PROGRESS_SECONDS="${HIP_HRR_REPLAY_PROGRESS_SECONDS:-30}" \ - "$play" "$ARCHIVE" 2>&1 | tee "$log" + # hrr-playback is a HIP program, so HIP_VISIBLE_DEVICES is the mask that + # applies to it. Setting ROCR_VISIBLE_DEVICES re-indexes devices underneath a + # HIP mask, which can land the replay on a device other than the one picked. + HIP_VISIBLE_DEVICES="$gpu" HIP_HRR_REPLAY_PROGRESS_SECONDS="${HIP_HRR_REPLAY_PROGRESS_SECONDS:-30}" \ + ${runner[@]+"${runner[@]}"} "$play" "$ARCHIVE" ${sync_args[@]+"${sync_args[@]}"} 2>&1 | tee "$log" local rc=${PIPESTATUS[0]} - set -e + # Deliberately not re-enabling `set -e` here. The caller wraps this call in + # `set +e` precisely so a failing replay is survivable, and restores `set -e` + # afterwards. Re-arming it inside the function made the non-zero return fatal, + # so a replay that faulted killed the script before the finding was written: + # the skill produced nothing in exactly the case it exists for. echo "[triage] native replay exit=$rc" >&2 return "$rc" } @@ -172,6 +237,19 @@ if [[ "$mode" != "skip" && "$mode" == "native" && -x "$ENSURE" ]]; then exit 1 } export HRR_PLAYBACK +elif [[ "$mode" == "skip" && -x "$ENSURE" ]]; then + # Metadata-only still wants `hrr-playback --info`, which needs no GPU. Locate + # without --build so this never tries to compile; if there is no binary the + # analyzer simply reports the archive path, as before. + # Not a trailing `&&`: as the last statement of this branch it would become + # the `if` statement's exit status and, under `set -e`, end the script. + HRR_PLAYBACK="$("$ENSURE" 2>/dev/null || true)" + if [[ -n "$HRR_PLAYBACK" ]]; then + export HRR_PLAYBACK + # The library path is otherwise only prepared inside the native replay, so + # without this the analyzer finds the binary and then cannot load it. + setup_library_path "$HRR_PLAYBACK" + fi elif [[ "$mode" == "docker" && "${HRR_DOCKER_MOUNT_CLR:-0}" == "1" && -x "$ENSURE" ]]; then HRR_PLAYBACK="$("$ENSURE" --build)" || { echo "error: ensure_playback.sh --build failed for HRR_DOCKER_MOUNT_CLR=1" >&2 @@ -180,18 +258,23 @@ elif [[ "$mode" == "docker" && "${HRR_DOCKER_MOUNT_CLR:-0}" == "1" && -x "$ENSUR export HRR_PLAYBACK fi -REPLAY_GPU="${GPU:-$(pick_gpu)}" +REPLAY_GPU="" if [[ "$mode" != "skip" ]]; then + # Only when a device is actually going to be used: metadata-only needs no GPU + # and should not announce a choice it never makes. + REPLAY_GPU="${GPU:-$(pick_gpu)}" run_replay_preflight "$mode" "$REPLAY_GPU" fi if [[ "$mode" == "docker" ]]; then LOG="$WORKDIR/hrr-replay-${name}-${ts}.log" - set +e; "$REPLAY_DOCKER" --archive "$ARCHIVE" --log "$LOG" --gpu "$REPLAY_GPU"; set -e + set +e; "$REPLAY_DOCKER" --archive "$ARCHIVE" --log "$LOG" --gpu "$REPLAY_GPU"; replay_rc=$?; set -e + record_replay_stop "$replay_rc" "$LOG" elif [[ "$mode" == "native" ]]; then LOG="$WORKDIR/hrr-replay-${name}-${ts}.log" GPU="$REPLAY_GPU" - set +e; run_native_replay "$HRR_PLAYBACK" "$LOG"; set -e + set +e; run_native_replay "$HRR_PLAYBACK" "$LOG"; replay_rc=$?; set -e + record_replay_stop "$replay_rc" "$LOG" fi CMD=(python3 "$ANALYZER" --format "$FORMAT" --archive "$ARCHIVE" -o "$FINDING") From b9a902d3b5dbcd71bbc4ee6cecf827be47235702 Mon Sep 17 00:00:00 2001 From: Daniel Olsson <113136742+danielbolsson@users.noreply.github.com> Date: Wed, 9 Sep 2026 14:02:46 +0200 Subject: [PATCH 10/10] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .../hrr/skills/decode-and-triage/scripts/triage_archive.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/hrr/skills/decode-and-triage/scripts/triage_archive.sh b/projects/hrr/skills/decode-and-triage/scripts/triage_archive.sh index d73d88ffb1c5..fef7d83460fd 100755 --- a/projects/hrr/skills/decode-and-triage/scripts/triage_archive.sh +++ b/projects/hrr/skills/decode-and-triage/scripts/triage_archive.sh @@ -149,9 +149,9 @@ record_replay_stop() { local rc="$1" log="$2" [[ -n "$log" ]] || return 0 if [[ "$rc" == "124" ]]; then - echo "[triage] replay timed out after ${HRR_REPLAY_TIMEOUT:-1800}s" | tee -a "$log" + echo "[triage] replay timed out after ${HRR_REPLAY_TIMEOUT:-1800}s" | tee -a "$log" >&2 elif (( rc > 128 )); then - echo "[triage] replay killed by signal $((rc - 128))" | tee -a "$log" + echo "[triage] replay killed by signal $((rc - 128))" | tee -a "$log" >&2 fi }