Skip to content

Commit f531ef3

Browse files
authored
[UR] Move native cpu device code cts skip to LoadSource. (#17973)
1 parent 02d4a8d commit f531ef3

File tree

8 files changed

+17
-32
lines changed

8 files changed

+17
-32
lines changed

unified-runtime/test/conformance/enqueue/urEnqueueKernelLaunch.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,8 @@ struct urEnqueueKernelLaunchMultiDeviceTest
527527
auto kernelName =
528528
uur::KernelsEnvironment::instance->GetEntryPointNames("foo")[0];
529529

530-
uur::KernelsEnvironment::instance->LoadSource("foo", platform, il_binary);
530+
UUR_RETURN_ON_FATAL_FAILURE(uur::KernelsEnvironment::instance->LoadSource(
531+
"foo", platform, il_binary));
531532

532533
UUR_RETURN_ON_FATAL_FAILURE(
533534
uur::KernelsEnvironment::instance->CreateProgram(

unified-runtime/test/conformance/enqueue/urEnqueueKernelLaunchAndMemcpyInOrder.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ struct urMultiQueueLaunchMemcpyTest
3434
using uur::urMultiQueueMultiDeviceTestWithParam<minDevices, T>::queues;
3535

3636
void SetUp() override {
37-
// We haven't got device code tests working on native cpu yet.
38-
UUR_KNOWN_FAILURE_ON(uur::NativeCPU{});
39-
4037
UUR_RETURN_ON_FATAL_FAILURE(
4138
uur::urMultiQueueMultiDeviceTestWithParam<minDevices, T>::SetUp());
4239

@@ -49,14 +46,13 @@ struct urMultiQueueLaunchMemcpyTest
4946
kernels.resize(devices.size());
5047
SharedMem.resize(devices.size());
5148

52-
KernelName =
53-
uur::KernelsEnvironment::instance->GetEntryPointNames(ProgramName)[0];
54-
5549
std::shared_ptr<std::vector<char>> il_binary;
5650
std::vector<ur_program_metadata_t> metadatas{};
5751

58-
uur::KernelsEnvironment::instance->LoadSource(ProgramName, platform,
59-
il_binary);
52+
UUR_RETURN_ON_FATAL_FAILURE(uur::KernelsEnvironment::instance->LoadSource(
53+
ProgramName, platform, il_binary));
54+
KernelName =
55+
uur::KernelsEnvironment::instance->GetEntryPointNames(ProgramName)[0];
6056

6157
for (size_t i = 0; i < devices.size(); i++) {
6258
const ur_program_properties_t properties = {

unified-runtime/test/conformance/kernel/urKernelCreate.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ TEST_P(urMultiDeviceKernelCreateTest, WithProgramBuild) {
6666
uur::KernelsEnvironment::instance->GetEntryPointNames("foo")[0];
6767

6868
std::shared_ptr<std::vector<char>> il_binary;
69-
uur::KernelsEnvironment::instance->LoadSource("foo", platform, il_binary);
69+
UUR_RETURN_ON_FATAL_FAILURE(uur::KernelsEnvironment::instance->LoadSource(
70+
"foo", platform, il_binary));
7071

7172
for (size_t i = 0; i < devices.size(); i++) {
7273
uur::raii::Program program;
@@ -101,7 +102,8 @@ TEST_P(urMultiDeviceKernelCreateTest, WithProgramCompileAndLink) {
101102
uur::KernelsEnvironment::instance->GetEntryPointNames("foo")[0];
102103

103104
std::shared_ptr<std::vector<char>> il_binary;
104-
uur::KernelsEnvironment::instance->LoadSource("foo", platform, il_binary);
105+
UUR_RETURN_ON_FATAL_FAILURE(uur::KernelsEnvironment::instance->LoadSource(
106+
"foo", platform, il_binary));
105107

106108
for (size_t i = 0; i < devices.size(); i++) {
107109
uur::raii::Program program;

unified-runtime/test/conformance/program/urProgramBuild.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ TEST_P(urProgramBuildTest, BuildFailure) {
3434

3535
ur_program_handle_t program = nullptr;
3636
std::shared_ptr<std::vector<char>> il_binary;
37-
uur::KernelsEnvironment::instance->LoadSource("build_failure", platform,
38-
il_binary);
37+
UUR_RETURN_ON_FATAL_FAILURE(uur::KernelsEnvironment::instance->LoadSource(
38+
"build_failure", platform, il_binary));
3939
if (!il_binary) {
4040
// The build failure we are testing for happens at SYCL compile time on
4141
// AMD and Nvidia, so no binary exists to check for a build failure

unified-runtime/test/conformance/program/urProgramCreateWithIL.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99

1010
struct urProgramCreateWithILTest : uur::urContextTest {
1111
void SetUp() override {
12-
// We haven't got device code tests working on native cpu yet.
13-
UUR_KNOWN_FAILURE_ON(uur::NativeCPU{});
14-
1512
UUR_RETURN_ON_FATAL_FAILURE(urContextTest::SetUp());
1613
// TODO: This should use a query for urProgramCreateWithIL support or
1714
// rely on UR_RESULT_ERROR_UNSUPPORTED_FEATURE being returned.
@@ -22,7 +19,8 @@ struct urProgramCreateWithILTest : uur::urContextTest {
2219
if (backend == UR_PLATFORM_BACKEND_HIP) {
2320
GTEST_SKIP();
2421
}
25-
uur::KernelsEnvironment::instance->LoadSource("foo", platform, il_binary);
22+
UUR_RETURN_ON_FATAL_FAILURE(uur::KernelsEnvironment::instance->LoadSource(
23+
"foo", platform, il_binary));
2624
}
2725

2826
void TearDown() override {

unified-runtime/test/conformance/program/urProgramLink.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,6 @@ struct urProgramLinkErrorTest : uur::urQueueTest {
8282
const std::string linker_error_program_name = "linker_error";
8383

8484
void SetUp() override {
85-
// We haven't got device code tests working on native cpu yet.
86-
UUR_KNOWN_FAILURE_ON(uur::NativeCPU{});
87-
8885
UUR_RETURN_ON_FATAL_FAILURE(urQueueTest::SetUp());
8986
// TODO: This should use a query for urProgramCreateWithIL support or
9087
// rely on UR_RESULT_ERROR_UNSUPPORTED_FEATURE being returned.

unified-runtime/test/conformance/source/environment.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,9 @@ KernelsEnvironment::getKernelSourcePath(const std::string &kernel_name,
243243
void KernelsEnvironment::LoadSource(
244244
const std::string &kernel_name, ur_platform_handle_t platform,
245245
std::shared_ptr<std::vector<char>> &binary_out) {
246+
// We don't have a way to build device code for native cpu yet.
247+
UUR_KNOWN_FAILURE_ON_PARAM(platform, uur::NativeCPU{});
248+
246249
std::string source_path =
247250
instance->getKernelSourcePath(kernel_name, platform);
248251

unified-runtime/test/conformance/testing/include/uur/fixtures.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -367,9 +367,6 @@ struct urQueueTest : urContextTest {
367367

368368
struct urHostPipeTest : urQueueTest {
369369
void SetUp() override {
370-
// We haven't got device code tests working on native cpu yet.
371-
UUR_KNOWN_FAILURE_ON(uur::NativeCPU{});
372-
373370
// The host pipe support query isn't implement on l0
374371
UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::LevelZeroV2{});
375372

@@ -1215,9 +1212,6 @@ std::string deviceTestWithParamPrinter<SamplerCreateParamT>(
12151212

12161213
struct urProgramTest : urQueueTest {
12171214
void SetUp() override {
1218-
// We haven't got device code tests working on native cpu yet.
1219-
UUR_KNOWN_FAILURE_ON(uur::NativeCPU{});
1220-
12211215
UUR_RETURN_ON_FATAL_FAILURE(urQueueTest::SetUp());
12221216

12231217
ur_platform_backend_t backend;
@@ -1254,9 +1248,6 @@ struct urProgramTest : urQueueTest {
12541248

12551249
template <class T> struct urProgramTestWithParam : urQueueTestWithParam<T> {
12561250
void SetUp() override {
1257-
// We haven't got device code tests working on native cpu yet.
1258-
UUR_KNOWN_FAILURE_ON(uur::NativeCPU{});
1259-
12601251
UUR_RETURN_ON_FATAL_FAILURE(urQueueTestWithParam<T>::SetUp());
12611252

12621253
ur_platform_backend_t backend;
@@ -1303,9 +1294,6 @@ template <class T> struct urProgramTestWithParam : urQueueTestWithParam<T> {
13031294
// instead.
13041295
struct urBaseKernelTest : urProgramTest {
13051296
void SetUp() override {
1306-
// We haven't got device code tests working on native cpu yet.
1307-
UUR_KNOWN_FAILURE_ON(uur::NativeCPU{});
1308-
13091297
UUR_RETURN_ON_FATAL_FAILURE(urProgramTest::SetUp());
13101298
auto kernel_names =
13111299
uur::KernelsEnvironment::instance->GetEntryPointNames(program_name);

0 commit comments

Comments
 (0)