Skip to content

Commit 987f0f2

Browse files
committed
Directly query environment platform in KernelSetArgSampler backend check.
The fixture's platform is initialized to point at the environment one in the platform test SetUp(), but that's too late for this query. This is a little hacky but it lets us skip the test without building the kernel (which will potentially cause a fail if images aren't supported).
1 parent 5303368 commit 987f0f2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/conformance/kernel/urKernelSetArgSampler.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ struct urKernelSetArgSamplerTest : uur::urKernelTest {
99
void SetUp() {
1010
// Images and samplers are not available on AMD
1111
ur_platform_backend_t backend;
12-
ASSERT_SUCCESS(urPlatformGetInfo(platform, UR_PLATFORM_INFO_BACKEND,
13-
sizeof(backend), &backend, nullptr));
12+
ASSERT_SUCCESS(urPlatformGetInfo(
13+
uur::PlatformEnvironment::instance->platform,
14+
UR_PLATFORM_INFO_BACKEND, sizeof(backend), &backend, nullptr));
1415
if (backend == UR_PLATFORM_BACKEND_HIP) {
1516
GTEST_SKIP() << "Sampler are not supported on hip.";
1617
}

0 commit comments

Comments
 (0)