Skip to content

Commit

Permalink
Merge pull request #2236 from againull/fix_attr
Browse files Browse the repository at this point in the history
[L0] Fix UR_KERNEL_INFO_ATTRIBUTES returned value
  • Loading branch information
pbalcer authored Oct 25, 2024
2 parents d3a518a + 164d115 commit 66f0dbf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion source/adapters/level_zero/kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ ur_result_t urKernelGetInfo(
char *attributes = new char[Size];
ZE2UR_CALL(zeKernelGetSourceAttributes,
(Kernel->ZeKernel, &Size, &attributes));
auto Res = ReturnValue(attributes);
auto Res = ReturnValue(static_cast<const char *>(attributes));
delete[] attributes;
return Res;
} catch (const std::bad_alloc &) {
Expand Down
16 changes: 16 additions & 0 deletions test/conformance/kernel/urKernelGetInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,22 @@ TEST_P(urKernelGetInfoTest, Success) {
ASSERT_GT(*returned_reference_count, 0U);
break;
}
case UR_KERNEL_INFO_ATTRIBUTES: {
auto returned_attributes = std::string(property_value.data());
ur_platform_backend_t backend;
ASSERT_SUCCESS(urPlatformGetInfo(platform, UR_PLATFORM_INFO_BACKEND,
sizeof(backend), &backend, nullptr));
if (backend == UR_PLATFORM_BACKEND_OPENCL ||
backend == UR_PLATFORM_BACKEND_LEVEL_ZERO) {
// Older intel drivers don't attach any default attributes and newer ones force walk order to X/Y/Z using special attribute.
ASSERT_TRUE(returned_attributes.empty() ||
returned_attributes ==
"intel_reqd_workgroup_walk_order(0,1,2)");
} else {
ASSERT_TRUE(returned_attributes.empty());
}
break;
}
default:
break;
}
Expand Down

0 comments on commit 66f0dbf

Please sign in to comment.