Skip to content

Commit

Permalink
Fix review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kurapov-peter committed Jan 28, 2025
1 parent a6bf8e2 commit e6b61c6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 4 additions & 0 deletions include/ur_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -5999,6 +5999,10 @@ typedef enum ur_kernel_info_t {
UR_KERNEL_INFO_NUM_REGS = 6,
/// [uint32_t[]][optional-query] Return the spill memory size allocated by
/// the compiler.
/// The returned values correspond to the associated devices.
/// The order of the devices is guaranteed (i.e., the same as queried by
/// `urDeviceGet`) by the UR within a single application even if the runtime
/// is reinitialized.
UR_KERNEL_INFO_SPILL_MEM_SIZE = 7,
/// @cond
UR_KERNEL_INFO_FORCE_UINT32 = 0x7fffffff
Expand Down
10 changes: 6 additions & 4 deletions source/adapters/level_zero/kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -751,10 +751,12 @@ ur_result_t urKernelGetInfo(
case UR_KERNEL_INFO_NUM_REGS:
case UR_KERNEL_INFO_NUM_ARGS:
return ReturnValue(uint32_t{Kernel->ZeKernelProperties->numKernelArgs});
case UR_KERNEL_INFO_SPILL_MEM_SIZE:
return ReturnValue(static_cast<const uint32_t *>(
&(Kernel->ZeKernelProperties->spillMemSize)),
1ul);
case UR_KERNEL_INFO_SPILL_MEM_SIZE: {
std::vector<uint32_t> spills = {
uint32_t{Kernel->ZeKernelProperties->spillMemSize}};
return ReturnValue(static_cast<const uint32_t *>(spills.data()),
spills.size());
}
case UR_KERNEL_INFO_REFERENCE_COUNT:
return ReturnValue(uint32_t{Kernel->RefCount.load()});
case UR_KERNEL_INFO_ATTRIBUTES:
Expand Down
2 changes: 1 addition & 1 deletion test/conformance/kernel/urKernelGetInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ TEST_P(urKernelGetInfoTest, SuccessSpillMemSize) {
property_name);
ASSERT_EQ(property_size, sizeof(uint32_t));

std::vector<char> property_value(property_size);
std::vector<uint32_t> property_value(property_size / sizeof(uint32_t));
ASSERT_SUCCESS(urKernelGetInfo(kernel, property_name, property_size,
property_value.data(), nullptr));
}
Expand Down

0 comments on commit e6b61c6

Please sign in to comment.