Skip to content

Commit cf9d1a4

Browse files
authored
[SYCL][CUDA] LIT XFAIL/UNSUPPORTED (#1303)
Remove XFAIL from passing tests. Change tests that should pass but fail as XFAIL, e.g., mark unexpectedly failing sub-buffer test to fix later for SYCL CUDA. Add `REQUIRES: opencl` for LIT tests requiring OpenCL. LIT tests that `REQUIRES: opencl` do not need an `UNSUPPORTED: cuda`. Mark tests of features not supported by SYCL CUDA with `UNSUPPORTED: cuda`. Tests that do not use the CUDA target triple do not require any CUDA related LIT marker. Tests that do not fail with CUDA do not require any CUDA specific LIT marker. Fix LIT test using `-Werror` to fail when the compiler driver warns about an unknown CUDA version as CUDA has otherwise nothing to do with the test. Adapt test to moved `pi_cuda.hpp` header. Some cleanup inside LIT configuration scripts. Signed-off-by: Bjoern Knafla <[email protected]>
1 parent 5d5351b commit cf9d1a4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+220
-116
lines changed

sycl/plugins/cuda/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ message(STATUS "Including the PI API CUDA backend.")
44
# we only require the CUDA driver API to be used
55
# CUDA_CUDA_LIBRARY variable defines the path to libcuda.so, the CUDA Driver API library.
66

7-
find_package(CUDA 10.0 REQUIRED)
7+
find_package(CUDA 10.1 REQUIRED)
88

99
add_library(cudadrv SHARED IMPORTED)
1010

sycl/test/aot/gpu.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
// REQUIRES: ocloc, gpu
2+
// UNSUPPORTED: cuda
3+
// CUDA is not compatible with SPIR.
24

35
// RUN: %clangxx -fsycl -fsycl-targets=spir64_gen-unknown-unknown-sycldevice -Xsycl-target-backend=spir64_gen-unknown-unknown-sycldevice "-device skl" %s -o %t.out
46
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
57
// RUN: %GPU_RUN_PLACEHOLDER %t.out
6-
// XFAIL: cuda
8+
79
//==----- gpu.cpp - AOT compilation for gen devices using GEN compiler ------==//
810
//
911
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

sycl/test/aot/multiple-devices.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
//===------------------------------------------------------------------------===//
88

99
// REQUIRES: opencl-aot, ocloc, aoc, cpu, gpu, accelerator
10+
// UNSUPPORTED: cuda
11+
// CUDA is not compatible with SPIR.
1012

1113
// 1-command compilation case
1214
// Targeting CPU, GPU, FPGA

sycl/test/basic_tests/buffer/subbuffer.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
1+
// XFAIL: cuda
2+
// TODO: Fix CUDA implementation.
3+
//
4+
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
25
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
36
// RUN: %CPU_RUN_PLACEHOLDER %t.out
47
// RUN: %GPU_RUN_PLACEHOLDER %t.out
58
// RUN: %ACC_RUN_PLACEHOLDER %t.out
6-
// XFAIL: cuda
7-
// TODO: cuda fail due to unimplemented param_name 4121 in cuda_piDeviceGetInfo
8-
9+
//
910
//==---------- subbuffer.cpp --- sub-buffer basic test ---------------------==//
1011
//
1112
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

sycl/test/basic_tests/handler/handler_copy_with_offset.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clangxx -fsycl %s -o %t.out
1+
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
22
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
33
// RUN: %CPU_RUN_PLACEHOLDER %t.out
44
// RUN: %GPU_RUN_PLACEHOLDER %t.out
@@ -48,7 +48,7 @@ int main() {
4848

4949
vector_class<char> Expected{'x', 'x', '0', '1', '2', '3', 'x', 'x'};
5050
if (DataRaw != Expected)
51-
throw std::runtime_error("Check of hadler.copy(ptr, acc) was failed");
51+
throw std::runtime_error("Check of handler.copy(ptr, acc) was failed");
5252
}
5353

5454
{
@@ -71,7 +71,7 @@ int main() {
7171
}
7272
vector_class<char> Expected{'2', '3', '4', '5', 'x', 'x', 'x', 'x'};
7373
if (DataRaw != Expected)
74-
throw std::runtime_error("Check of hadler.copy(acc, ptr) was failed");
74+
throw std::runtime_error("Check of handler.copy(acc, ptr) was failed");
7575
}
7676
return 0;
7777
}

sycl/test/basic_tests/handler/interop_task.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
// REQUIRES: opencl
12
// RUN: %clangxx -fsycl %s -o %t.out -L %opencl_libs_dir -lOpenCL
23
// RUN: %CPU_RUN_PLACEHOLDER %t.out
34
// RUN: %GPU_RUN_PLACEHOLDER %t.out
4-
// REQUIRES: opencl
55

66
//==------- interop_task.cpp -----------------------------------------------==//
77
//

sycl/test/basic_tests/kernel_info.cpp

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,18 @@
1212
//===----------------------------------------------------------------------===//
1313

1414
#include <CL/sycl.hpp>
15+
#include <cassert>
1516

1617
using namespace cl::sycl;
1718

18-
void check(bool condition, const char *conditionString, const char *filename,
19-
const long line) noexcept {
20-
if (!condition) {
21-
std::cerr << "CHECK failed in " << filename << "#" << line << " "
22-
<< conditionString << "\n";
23-
std::abort();
24-
}
25-
}
26-
27-
#define CHECK(CONDITION) check(CONDITION, #CONDITION, __FILE__, __LINE__)
28-
2919
int main() {
3020
queue q;
3121

3222
buffer<int, 1> buf(range<1>(1));
3323
program prg(q.get_context());
3424

3525
prg.build_with_kernel_type<class SingleTask>();
36-
CHECK(prg.has_kernel<class SingleTask>());
26+
assert(prg.has_kernel<class SingleTask>());
3727
kernel krn = prg.get_kernel<class SingleTask>();
3828

3929
q.submit([&](handler &cgh) {
@@ -42,26 +32,26 @@ int main() {
4232
});
4333

4434
const string_class krnName = krn.get_info<info::kernel::function_name>();
45-
CHECK(!krnName.empty());
35+
assert(!krnName.empty());
4636
const cl_uint krnArgCount = krn.get_info<info::kernel::num_args>();
47-
CHECK(krnArgCount > 0);
37+
assert(krnArgCount > 0);
4838
const context krnCtx = krn.get_info<info::kernel::context>();
49-
CHECK(krnCtx == q.get_context());
39+
assert(krnCtx == q.get_context());
5040
const program krnPrg = krn.get_info<info::kernel::program>();
51-
CHECK(krnPrg == prg);
41+
assert(krnPrg == prg);
5242
const cl_uint krnRefCount = krn.get_info<info::kernel::reference_count>();
53-
CHECK(krnRefCount > 0);
43+
assert(krnRefCount > 0);
5444
const string_class krnAttr = krn.get_info<info::kernel::attributes>();
55-
CHECK(krnAttr.empty());
45+
assert(krnAttr.empty());
5646

5747
device dev = q.get_device();
5848
const size_t wgSize =
5949
krn.get_work_group_info<info::kernel_work_group::work_group_size>(dev);
60-
CHECK(wgSize > 0);
50+
assert(wgSize > 0);
6151
const size_t prefWGSizeMult = krn.get_work_group_info<
6252
info::kernel_work_group::preferred_work_group_size_multiple>(dev);
63-
CHECK(prefWGSizeMult > 0);
53+
assert(prefWGSizeMult > 0);
6454
const cl_ulong prvMemSize =
6555
krn.get_work_group_info<info::kernel_work_group::private_mem_size>(dev);
66-
CHECK(prvMemSize == 0);
56+
assert(prvMemSize == 0);
6757
}

sycl/test/basic_tests/parallel_for_range.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
// RUN: %clangxx -fsycl %s -o %t.out
1+
// XFAIL: cuda
2+
// CUDA exposes broken hierarchical parallelism.
3+
4+
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
25
// RUN: %CPU_RUN_PLACEHOLDER %t.out
36
// RUN: %GPU_RUN_PLACEHOLDER %t.out
47
// RUN: %ACC_RUN_PLACEHOLDER %t.out
5-
// XFAIL: cuda
68

79
#include <CL/sycl.hpp>
810

sycl/test/basic_tests/sampler/sampler.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
// RUN: %GPU_RUN_PLACEHOLDER %t.out
77
// RUN: %ACC_RUN_PLACEHOLDER %t.out
88

9-
// TODO: Image support in CUDA backend
10-
// XFAIL: cuda
11-
129
//==--------------- sampler.cpp - SYCL sampler basic test ------------------==//
1310
//
1411
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

sycl/test/fpga_tests/fpga_pipes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// RUN: %CPU_RUN_PLACEHOLDER %t.out
44
// RUN: %GPU_RUN_PLACEHOLDER %t.out
55
// RUN: %ACC_RUN_PLACEHOLDER %t.out
6-
// UNSUPPORTED: cuda
6+
77
//==------------- fpga_pipes.cpp - SYCL FPGA pipes test --------------------==//
88
//
99
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

0 commit comments

Comments
 (0)