Skip to content

Commit 1b0fe32

Browse files
authored
Merge pull request #2236 from againull/fix_attr
[L0] Fix UR_KERNEL_INFO_ATTRIBUTES returned value
2 parents 4740e27 + 2645cb6 commit 1b0fe32

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

source/adapters/level_zero/kernel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ ur_result_t urKernelGetInfo(
746746
char *attributes = new char[Size];
747747
ZE2UR_CALL(zeKernelGetSourceAttributes,
748748
(Kernel->ZeKernel, &Size, &attributes));
749-
auto Res = ReturnValue(attributes);
749+
auto Res = ReturnValue(static_cast<const char *>(attributes));
750750
delete[] attributes;
751751
return Res;
752752
} catch (const std::bad_alloc &) {

test/conformance/kernel/urKernelGetInfo.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,22 @@ TEST_P(urKernelGetInfoTest, Success) {
4646
ASSERT_GT(*returned_reference_count, 0U);
4747
break;
4848
}
49+
case UR_KERNEL_INFO_ATTRIBUTES: {
50+
auto returned_attributes = std::string(property_value.data());
51+
ur_platform_backend_t backend;
52+
ASSERT_SUCCESS(urPlatformGetInfo(platform, UR_PLATFORM_INFO_BACKEND,
53+
sizeof(backend), &backend, nullptr));
54+
if (backend == UR_PLATFORM_BACKEND_OPENCL ||
55+
backend == UR_PLATFORM_BACKEND_LEVEL_ZERO) {
56+
// Older intel drivers don't attach any default attributes and newer ones force walk order to X/Y/Z using special attribute.
57+
ASSERT_TRUE(returned_attributes.empty() ||
58+
returned_attributes ==
59+
"intel_reqd_workgroup_walk_order(0,1,2)");
60+
} else {
61+
ASSERT_TRUE(returned_attributes.empty());
62+
}
63+
break;
64+
}
4965
default:
5066
break;
5167
}

0 commit comments

Comments
 (0)