From 43d5712dcb60f01a3a7bab364ff88958d7c03c4d Mon Sep 17 00:00:00 2001 From: Vladimir Indic <139573562+vlaindic@users.noreply.github.com> Date: Tue, 12 Dec 2023 17:36:38 +0100 Subject: [PATCH] AmdExtTable updated (#292) * AmdExtTable updated * hsa_amd_agent_set_async_scratch_limit introduced * source formatting (clang-format v11) (#294) Co-authored-by: vlaindic --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: vlaindic [ROCm/rocprofiler-sdk commit: 0666f6a197ee49e92a2c1ae65d271b2801de1775] --- .../source/include/rocprofiler-sdk/hsa/api_args.h | 7 +++++++ .../source/include/rocprofiler-sdk/hsa/api_id.h | 3 +++ .../source/lib/rocprofiler-sdk/hsa/hsa.def.cpp | 8 ++++++++ .../source/lib/rocprofiler-sdk/hsa/types.hpp | 4 ++-- 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/projects/rocprofiler-sdk/source/include/rocprofiler-sdk/hsa/api_args.h b/projects/rocprofiler-sdk/source/include/rocprofiler-sdk/hsa/api_args.h index ea192ad89f..476ea83e49 100644 --- a/projects/rocprofiler-sdk/source/include/rocprofiler-sdk/hsa/api_args.h +++ b/projects/rocprofiler-sdk/source/include/rocprofiler-sdk/hsa/api_args.h @@ -1305,5 +1305,12 @@ typedef union rocprofiler_hsa_api_args_u hsa_amd_memory_pool_t* pool; hsa_amd_memory_type_t* type; } hsa_amd_vmem_get_alloc_properties_from_handle; +# if HSA_AMD_EXT_API_TABLE_STEP_VERSION >= 0x01 + struct + { + hsa_agent_t agent; + size_t threshold; + } hsa_amd_agent_set_async_scratch_limit; +# endif #endif } rocprofiler_hsa_api_args_t; diff --git a/projects/rocprofiler-sdk/source/include/rocprofiler-sdk/hsa/api_id.h b/projects/rocprofiler-sdk/source/include/rocprofiler-sdk/hsa/api_id.h index d9d76c0b98..cd11316857 100644 --- a/projects/rocprofiler-sdk/source/include/rocprofiler-sdk/hsa/api_id.h +++ b/projects/rocprofiler-sdk/source/include/rocprofiler-sdk/hsa/api_id.h @@ -242,6 +242,9 @@ typedef enum // NOLINT(performance-enum-size) ROCPROFILER_HSA_API_ID_hsa_amd_vmem_import_shareable_handle, ROCPROFILER_HSA_API_ID_hsa_amd_vmem_retain_alloc_handle, ROCPROFILER_HSA_API_ID_hsa_amd_vmem_get_alloc_properties_from_handle, +# if HSA_AMD_EXT_API_TABLE_STEP_VERSION >= 0x01 + ROCPROFILER_HSA_API_ID_hsa_amd_agent_set_async_scratch_limit, +# endif #endif ROCPROFILER_HSA_API_ID_LAST, diff --git a/projects/rocprofiler-sdk/source/lib/rocprofiler-sdk/hsa/hsa.def.cpp b/projects/rocprofiler-sdk/source/lib/rocprofiler-sdk/hsa/hsa.def.cpp index cb14e2ecb2..f11aa56388 100644 --- a/projects/rocprofiler-sdk/source/lib/rocprofiler-sdk/hsa/hsa.def.cpp +++ b/projects/rocprofiler-sdk/source/lib/rocprofiler-sdk/hsa/hsa.def.cpp @@ -313,6 +313,14 @@ HSA_API_INFO_DEFINITION_V(ROCPROFILER_HSA_API_TABLE_ID_AmdExt, alloc_handle, pool, type) +# if HSA_AMD_EXT_API_TABLE_STEP_VERSION >= 0x01 +HSA_API_INFO_DEFINITION_V(ROCPROFILER_HSA_API_TABLE_ID_AmdExt, + ROCPROFILER_HSA_API_ID_hsa_amd_agent_set_async_scratch_limit, + hsa_amd_agent_set_async_scratch_limit, + hsa_amd_agent_set_async_scratch_limit_fn, + agent, + threshold) +# endif # endif #else diff --git a/projects/rocprofiler-sdk/source/lib/rocprofiler-sdk/hsa/types.hpp b/projects/rocprofiler-sdk/source/lib/rocprofiler-sdk/hsa/types.hpp index e0f9f1566f..b257902db6 100644 --- a/projects/rocprofiler-sdk/source/lib/rocprofiler-sdk/hsa/types.hpp +++ b/projects/rocprofiler-sdk/source/lib/rocprofiler-sdk/hsa/types.hpp @@ -124,7 +124,7 @@ static_assert(HSA_IMAGE_API_TABLE_MAJOR_VERSION == 0x02, static_assert(HSA_CORE_API_TABLE_STEP_VERSION == 0x00, "Change in the major version of HSA core API table"); -static_assert(HSA_AMD_EXT_API_TABLE_STEP_VERSION == 0x00, +static_assert(HSA_AMD_EXT_API_TABLE_STEP_VERSION == 0x01, "Change in the major version of HSA amd-extended API table"); static_assert(HSA_FINALIZER_API_TABLE_STEP_VERSION == 0x00, "Change in the major version of HSA finalizer API table"); @@ -152,7 +152,7 @@ struct table_size { static constexpr size_t finalizer_ext = 64; static constexpr size_t image_ext = 120; - static constexpr size_t amd_ext = 552; + static constexpr size_t amd_ext = 560; static constexpr size_t core_api_ext = 1016; };