Skip to content

Commit 27cea9f

Browse files
authored
[SYCL] Enable JIT tests relying on debug output (#14801)
Wrap the tests in `REQUIRE: asserts` in order to make sure that the compiler can generate the messages. Also make sure we don't run the e2e tests on windows, as JIT is not supported there.
1 parent 9daddae commit 27cea9f

File tree

3 files changed

+22
-62
lines changed

3 files changed

+22
-62
lines changed

sycl-jit/test/materializer/debug_output.ll

Lines changed: 0 additions & 60 deletions
This file was deleted.

sycl/test-e2e/AmdNvidiaJIT/kernel_and_bundle.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1+
// UNSUPPORTED: windows
12
// REQUIRES: cuda || hip
23

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

68
// RUN: %{build} -fsycl-embed-ir -o %t.out
79
// 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
810

11+
// Test the JIT compilation in an e2e fashion, the only way to make sure that
12+
// the JIT pipeline has been executed and that the original binary has been
13+
// replaced with the JIT-ed one is to inspect the output of one of its passes,
14+
// that otherwise does not get run.
15+
916
#include <sycl/detail/core.hpp>
1017
#include <sycl/specialization_id.hpp>
1118

sycl/test-e2e/lit.cfg.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,13 +214,26 @@ def check_igc_tag_and_add_feature():
214214
def open_check_file(file_name):
215215
return open(os.path.join(config.sycl_obj_root, file_name), "w")
216216

217+
217218
# check if compiler supports CL command line options
218219
cl_options = False
219220
sp = subprocess.getstatusoutput(config.dpcpp_compiler + " /help")
220221
if sp[0] == 0:
221222
cl_options = True
222223
config.available_features.add("cl_options")
223224

225+
# check if the compiler was built in NDEBUG configuration
226+
has_ndebug = False
227+
ps = subprocess.Popen(
228+
[config.dpcpp_compiler, "-mllvm", "-debug", "-x", "c", "-", "-S", "-o", "-"],
229+
stdin=subprocess.PIPE,
230+
stdout=subprocess.DEVNULL,
231+
stderr=subprocess.PIPE,
232+
)
233+
_ = ps.communicate(input=b"int main(){}\n")
234+
if ps.wait() == 0:
235+
config.available_features.add("has_ndebug")
236+
224237
# Check for Level Zero SDK
225238
check_l0_file = "l0_include.cpp"
226239
with open_check_file(check_l0_file) as fp:

0 commit comments

Comments
 (0)