Skip to content

[SYCL] Enable JIT tests relying on debug output #14801

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 8 commits into from
Aug 22, 2024
Merged
60 changes: 0 additions & 60 deletions sycl-jit/test/materializer/debug_output.ll

This file was deleted.

11 changes: 9 additions & 2 deletions sycl/test-e2e/AmdNvidiaJIT/kernel_and_bundle.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
// UNSUPPORTED: windows
// REQUIRES: cuda || hip

// https://github.com/intel/llvm/issues/14989
// UNSUPPORTED: hip_amd
// This test relies on debug output from a pass, make sure that the compiler
// can generate it.
// REQUIRES: has_ndebug

// RUN: %{build} -fsycl-embed-ir -o %t.out
// RUN: env SYCL_JIT_AMDGCN_PTX_KERNELS=1 env SYCL_JIT_COMPILER_DEBUG="sycl-spec-const-materializer" %{run} %t.out &> %t.txt ; FileCheck %s --input-file %t.txt

// Test the JIT compilation in an e2e fashion, the only way to make sure that
// the JIT pipeline has been executed and that the original binary has been
// replaced with the JIT-ed one is to inspect the output of one of its passes,
// that otherwise does not get run.

#include <sycl/detail/core.hpp>
#include <sycl/specialization_id.hpp>

Expand Down
13 changes: 13 additions & 0 deletions sycl/test-e2e/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,26 @@ def check_igc_tag_and_add_feature():
def open_check_file(file_name):
return open(os.path.join(config.sycl_obj_root, file_name), "w")


# check if compiler supports CL command line options
cl_options = False
sp = subprocess.getstatusoutput(config.dpcpp_compiler + " /help")
if sp[0] == 0:
cl_options = True
config.available_features.add("cl_options")

# check if the compiler was built in NDEBUG configuration
has_ndebug = False
ps = subprocess.Popen(
[config.dpcpp_compiler, "-mllvm", "-debug", "-x", "c", "-", "-S", "-o", "-"],
stdin=subprocess.PIPE,
stdout=subprocess.DEVNULL,
stderr=subprocess.PIPE,
)
_ = ps.communicate(input=b"int main(){}\n")
if ps.wait() == 0:
config.available_features.add("has_ndebug")

# Check for Level Zero SDK
check_l0_file = "l0_include.cpp"
with open_check_file(check_l0_file) as fp:
Expand Down
Loading