Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,9 @@ ROCPROFILER_ENUM_LABEL(ROCPROFILER_HSA_AMD_EXT_API_ID_hsa_amd_ais_file_read);
ROCPROFILER_ENUM_LABEL(ROCPROFILER_HSA_AMD_EXT_API_ID_hsa_amd_counted_queue_acquire);
ROCPROFILER_ENUM_LABEL(ROCPROFILER_HSA_AMD_EXT_API_ID_hsa_amd_counted_queue_release);
# endif
# if HSA_AMD_EXT_API_TABLE_STEP_VERSION >= 0x0A
ROCPROFILER_ENUM_LABEL(ROCPROFILER_HSA_AMD_EXT_API_ID_hsa_amd_memory_async_batch_copy);
# endif
#endif

#if HSA_AMD_EXT_API_TABLE_MAJOR_VERSION == 0x01
Expand All @@ -426,6 +429,8 @@ static_assert(ROCPROFILER_HSA_AMD_EXT_API_ID_LAST == 74);
static_assert(ROCPROFILER_HSA_AMD_EXT_API_ID_LAST == 76);
# elif HSA_AMD_EXT_API_TABLE_STEP_VERSION == 0x09
static_assert(ROCPROFILER_HSA_AMD_EXT_API_ID_LAST == 78);
# elif HSA_AMD_EXT_API_TABLE_STEP_VERSION == 0x0A
static_assert(ROCPROFILER_HSA_AMD_EXT_API_ID_LAST == 79);
# else
# if !defined(ROCPROFILER_UNSAFE_NO_VERSION_CHECK) && \
(defined(ROCPROFILER_CI) && ROCPROFILER_CI > 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ typedef enum rocprofiler_hsa_amd_ext_api_id_t // NOLINT(performance-enum-size)
ROCPROFILER_HSA_AMD_EXT_API_ID_hsa_amd_counted_queue_acquire,
ROCPROFILER_HSA_AMD_EXT_API_ID_hsa_amd_counted_queue_release,
# endif
# if HSA_AMD_EXT_API_TABLE_STEP_VERSION >= 0x0A
ROCPROFILER_HSA_AMD_EXT_API_ID_hsa_amd_memory_async_batch_copy,
# endif
#endif

ROCPROFILER_HSA_AMD_EXT_API_ID_LAST,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1480,6 +1480,15 @@ typedef union rocprofiler_hsa_api_args_t
hsa_queue_t* queue;
} hsa_amd_counted_queue_release;
# endif
# if HSA_AMD_EXT_API_TABLE_STEP_VERSION >= 0x0A
struct
{
const hsa_amd_memory_copy_op_t* copy_ops;
uint32_t num_copy_ops;
uint32_t num_dep_signals;
const hsa_signal_t* dep_signals;
} hsa_amd_memory_async_batch_copy;
# endif
#endif
} rocprofiler_hsa_api_args_t;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ ROCP_SDK_ENFORCE_ABI_VERSIONING(::AmdExtTable, 75);
ROCP_SDK_ENFORCE_ABI_VERSIONING(::AmdExtTable, 77);
#elif HSA_AMD_EXT_API_TABLE_STEP_VERSION == 0x09
ROCP_SDK_ENFORCE_ABI_VERSIONING(::AmdExtTable, 79);
#elif HSA_AMD_EXT_API_TABLE_STEP_VERSION == 0x0A
ROCP_SDK_ENFORCE_ABI_VERSIONING(::AmdExtTable, 80);
#else
INTERNAL_CI_ROCP_SDK_ENFORCE_ABI_VERSIONING(::AmdExtTable, 0);
#endif
Expand Down Expand Up @@ -305,6 +307,9 @@ ROCP_SDK_ENFORCE_ABI(::AmdExtTable, hsa_amd_ais_file_read_fn, 76);
ROCP_SDK_ENFORCE_ABI(::AmdExtTable, hsa_amd_counted_queue_acquire_fn, 77);
ROCP_SDK_ENFORCE_ABI(::AmdExtTable, hsa_amd_counted_queue_release_fn, 78);
#endif
#if HSA_AMD_EXT_API_TABLE_STEP_VERSION >= 0x0A
ROCP_SDK_ENFORCE_ABI(::AmdExtTable, hsa_amd_memory_async_batch_copy_fn, 79);
#endif

ROCP_SDK_ENFORCE_ABI(::ImageExtTable, hsa_ext_image_get_capability_fn, 1);
ROCP_SDK_ENFORCE_ABI(::ImageExtTable, hsa_ext_image_data_get_info_fn, 2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,4 +188,125 @@ struct formatter<hsa_amd_ais_file_handle_t>
}
};
#endif
#if HSA_AMD_EXT_API_TABLE_STEP_VERSION >= 0x0A
template <>
struct formatter<hsa_amd_memory_copy_op_type_t>
{
template <typename ParseContext>
constexpr auto parse(ParseContext& ctx)
{
return ctx.begin();
}

template <typename FormatContext>
auto format(hsa_amd_memory_copy_op_type_t const& op, FormatContext& ctx) const
{
switch(op)
{
case HSA_AMD_MEMORY_COPY_OP_LINEAR:
return fmt::format_to(ctx.out(), "HSA_AMD_MEMORY_COPY_OP_LINEAR");
case HSA_AMD_MEMORY_COPY_OP_LINEAR_BROADCAST:
return fmt::format_to(ctx.out(), "HSA_AMD_MEMORY_COPY_OP_LINEAR_BROADCAST");
case HSA_AMD_MEMORY_COPY_OP_LINEAR_SWAP:
return fmt::format_to(ctx.out(), "HSA_AMD_MEMORY_COPY_OP_LINEAR_SWAP");
case HSA_AMD_MEMORY_COPY_OP_LINEAR_INDIRECT:
return fmt::format_to(ctx.out(), "HSA_AMD_MEMORY_COPY_OP_LINEAR_INDIRECT");
default:
return fmt::format_to(
ctx.out(),
"hsa_amd_memory_copy_op_type_t({})",
static_cast<std::underlying_type_t<hsa_amd_memory_copy_op_type_t>>(op));
}
}
};

template <>
struct formatter<hsa_amd_memory_copy_op_t>
{
template <typename ParseContext>
constexpr auto parse(ParseContext& ctx)
{
return ctx.begin();
}

template <typename FormatContext>
auto format(hsa_amd_memory_copy_op_t const& op, FormatContext& ctx) const
{
auto out = fmt::format_to(ctx.out(),
"[MEMORY_COPY_OP type={}, version={}, num_dsts={}, "
"traffic_class={}, completion_signal={}",
op.type,
op.version,
op.num_dsts,
op.traffic_class,
op.completion_signal.handle);

switch(op.type)
{
case HSA_AMD_MEMORY_COPY_OP_LINEAR:
out = fmt::format_to(out,
", src={}, src_agent={}, dst={}, dst_agent={}, "
"size={}, unused_size={}",
fmt::ptr(op.src),
op.src_agent.handle,
fmt::ptr(op.dst),
op.dst_agent.handle,
op.size,
op.unused_size);
break;
case HSA_AMD_MEMORY_COPY_OP_LINEAR_BROADCAST:
out = fmt::format_to(
out,
", src={}, src_agent={}, dst_list={}, dst_agent_list={}, size={}",
fmt::ptr(op.src),
op.src_agent.handle,
fmt::ptr(op.dst_list),
fmt::ptr(op.dst_agent_list),
op.size);
break;
case HSA_AMD_MEMORY_COPY_OP_LINEAR_SWAP:
out = fmt::format_to(out,
", src={}, src_agent={}, dst={}, dst_agent={}, "
"src_size={}, dst_size={}",
fmt::ptr(op.src),
op.src_agent.handle,
fmt::ptr(op.dst),
op.dst_agent.handle,
op.src_size,
op.dst_size);
break;
case HSA_AMD_MEMORY_COPY_OP_LINEAR_INDIRECT:
out = fmt::format_to(out,
", src_ptr={}, src_agent={}, dst_ptr={}, dst_agent={}, "
"size={}, unused_size={}",
fmt::ptr(op.src),
op.src_agent.handle,
fmt::ptr(op.dst),
op.dst_agent.handle,
op.size,
op.unused_size);
break;
default:
out = fmt::format_to(out,
", src={}, src_agent={}, dst={}, dst_agent={}, "
"size={}, unused_size={}",
fmt::ptr(op.src),
op.src_agent.handle,
fmt::ptr(op.dst),
op.dst_agent.handle,
op.size,
op.unused_size);
break;
}

if(op.reserved[0] != 0 || op.reserved[1] != 0 || op.reserved[2] != 0)
{
out = fmt::format_to(
out, ", reserved=[{},{},{}]", op.reserved[0], op.reserved[1], op.reserved[2]);
}

return fmt::format_to(out, "]");
}
};
#endif
} // namespace fmt
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,16 @@ HSA_API_INFO_DEFINITION_V(ROCPROFILER_HSA_TABLE_ID_AmdExt,
hsa_amd_counted_queue_release_fn,
queue)
# endif
# if HSA_AMD_EXT_API_TABLE_STEP_VERSION >= 0x0A
HSA_API_INFO_DEFINITION_V(ROCPROFILER_HSA_TABLE_ID_AmdExt,
ROCPROFILER_HSA_AMD_EXT_API_ID_hsa_amd_memory_async_batch_copy,
hsa_amd_memory_async_batch_copy,
hsa_amd_memory_async_batch_copy_fn,
copy_ops,
num_copy_ops,
num_dep_signals,
dep_signals)
# endif
# endif

#elif defined(ROCPROFILER_LIB_ROCPROFILER_HSA_ASYNC_COPY_CPP_IMPL) && \
Expand Down
Loading