Skip to content

Commit 0caff4d

Browse files
rbegambader
andauthored
[SYCL] Add OpenCL requirement to the tests using OpenCL API (#1242)
Some of the tests do not use OpenCL API directly, but rely on OpenCL interoperability API like sycl::program::build_with_source. Signed-off-by: Sergey V Maslov <[email protected]> Co-Authored-By: Rehana Begam <[email protected]> Alexey Bader <[email protected]>
1 parent 35ee8d2 commit 0caff4d

File tree

16 files changed

+33
-10
lines changed

16 files changed

+33
-10
lines changed

sycl/test/basic_tests/buffer/buffer.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// REQUIRES: opencl
2+
13
// RUN: %clangxx %s -o %t1.out -lsycl
24
// RUN: env SYCL_DEVICE_TYPE=HOST %t1.out
35
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t2.out

sycl/test/basic_tests/buffer/buffer_interop.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
// REQUIRES: opencl
2+
13
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -L %opencl_libs_dir -lOpenCL
24
// RUN: %CPU_RUN_PLACEHOLDER %t.out
35
// RUN: %GPU_RUN_PLACEHOLDER %t.out
46
// RUN: %ACC_RUN_PLACEHOLDER %t.out
57

6-
// REQUIRES: opencl
7-
88
//==------------------- buffer.cpp - SYCL buffer basic test ----------------==//
99
//
1010
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

sycl/test/basic_tests/buffer/subbuffer_interop.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
// REQUIRES: opencl
2+
13
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -L %opencl_libs_dir -lOpenCL
24
// RUN: %CPU_RUN_PLACEHOLDER %t.out
35
// RUN: %GPU_RUN_PLACEHOLDER %t.out
46
// RUN: %ACC_RUN_PLACEHOLDER %t.out
57

6-
// REQUIRES: opencl
7-
88
//==------------ subbuffer_interop.cpp - SYCL buffer basic test ------------==//
99
//
1010
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

sycl/test/basic_tests/event.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// REQUIRES: opencl
2+
13
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -L %opencl_libs_dir -lOpenCL
24
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
35
//==--------------- event.cpp - SYCL event test ----------------------------==//

sycl/test/basic_tests/image_api.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// REQUIRES: opencl
2+
13
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -I %sycl_source_dir %s -o %t1.out
24
// RUN: %clangxx -I %sycl_source_dir %s -o %t3.out -lsycl
35
// RUN: env SYCL_DEVICE_TYPE=HOST %t1.out

sycl/test/basic_tests/kernel_interop.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
// REQUIRES: opencl
2+
13
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -L %opencl_libs_dir -lOpenCL
24
// RUN: %CPU_RUN_PLACEHOLDER %t.out
35
// RUN: %GPU_RUN_PLACEHOLDER %t.out
46
// RUN: %ACC_RUN_PLACEHOLDER %t.out
57

6-
// REQUIRES: opencl
7-
88
//==--------------- kernel_interop.cpp - SYCL kernel ocl interop test ------==//
99
//
1010
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

sycl/test/basic_tests/sampler/sampler.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// REQUIRES: opencl
2+
13
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -L %opencl_libs_dir -lOpenCL
24
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
35
// RUN: %CPU_RUN_PLACEHOLDER %t.out

sycl/test/basic_tests/set_arg_interop.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1+
// REQUIRES: opencl
2+
13
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -L %opencl_libs_dir -lOpenCL -O3
24
// RUN: %CPU_RUN_PLACEHOLDER %t.out
35
// RUN: %GPU_RUN_PLACEHOLDER %t.out
46
// RUN: %ACC_RUN_PLACEHOLDER %t.out
57

6-
// REQUIRES: opencl
7-
8-
98
#include <CL/sycl.hpp>
109

1110
#include <cassert>

sycl/test/fpga_tests/fpga_queue.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// REQUIRES: opencl
2+
13
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -L %opencl_libs_dir -lOpenCL
24
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
35
// RUN: %ACC_RUN_PLACEHOLDER %t.out

sycl/test/kernel-and-program/cache.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// REQUIRES: opencl
2+
13
// RUN: %clangxx -fsycl -I %sycl_source_dir %s -o %t.out
24
// RUN: %CPU_RUN_PLACEHOLDER %t.out
35
//==---------------- cache.cpp - SYCL kernel/program test ------------------==//

sycl/test/kernel-and-program/kernel-and-program.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// REQUIRES: opencl
2+
13
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -L %opencl_libs_dir -lOpenCL
24
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
35
// RUN: %CPU_RUN_PLACEHOLDER %t.out

sycl/test/linear_id/opencl-interop.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
// REQUIRES: opencl
2+
13
// RUN: %clangxx -fsycl %s -o %t.out
24
// RUN: %CPU_RUN_PLACEHOLDER %t.out
35
// RUN: %GPU_RUN_PLACEHOLDER %t.out
46
// RUN: %ACC_RUN_PLACEHOLDER %t.out
5-
// REQUIRES: opencl
67
// UNSUPPORTED: cuda
78
//==---------------- opencl-interop.cpp - SYCL linear id test --------------==//
89
//

sycl/test/lit.cfg.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@
6767
if 'OCL_ICD_FILENAMES' in os.environ:
6868
config.environment['OCL_ICD_FILENAMES'] = os.environ['OCL_ICD_FILENAMES']
6969

70+
if 'SYCL_DEVICE_WHITE_LIST' in os.environ:
71+
config.environment['SYCL_DEVICE_WHITE_LIST'] = os.environ['SYCL_DEVICE_WHITE_LIST']
72+
7073
config.substitutions.append( ('%sycl_libs_dir', config.sycl_libs_dir ) )
7174
config.substitutions.append( ('%sycl_include', config.sycl_include ) )
7275
config.substitutions.append( ('%opencl_libs_dir', config.opencl_libs_dir) )

sycl/test/ordered_queue/ordered_buffs.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// REQUIRES: opencl
2+
13
// RUN: %clangxx -fsycl %s -o %t.out -L %opencl_libs_dir -lOpenCL
24
// RUN: %ACC_RUN_PLACEHOLDER %t.out
35
// RUN: %CPU_RUN_PLACEHOLDER %t.out

sycl/test/ordered_queue/ordered_dmemll.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// REQUIRES: opencl
2+
13
// RUN: %clangxx -fsycl %s -o %t1.out -L %opencl_libs_dir -lOpenCL
24
// RUN: %CPU_RUN_PLACEHOLDER %t1.out
35
// RUN: %GPU_RUN_PLACEHOLDER %t1.out

sycl/test/sub_group/common_ocl.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// REQUIRES: opencl
2+
13
// RUN: %clang_cc1 -x cl -cl-std=CL2.0 %S/sg.cl -triple spir64-unknown-unknown -emit-llvm-bc -o %T/kernel_ocl.bc -include opencl-c.h
24
// RUN: llvm-spirv %T/kernel_ocl.bc -o %T/kernel_ocl.spv
35
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -L %opencl_libs_dir -lOpenCL

0 commit comments

Comments
 (0)