Skip to content

[SYCL] Add sycl-jit e2e feature #19724

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

Open
wants to merge 6 commits into
base: sycl
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions sycl/test-e2e/E2EExpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class E2EExpr(BooleanExpression):
"pdtracker",
"ze_debug",
"device-config-file",
"sycl-jit",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I am not mistaken we don't need this requirement at build-time, i.e. this is "run-mode" only feature and needs to be removed from this list. Please see my second comment.

}

def __init__(self, string, variables, build_only_mode, final_unknown_value):
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/KernelCompiler/sycl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//

// REQUIRES: aspect-usm_device_allocations
// REQUIRES: sycl-jit, aspect-usm_device_allocations

// RUN: %{build} -o %t.out
// RUN: %if hip %{ env SYCL_JIT_AMDGCN_PTX_TARGET_CPU=%{amd_arch} %} %{l0_leak_check} %{run} %t.out
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/KernelCompiler/sycl_basic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//

// REQUIRES: aspect-usm_device_allocations
// REQUIRES: sycl-jit, aspect-usm_device_allocations

// RUN: %{build} -o %t.out
// RUN: %if hip %{ env SYCL_JIT_AMDGCN_PTX_TARGET_CPU=%{amd_arch} %} %{l0_leak_check} %{run} %t.out
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/KernelCompiler/sycl_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// target. Don't run eviction check for CUDA/HIP, so that we don't have to find
// a magic number that works for all binaries (and by definition is flaky).

// REQUIRES: aspect-usm_device_allocations
// REQUIRES: sycl-jit, aspect-usm_device_allocations

// DEFINE: %{cache_vars} = env SYCL_CACHE_PERSISTENT=1 SYCL_CACHE_TRACE=7 SYCL_CACHE_DIR=%t/cache_dir
// DEFINE: %{max_cache_size} = SYCL_CACHE_MAX_SIZE=30000
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/KernelCompiler/sycl_cache_pm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//===----------------------------------------------------------------------===//

// REQUIRES: (opencl || level_zero)
// REQUIRES: aspect-usm_device_allocations
// REQUIRES: sycl-jit, aspect-usm_device_allocations

// -- Test the kernel_compiler with SYCL source.
// RUN: %{build} -o %t.out
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/KernelCompiler/sycl_device_globals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//

// REQUIRES: aspect-usm_device_allocations
// REQUIRES: sycl-jit, aspect-usm_device_allocations

// UNSUPPORTED: opencl && gpu
// UNSUPPORTED-TRACKER: GSD-4287
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/KernelCompiler/sycl_imf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//

// REQUIRES: aspect-usm_device_allocations
// REQUIRES: sycl-jit, aspect-usm_device_allocations
// REQUIRES: (opencl || level_zero)

// UNSUPPORTED: accelerator
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/KernelCompiler/sycl_include_paths.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//

// REQUIRES: aspect-usm_device_allocations
// REQUIRES: sycl-jit, aspect-usm_device_allocations

// RUN: %{build} -o %t.out
// RUN: %if hip %{ env SYCL_JIT_AMDGCN_PTX_TARGET_CPU=%{amd_arch} %} %{run} %t.out %S | FileCheck %s --check-prefixes=CHECK,CHECK-NOCWD
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/KernelCompiler/sycl_join.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//

// REQUIRES: aspect-usm_shared_allocations
// REQUIRES: sycl-jit, aspect-usm_shared_allocations

// RUN: %{build} -o %t.out
// RUN: %if hip %{ env SYCL_JIT_AMDGCN_PTX_TARGET_CPU=%{amd_arch} %} %{run} %t.out
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/KernelCompiler/sycl_lifetimes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//

// REQUIRES: aspect-usm_device_allocations
// REQUIRES: sycl-jit, aspect-usm_device_allocations

// RUN: %{build} -o %t.out
// RUN: %if hip %{ env SYCL_JIT_AMDGCN_PTX_TARGET_CPU=%{amd_arch} %} env SYCL_UR_TRACE=-1 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/KernelCompiler/sycl_namespaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//

// REQUIRES: aspect-usm_device_allocations
// REQUIRES: sycl-jit, aspect-usm_device_allocations

// RUN: %{build} -o %t.out
// RUN: %if hip %{ env SYCL_JIT_AMDGCN_PTX_TARGET_CPU=%{amd_arch} %} %{l0_leak_check} %{run} %t.out
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/KernelCompiler/sycl_overload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//

// REQUIRES: aspect-usm_device_allocations
// REQUIRES: sycl-jit, aspect-usm_device_allocations

// RUN: %{build} -o %t.out
// RUN: %if hip %{ env SYCL_JIT_AMDGCN_PTX_TARGET_CPU=%{amd_arch} %} %{l0_leak_check} %{run} %t.out
Expand Down
2 changes: 2 additions & 0 deletions sycl/test-e2e/KernelCompiler/sycl_time_trace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
//
//===----------------------------------------------------------------------===//

// REQUIRES: sycl-jit

// RUN: %{build} -o %t.out
// RUN: %if hip %{ env SYCL_JIT_AMDGCN_PTX_TARGET_CPU=%{amd_arch} %} %{run} %t.out | FileCheck %s

Expand Down
10 changes: 10 additions & 0 deletions sycl/test-e2e/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,16 @@ def get_sycl_ls_verbose(sycl_device, env):
config.available_features.add("device-config-file")
config.substitutions.append(("%device_config_file_include_flag", ""))

# Check for sycl-jit library
if platform.system() == "Linux":
if os.path.exists(os.path.join(config.sycl_libs_dir, "libsycl-jit.so")):
config.available_features.add("sycl-jit")
elif platform.system() == "Windows":
if os.path.exists(os.path.join(config.sycl_libs_dir, "sycl-jit.lib")):
config.available_features.add("sycl-jit")
Comment on lines +977 to +979
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: sycl-jit.lib is required at compile time, but at runtime, sycl-jit.dll must be available in the PATH. However, since the .lib and .dll are typically distributed together, I believe checking for the .lib should be sufficient.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually it's probably better to check only for dll in this case.
Currently in implementation sycl-jit.dll and sycl-jit.so are loaded at runtime via LoadLibrary* and dlopen.
I.e. if I am not mistaken test can be compiled even if those files don;'t exist. And only in runtime we need .so and .dll.

if "sycl-jit" not in config.available_features:
lit_config.note("sycl-jit was not found. Tests requiring sycl-jit will be skipped.")

# That has to be executed last so that all device-independent features have been
# discovered already.
config.sycl_dev_features = {}
Expand Down