Skip to content
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

[UR][E2E] add missing zeInit calls to interop tests #17837

Merged
merged 1 commit into from
Apr 7, 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
8 changes: 8 additions & 0 deletions sycl/test-e2e/Basic/interop/get_native_ze.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ constexpr auto BE = sycl::backend::ext_oneapi_level_zero;
class TestKernel;

int main() {
// Initialize Level Zero driver is required if this test is linked
// statically with Level Zero loader, the driver will not be init otherwise.
ze_result_t result = zeInit(ZE_INIT_FLAG_GPU_ONLY);
if (result != ZE_RESULT_SUCCESS) {
std::cout << "zeInit failed\n";
return 1;
}

sycl::queue Q;

if (0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ bool is_discrete(const device &Device) {
}

int main() {
// Initialize Level Zero driver is required if this test is linked
// statically with Level Zero loader, the driver will not be init otherwise.
ze_result_t result = zeInit(ZE_INIT_FLAG_GPU_ONLY);
if (result != ZE_RESULT_SUCCESS) {
std::cout << "zeInit failed\n";
return 1;
}

try {
platform Plt{gpu_selector_v};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ std::vector<uint8_t> loadSpirvFromFile(std::string FileName) {
}

int main(int, char **argv) {
// Initialize Level Zero driver is required if this test is linked
// statically with Level Zero loader, the driver will not be init otherwise.
ze_result_t result = zeInit(ZE_INIT_FLAG_GPU_ONLY);
if (result != ZE_RESULT_SUCCESS) {
std::cout << "zeInit failed\n";
return 1;
}

device Device;
if (!getDevice(Device, backend::ext_oneapi_level_zero)) {
Expand Down
8 changes: 8 additions & 0 deletions sycl/test-e2e/Graph/NativeCommand/level-zero_usm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ namespace exp_ext = sycl::ext::oneapi::experimental;
using namespace sycl;

int main() {
// Initialize Level Zero driver is required if this test is linked
// statically with Level Zero loader, the driver will not be init otherwise.
ze_result_t result = zeInit(ZE_INIT_FLAG_GPU_ONLY);
if (result != ZE_RESULT_SUCCESS) {
std::cout << "zeInit failed\n";
return 1;
}

queue Queue;

const size_t Size = 128;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ namespace exp_ext = sycl::ext::oneapi::experimental;
using namespace sycl;

int main() {
// Initialize Level Zero driver is required if this test is linked
// statically with Level Zero loader, the driver will not be init otherwise.
ze_result_t result = zeInit(ZE_INIT_FLAG_GPU_ONLY);
if (result != ZE_RESULT_SUCCESS) {
std::cout << "zeInit failed\n";
return 1;
}

queue Queue{{sycl::property::queue::in_order{}}};

const size_t Size = 128;
Expand Down