Skip to content

[UR] Move native cpu device code cts skip to LoadSource. #17973

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,8 @@ struct urEnqueueKernelLaunchMultiDeviceTest
auto kernelName =
uur::KernelsEnvironment::instance->GetEntryPointNames("foo")[0];

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

UUR_RETURN_ON_FATAL_FAILURE(
uur::KernelsEnvironment::instance->CreateProgram(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ struct urMultiQueueLaunchMemcpyTest
using uur::urMultiQueueMultiDeviceTestWithParam<minDevices, T>::queues;

void SetUp() override {
// We haven't got device code tests working on native cpu yet.
UUR_KNOWN_FAILURE_ON(uur::NativeCPU{});

UUR_RETURN_ON_FATAL_FAILURE(
uur::urMultiQueueMultiDeviceTestWithParam<minDevices, T>::SetUp());

Expand All @@ -49,14 +46,13 @@ struct urMultiQueueLaunchMemcpyTest
kernels.resize(devices.size());
SharedMem.resize(devices.size());

KernelName =
uur::KernelsEnvironment::instance->GetEntryPointNames(ProgramName)[0];

std::shared_ptr<std::vector<char>> il_binary;
std::vector<ur_program_metadata_t> metadatas{};

uur::KernelsEnvironment::instance->LoadSource(ProgramName, platform,
il_binary);
UUR_RETURN_ON_FATAL_FAILURE(uur::KernelsEnvironment::instance->LoadSource(
ProgramName, platform, il_binary));
KernelName =
uur::KernelsEnvironment::instance->GetEntryPointNames(ProgramName)[0];

for (size_t i = 0; i < devices.size(); i++) {
const ur_program_properties_t properties = {
Expand Down
6 changes: 4 additions & 2 deletions unified-runtime/test/conformance/kernel/urKernelCreate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ TEST_P(urMultiDeviceKernelCreateTest, WithProgramBuild) {
uur::KernelsEnvironment::instance->GetEntryPointNames("foo")[0];

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

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

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

for (size_t i = 0; i < devices.size(); i++) {
uur::raii::Program program;
Expand Down
4 changes: 2 additions & 2 deletions unified-runtime/test/conformance/program/urProgramBuild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ TEST_P(urProgramBuildTest, BuildFailure) {

ur_program_handle_t program = nullptr;
std::shared_ptr<std::vector<char>> il_binary;
uur::KernelsEnvironment::instance->LoadSource("build_failure", platform,
il_binary);
UUR_RETURN_ON_FATAL_FAILURE(uur::KernelsEnvironment::instance->LoadSource(
"build_failure", platform, il_binary));
if (!il_binary) {
// The build failure we are testing for happens at SYCL compile time on
// AMD and Nvidia, so no binary exists to check for a build failure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@

struct urProgramCreateWithILTest : uur::urContextTest {
void SetUp() override {
// We haven't got device code tests working on native cpu yet.
UUR_KNOWN_FAILURE_ON(uur::NativeCPU{});

UUR_RETURN_ON_FATAL_FAILURE(urContextTest::SetUp());
// TODO: This should use a query for urProgramCreateWithIL support or
// rely on UR_RESULT_ERROR_UNSUPPORTED_FEATURE being returned.
Expand All @@ -22,7 +19,8 @@ struct urProgramCreateWithILTest : uur::urContextTest {
if (backend == UR_PLATFORM_BACKEND_HIP) {
GTEST_SKIP();
}
uur::KernelsEnvironment::instance->LoadSource("foo", platform, il_binary);
UUR_RETURN_ON_FATAL_FAILURE(uur::KernelsEnvironment::instance->LoadSource(
"foo", platform, il_binary));
}

void TearDown() override {
Expand Down
3 changes: 0 additions & 3 deletions unified-runtime/test/conformance/program/urProgramLink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,6 @@ struct urProgramLinkErrorTest : uur::urQueueTest {
const std::string linker_error_program_name = "linker_error";

void SetUp() override {
// We haven't got device code tests working on native cpu yet.
UUR_KNOWN_FAILURE_ON(uur::NativeCPU{});

UUR_RETURN_ON_FATAL_FAILURE(urQueueTest::SetUp());
// TODO: This should use a query for urProgramCreateWithIL support or
// rely on UR_RESULT_ERROR_UNSUPPORTED_FEATURE being returned.
Expand Down
3 changes: 3 additions & 0 deletions unified-runtime/test/conformance/source/environment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,9 @@ KernelsEnvironment::getKernelSourcePath(const std::string &kernel_name,
void KernelsEnvironment::LoadSource(
const std::string &kernel_name, ur_platform_handle_t platform,
std::shared_ptr<std::vector<char>> &binary_out) {
// We don't have a way to build device code for native cpu yet.
UUR_KNOWN_FAILURE_ON_PARAM(platform, uur::NativeCPU{});

std::string source_path =
instance->getKernelSourcePath(kernel_name, platform);

Expand Down
12 changes: 0 additions & 12 deletions unified-runtime/test/conformance/testing/include/uur/fixtures.h
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,6 @@ struct urQueueTest : urContextTest {

struct urHostPipeTest : urQueueTest {
void SetUp() override {
// We haven't got device code tests working on native cpu yet.
UUR_KNOWN_FAILURE_ON(uur::NativeCPU{});

// The host pipe support query isn't implement on l0
UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::LevelZeroV2{});

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

struct urProgramTest : urQueueTest {
void SetUp() override {
// We haven't got device code tests working on native cpu yet.
UUR_KNOWN_FAILURE_ON(uur::NativeCPU{});

UUR_RETURN_ON_FATAL_FAILURE(urQueueTest::SetUp());

ur_platform_backend_t backend;
Expand Down Expand Up @@ -1254,9 +1248,6 @@ struct urProgramTest : urQueueTest {

template <class T> struct urProgramTestWithParam : urQueueTestWithParam<T> {
void SetUp() override {
// We haven't got device code tests working on native cpu yet.
UUR_KNOWN_FAILURE_ON(uur::NativeCPU{});

UUR_RETURN_ON_FATAL_FAILURE(urQueueTestWithParam<T>::SetUp());

ur_platform_backend_t backend;
Expand Down Expand Up @@ -1303,9 +1294,6 @@ template <class T> struct urProgramTestWithParam : urQueueTestWithParam<T> {
// instead.
struct urBaseKernelTest : urProgramTest {
void SetUp() override {
// We haven't got device code tests working on native cpu yet.
UUR_KNOWN_FAILURE_ON(uur::NativeCPU{});

UUR_RETURN_ON_FATAL_FAILURE(urProgramTest::SetUp());
auto kernel_names =
uur::KernelsEnvironment::instance->GetEntryPointNames(program_name);
Expand Down