Skip to content
Draft
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
4 changes: 4 additions & 0 deletions .github/workflows/sycl-clang-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
- "**/*.h"
- "**/*.hpp"

paths-ignore:
# TEMPORARY (PR #23305): disable Linux clang-tidy on this branch. Do not merge upstream.
- '**'


concurrency:
# Cancel a currently running workflow from the same PR, branch or tag.
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/sycl-linux-precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ on:
- 'devops/scripts/benchmarks/**'
- 'devops/actions/run-tests/benchmark/**'
- '.github/workflows/sycl-ur-perf-benchmarking.yml'
# TEMPORARY (PR #23305): disable all Linux precommit jobs on this branch.
# Windows-only validation. Do not merge this paths-ignore entry upstream.
- '**'

concurrency:
# Cancel a currently running workflow from the same PR, branch or tag.
Expand Down
15 changes: 6 additions & 9 deletions sycl/test-e2e/Adapters/level_zero/event-leak.cpp
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
// REQUIRES: level_zero, level_zero_dev_kit
//
// TODO: The L0 loader on Windows CI does not count zeEventCounterBasedCreate,
// so the matching zeEventDestroy calls are reported as a negative leak there.
// Ignore negative leaks on Windows until the loader is updated.
// DEFINE: %{leak_check_not} = %if windows %{"LEAK = {{[^-]}}"%} %else %{LEAK%}
//
// RUN: %{build} %level_zero_options -o %t.out
// RUN: %{l0_leak_check} %{run} %t.out wait 2>&1 | FileCheck %s --implicit-check-not=%{leak_check_not}
// RUN: %{l0_leak_check} %{run} %t.out nowait 2>&1 | FileCheck %s --implicit-check-not=%{leak_check_not}
// RUN: %{l0_leak_check} %{run} %t.out wait 2>&1 | FileCheck %s
// RUN: %{l0_leak_check} %{run} %t.out nowait 2>&1 | FileCheck %s
//
// RUN: %{build} %level_zero_options -DCHECK_INORDER -o %t.inorder.out
// RUN: %{l0_leak_check} %{run} %t.inorder.out wait 2>&1 | FileCheck %s --implicit-check-not=%{leak_check_not}
// RUN: %{l0_leak_check} %{run} %t.inorder.out nowait 2>&1 | FileCheck %s --implicit-check-not=%{leak_check_not}
// RUN: %{l0_leak_check} %{run} %t.inorder.out wait 2>&1 | FileCheck %s
// RUN: %{l0_leak_check} %{run} %t.inorder.out nowait 2>&1 | FileCheck %s
//
// CHECK-NOT: LEAK

// The test is to check that there are no leaks reported with the embedded
// UR_L0_LEAKS_DEBUG=1 testing capability. Example of a leak reported is this:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
// REQUIRES: level_zero
//
// TODO: The L0 loader on Windows CI does not count zeEventCounterBasedCreate,
// so the matching zeEventDestroy calls are reported as a negative leak there.
// Ignore negative leaks on Windows until the loader is updated.
// DEFINE: %{leak_check_not} = %if windows %{"LEAK = {{[^-]}}"%} %else %{LEAK%}
//
// RUN: %{build} -o %t.out
//
// RUN: env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_LEVEL_ZERO_BATCH_SIZE=4 ONEAPI_DEVICE_SELECTOR='level_zero:*' %{l0_leak_check} %{run} %t.out wait 2>&1 | FileCheck %s --implicit-check-not=%{leak_check_not}
// RUN: env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_LEVEL_ZERO_BATCH_SIZE=4 ONEAPI_DEVICE_SELECTOR='level_zero:*' %{l0_leak_check} %{run} %t.out nowait 2>&1 | FileCheck %s --implicit-check-not=%{leak_check_not}
// RUN: env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_LEVEL_ZERO_BATCH_SIZE=4 ONEAPI_DEVICE_SELECTOR='level_zero:*' %{l0_leak_check} %{run} %t.out wait 2>&1 | FileCheck %s
// RUN: env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_LEVEL_ZERO_BATCH_SIZE=4 ONEAPI_DEVICE_SELECTOR='level_zero:*' %{l0_leak_check} %{run} %t.out nowait 2>&1 | FileCheck %s
//
// CHECK-NOT: LEAK
//
// The test is to check that there are no leaks reported with the embedded
// UR_L0_LEAKS_DEBUG=1 ( %{l0_leak_check} ) testing capability.
Expand Down
7 changes: 1 addition & 6 deletions sycl/test-e2e/ProfilingTag/profile_tag_leak.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
// REQUIRES: level_zero
//
// TODO: The L0 loader on Windows CI does not count zeEventCounterBasedCreate,
// so the matching zeEventDestroy calls are reported as a negative leak there.
// Ignore negative leaks on Windows until the loader is updated.
// DEFINE: %{leak_check_not} = %if windows %{"LEAK = {{[^-]}}"%} %else %{LEAK%}
//
// RUN: %{build} -o %t.out
// RUN: %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=%{leak_check_not}
// RUN: %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK

// Regression test to avoid the reintroduction of a leak in L0 in the profiling
// tags when using barriers to ensure ordering on out-of-order queues.
Expand Down
9 changes: 3 additions & 6 deletions sycl/test-e2e/Reduction/reduction_resource_leak_dw.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
// REQUIRES: level_zero
//
// TODO: The L0 loader on Windows CI does not count zeEventCounterBasedCreate,
// so the matching zeEventDestroy calls are reported as a negative leak there.
// Ignore negative leaks on Windows until the loader is updated.
// DEFINE: %{leak_check_not} = %if windows %{"LEAK = {{[^-]}}"%} %else %{LEAK%}
//
// RUN: %{build} -o %t.out
// RUN: %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=%{leak_check_not}
// RUN: %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s
//
// CHECK-NOT: LEAK

// Tests that additional resources required by discard_write reductions do not
// leak.
Expand Down
9 changes: 3 additions & 6 deletions sycl/test-e2e/Reduction/reduction_resource_leak_usm.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
// REQUIRES: level_zero

// TODO: The L0 loader on Windows CI does not count zeEventCounterBasedCreate,
// so the matching zeEventDestroy calls are reported as a negative leak there.
// Ignore negative leaks on Windows until the loader is updated.
// DEFINE: %{leak_check_not} = %if windows %{"LEAK = {{[^-]}}"%} %else %{LEAK%}

// RUN: %{build} -o %t.out
// RUN: env ONEAPI_DEVICE_SELECTOR="level_zero:*" %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=%{leak_check_not}
// RUN: env ONEAPI_DEVICE_SELECTOR="level_zero:*" %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s
//
// CHECK-NOT: LEAK

// Tests that additional resources required by USM reductions do not leak.

Expand Down
11 changes: 3 additions & 8 deletions sycl/test-e2e/USM/usm_leak_check.cpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
// REQUIRES: level_zero

// TODO: The L0 loader on Windows CI does not count zeEventCounterBasedCreate,
// so the matching zeEventDestroy calls are reported as a negative leak there.
// Ignore negative leaks on Windows until the loader is updated.
// DEFINE: %{leak_check_not} = %if windows %{"LEAK = {{[^-]}}"%} %else %{LEAK%}

// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out

// RUN: %{l0_leak_check} %{run} %t.out u 2>&1 | FileCheck %s --implicit-check-not=%{leak_check_not}
// RUN: %{l0_leak_check} %{run} %t.out s 2>&1 | FileCheck %s --implicit-check-not=%{leak_check_not}
// RUN: %{l0_leak_check} %{run} %t.out l 2>&1 | FileCheck %s --implicit-check-not=%{leak_check_not}
// RUN: %{l0_leak_check} %{run} %t.out u 2>&1 | FileCheck %s --implicit-check-not=LEAK
// RUN: %{l0_leak_check} %{run} %t.out s 2>&1 | FileCheck %s --implicit-check-not=LEAK
// RUN: %{l0_leak_check} %{run} %t.out l 2>&1 | FileCheck %s --implicit-check-not=LEAK

#include <sycl/detail/core.hpp>
#include <sycl/usm.hpp>
Expand Down
66 changes: 66 additions & 0 deletions sycl/test-e2e/USM/zzz_print_L0_loader_version.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// REQUIRES: windows, level_zero, level_zero_dev_kit
// REQUIRES: arch-intel_gpu_bmg_g21 || arch-intel_gpu_bmg_g31

// RUN: %{build} %level_zero_options -o %t.out
// RUN: %{run} %t.out

// Prints the version of the Level Zero loader used by the SYCL runtime.
// The test always fails, so that its output is printed in the lit log.

#include <level_zero/loader/ze_loader.h>
#include <level_zero/ze_api.h>
#include <sycl/backend.hpp>
#include <sycl/detail/core.hpp>

#include <iostream>
#include <vector>

#ifdef _WIN32
#include <windows.h>
#endif

int main() {
sycl::queue Q;
std::cout << "Device: " << Q.get_device().get_info<sycl::info::device::name>()
<< std::endl;

#ifdef _WIN32
if (HMODULE Loader = GetModuleHandleA("ze_loader.dll")) {
char Path[MAX_PATH] = {0};
if (GetModuleFileNameA(Loader, Path, MAX_PATH))
std::cout << "L0 loader path: " << Path << std::endl;
}
#endif

ze_result_t Res = zeInit(0);
if (Res != ZE_RESULT_SUCCESS) {
std::cout << "zeInit failed with error code: " << Res << std::endl;
return 1;
}

size_t NumComponents = 0;
Res = zelLoaderGetVersions(&NumComponents, nullptr);
if (Res != ZE_RESULT_SUCCESS) {
std::cout << "zelLoaderGetVersions failed with error code: " << Res
<< std::endl;
return 1;
}

std::vector<zel_component_version_t> Versions(NumComponents);
Res = zelLoaderGetVersions(&NumComponents, Versions.data());
if (Res != ZE_RESULT_SUCCESS) {
std::cout << "zelLoaderGetVersions failed with error code: " << Res
<< std::endl;
return 1;
}

for (const auto &V : Versions)
std::cout << "L0 component: " << V.component_name
<< ", version: " << V.component_lib_version.major << "."
<< V.component_lib_version.minor << "."
<< V.component_lib_version.patch
<< ", spec version: " << ZE_MAJOR_VERSION(V.spec_version) << "."
<< ZE_MINOR_VERSION(V.spec_version) << std::endl;

return 1;
}
Loading