Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit 83e2ad8

Browse files
committed
Merge remote-tracking branch 'origin/intel' into CopyToFixTest
2 parents 00f5c66 + 6b9e418 commit 83e2ad8

28 files changed

+167
-26
lines changed

SYCL/Assert/assert_in_kernels_ndebug.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// FIXME unsupported on CUDA and HIP until fallback libdevice becomes available
2-
// UNSUPPORTED: cuda || hip
1+
// FIXME unsupported on HIP until fallback libdevice becomes available
2+
// UNSUPPORTED: hip
33
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -DNDEBUG %S/assert_in_kernels.cpp -o %t.out
44
// RUN: %CPU_RUN_PLACEHOLDER %t.out %CPU_CHECK_PLACEHOLDER
55
// RUN: %GPU_RUN_PLACEHOLDER %t.out %GPU_CHECK_PLACEHOLDER

SYCL/BFloat16/bfloat16_type_cuda.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// REQUIRES: gpu, cuda
22
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -Xsycl-target-backend --cuda-gpu-arch=sm_80 %s -o %t.out
3-
// TODO: Currently the CI does not have a sm_80 capable machine. Enable the test
4-
// execution once it does.
5-
// RUNx: %t.out
3+
// RUN: %t.out
64

75
//==--------- bfloat16_type_cuda.cpp - SYCL bfloat16 type test -------------==//
86
//
@@ -14,4 +12,13 @@
1412

1513
#include "bfloat16_type.hpp"
1614

17-
int main() { return run_tests(); }
15+
int main() {
16+
bool has_bfloat16_aspect = false;
17+
for (const auto &plt : sycl::platform::get_platforms()) {
18+
if (plt.has(aspect::ext_oneapi_bfloat16))
19+
has_bfloat16_aspect = true;
20+
}
21+
22+
if (has_bfloat16_aspect)
23+
return run_tests();
24+
}

SYCL/Basic/accessor/accessor.cpp

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,40 @@ int main() {
556556
return 1;
557557
}
558558
}
559+
560+
// placeholder accessor exception // SYCL2020 4.7.6.9
561+
{
562+
sycl::queue q;
563+
// host device executes kernels via a different method and there
564+
// is no good way to throw an exception at this time.
565+
if (!q.is_host()) {
566+
sycl::range<1> r(4);
567+
sycl::buffer<int, 1> b(r);
568+
try {
569+
sycl::accessor<int, 1, sycl::access::mode::read_write,
570+
sycl::access::target::device,
571+
sycl::access::placeholder::true_t>
572+
acc(b);
573+
574+
q.submit([&](sycl::handler &cgh) {
575+
// we do NOT call .require(acc) without which we should throw a
576+
// synchronous exception with errc::kernel_argument
577+
cgh.parallel_for<class ph>(
578+
r, [=](sycl::id<1> index) { acc[index] = 0; });
579+
});
580+
q.wait_and_throw();
581+
assert(false && "we should not be here, missing exception");
582+
} catch (sycl::exception &e) {
583+
std::cout << "exception received: " << e.what() << std::endl;
584+
assert(e.code() == sycl::errc::kernel_argument &&
585+
"incorrect error code");
586+
} catch (...) {
587+
std::cout << "some other exception" << std::endl;
588+
return 1;
589+
}
590+
}
591+
}
592+
559593
{
560594
try {
561595
int data = -1;

SYCL/Basic/aspects.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ int main() {
5757
if (plt.has(aspect::fp64)) {
5858
std::cout << " fp64" << std::endl;
5959
}
60+
if (plt.has(aspect::ext_oneapi_bfloat16)) {
61+
std::cout << " ext_oneapi_bfloat16" << std::endl;
62+
}
6063
if (plt.has(aspect::int64_base_atomics)) {
6164
std::cout << " base atomic operations" << std::endl;
6265
}

SYCL/DeviceLib/cmath_fp64_test.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
// RUN: %CPU_RUN_PLACEHOLDER %t.out
44
// RUN: %ACC_RUN_PLACEHOLDER %t.out
55

6+
// RUN: %clangxx -fsycl -fsycl-device-lib-jit-link %s -o %t.out
7+
// RUN: %HOST_RUN_PLACEHOLDER %t.out
8+
// RUN: %CPU_RUN_PLACEHOLDER %t.out
9+
// RUN: %ACC_RUN_PLACEHOLDER %t.out
10+
611
#include "math_utils.hpp"
712
#include <CL/sycl.hpp>
813
#include <cmath>

SYCL/DeviceLib/cmath_test.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
// RUN: %CPU_RUN_PLACEHOLDER %t.out
44
// RUN: %ACC_RUN_PLACEHOLDER %t.out
55

6+
// RUN: %clangxx -fsycl -fno-builtin -fsycl-device-lib-jit-link %s -o %t.out
7+
// RUN: %HOST_RUN_PLACEHOLDER %t.out
8+
// RUN: %CPU_RUN_PLACEHOLDER %t.out
9+
// RUN: %ACC_RUN_PLACEHOLDER %t.out
10+
611
#include "math_utils.hpp"
712
#include <CL/sycl.hpp>
813
#include <cmath>

SYCL/DeviceLib/math_fp64_test.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
// RUN: %CPU_RUN_PLACEHOLDER %t.out
44
// RUN: %ACC_RUN_PLACEHOLDER %t.out
55

6+
// RUN: %clangxx -fsycl -fsycl-device-lib-jit-link %s -o %t.out
7+
// RUN: %HOST_RUN_PLACEHOLDER %t.out
8+
// RUN: %CPU_RUN_PLACEHOLDER %t.out
9+
// RUN: %ACC_RUN_PLACEHOLDER %t.out
10+
611
#include "math_utils.hpp"
712
#include <CL/sycl.hpp>
813
#include <cstdint>

SYCL/DeviceLib/math_test.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
// RUN: %CPU_RUN_PLACEHOLDER %t.out
44
// RUN: %ACC_RUN_PLACEHOLDER %t.out
55

6+
// RUN: %clangxx -fsycl -fsycl-device-lib-jit-link %s -o %t.out
7+
// RUN: %HOST_RUN_PLACEHOLDER %t.out
8+
// RUN: %CPU_RUN_PLACEHOLDER %t.out
9+
// RUN: %ACC_RUN_PLACEHOLDER %t.out
10+
611
#include "math_utils.hpp"
712
#include <CL/sycl.hpp>
813
#include <cstdint>

SYCL/DeviceLib/std_complex_math_fp64_test.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
// RUN: %CPU_RUN_PLACEHOLDER %t.out
44
// RUN: %ACC_RUN_PLACEHOLDER %t.out
55

6+
// RUN: %clangxx -fsycl -fsycl-device-lib-jit-link %s -o %t.out
7+
// RUN: %HOST_RUN_PLACEHOLDER %t.out
8+
// RUN: %CPU_RUN_PLACEHOLDER %t.out
9+
// RUN: %ACC_RUN_PLACEHOLDER %t.out
10+
611
#include <CL/sycl.hpp>
712
#include <array>
813
#include <cassert>

SYCL/DeviceLib/std_complex_math_test.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
// RUN: %CPU_RUN_PLACEHOLDER %t.out
44
// RUN: %ACC_RUN_PLACEHOLDER %t.out
55

6+
// RUN: %clangxx -fsycl -fsycl-device-lib-jit-link %s -o %t.out
7+
// RUN: %HOST_RUN_PLACEHOLDER %t.out
8+
// RUN: %CPU_RUN_PLACEHOLDER %t.out
9+
// RUN: %ACC_RUN_PLACEHOLDER %t.out
10+
611
#include <CL/sycl.hpp>
712
#include <array>
813
#include <cassert>

SYCL/DeviceLib/string_test.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
// RUN: %CPU_RUN_PLACEHOLDER %t.out
44
// RUN: %ACC_RUN_PLACEHOLDER %t.out
55

6+
// RUN: %clangxx -fsycl -fno-builtin -fsycl-device-lib-jit-link %s -o %t.out
7+
// RUN: %HOST_RUN_PLACEHOLDER %t.out
8+
// RUN: %CPU_RUN_PLACEHOLDER %t.out
9+
// RUN: %ACC_RUN_PLACEHOLDER %t.out
10+
611
#include <CL/sycl.hpp>
712
#include <cassert>
813
#include <cstdint>

SYCL/ESIMD/histogram_raw_send.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
77
//
88
//===----------------------------------------------------------------------===//
9-
// REQUIRES: gpu
9+
// REQUIRES: gpu-intel-gen9
1010
// UNSUPPORTED: gpu-intel-dg1,cuda,hip
1111
// UNSUPPORTED: ze_debug-1,ze_debug4
1212
// RUN: %clangxx -fsycl %s -o %t.out

SYCL/ESIMD/vadd_raw_send.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
77
//
88
//===----------------------------------------------------------------------===//
9-
// REQUIRES: gpu
9+
// REQUIRES: gpu-intel-gen9
1010
// UNSUPPORTED: gpu-intel-dg1,cuda,hip
1111
// TODO: esimd_emulator fails due to unimplemented 'raw_send' intrinsic
1212
// XFAIL: esimd_emulator

SYCL/GroupAlgorithm/exclusive_scan_over_group.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// UNSUPPORTED: cuda || hip
1+
// UNSUPPORTED: hip
22
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
33
// RUN: %GPU_RUN_PLACEHOLDER %t.out
44
// UNSUPPORTED: ze_debug4,ze_debug-1

SYCL/GroupAlgorithm/exclusive_scan_sycl2020.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// UNSUPPORTED: cuda || hip
1+
// UNSUPPORTED: hip
22
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -fsycl-device-code-split=per_kernel %s -I . -o %t.out
33
// RUN: %CPU_RUN_PLACEHOLDER %t.out
44
// RUN: %GPU_RUN_PLACEHOLDER %t.out

SYCL/GroupAlgorithm/inclusive_scan_sycl2020.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// UNSUPPORTED: cuda || hip
1+
// UNSUPPORTED: hip
22
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -fsycl-device-code-split=per_kernel %s -I . -o %t.out
33
// RUN: %CPU_RUN_PLACEHOLDER %t.out
44
// RUN: %GPU_RUN_PLACEHOLDER %t.out

SYCL/GroupAlgorithm/reduce_sycl2020.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// UNSUPPORTED: cuda || hip
1+
// UNSUPPORTED: hip
22
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -fsycl-device-code-split=per_kernel %s -I . -o %t.out
33
// RUN: %CPU_RUN_PLACEHOLDER %t.out
44
// RUN: %GPU_RUN_PLACEHOLDER %t.out

SYCL/Plugin/interop-cuda-experimental.cpp

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,4 +95,62 @@ int main() {
9595
sycl::queue new_Q(sycl_ctx, sycl::default_selector());
9696
assert(check_queue(new_Q));
9797
}
98+
99+
// Create new event
100+
CUevent cu_event;
101+
102+
CUDA_CHECK(cuCtxSetCurrent(cu_ctx));
103+
CUDA_CHECK(cuEventCreate(&cu_event, CU_EVENT_DEFAULT));
104+
105+
auto sycl_event =
106+
sycl::make_event<sycl::backend::ext_oneapi_cuda>(cu_event, sycl_ctx);
107+
auto native_event =
108+
sycl::get_native<sycl::backend::ext_oneapi_cuda>(sycl_event);
109+
110+
check_type<sycl::event>(sycl_event);
111+
check_type<CUevent>(native_event);
112+
113+
// Check sycl queue with sycl_ctx still works
114+
{
115+
sycl::queue new_Q(sycl_ctx, sycl::default_selector());
116+
assert(check_queue(new_Q));
117+
}
118+
119+
// Check has_native_event
120+
{
121+
auto e = Q.submit([&](sycl::handler &cgh) { cgh.single_task([] {}); });
122+
assert(sycl::ext::oneapi::cuda::has_native_event(e));
123+
}
124+
125+
{
126+
auto e = Q.submit([&](sycl::handler &cgh) { cgh.host_task([] {}); });
127+
assert(!sycl::ext::oneapi::cuda::has_native_event(e));
128+
}
129+
130+
// Create new queue
131+
CUstream cu_queue;
132+
CUDA_CHECK(cuCtxSetCurrent(cu_ctx));
133+
CUDA_CHECK(cuStreamCreate(&cu_queue, CU_STREAM_DEFAULT));
134+
135+
auto sycl_queue =
136+
sycl::make_queue<sycl::backend::ext_oneapi_cuda>(cu_queue, sycl_ctx);
137+
native_queue = sycl::get_native<sycl::backend::ext_oneapi_cuda>(sycl_queue);
138+
139+
check_type<sycl::queue>(sycl_queue);
140+
check_type<CUstream>(native_queue);
141+
142+
// Submit some work to new queue
143+
assert(check_queue(sycl_queue));
144+
145+
// Create new queue with Q's native type and submit some work
146+
{
147+
CUstream Q_native_stream =
148+
sycl::get_native<sycl::backend::ext_oneapi_cuda>(Q);
149+
sycl::queue new_Q = sycl::make_queue<sycl::backend::ext_oneapi_cuda>(
150+
Q_native_stream, Q_sycl_ctx);
151+
assert(check_queue(new_Q));
152+
}
153+
154+
// Check Q still works
155+
assert(check_queue(Q));
98156
}

SYCL/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@ unavailable.
163163
* **aot_tool** - Ahead-of-time compilation tools availability;
164164
* **ocloc**, **opencl-aot** - Specific AOT tool availability;
165165
* **level_zero_dev_kit** - Level_Zero headers and libraries availability;
166+
* **gpu-intel-gen9** - Intel GPU Gen9 availability;
167+
* **gpu-intel-gen11** - Intel GPU Gen11 availability;
168+
* **gpu-intel-gen12** - Intel GPU Gen12 availability;
166169
* **gpu-intel-dg1** - Intel GPU DG1 availability;
167170
* **gpu-intel-dg2** - Intel GPU DG2 availability;
168171
* **gpu-intel-pvc** - Intel GPU PVC availability;

SYCL/Sampler/unnormalized-clamp-nearest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// UNSUPPORTED: hip || cuda
1+
// UNSUPPORTED: hip
22
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
33
// RUN: %HOST_RUN_PLACEHOLDER %t.out
44
// RUN: %CPU_RUN_PLACEHOLDER %t.out

SYCL/Sampler/unnormalized-clampedge-nearest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// UNSUPPORTED: hip || cuda
1+
// UNSUPPORTED: hip
22
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
33
// RUN: %HOST_RUN_PLACEHOLDER %t.out
44
// RUN: %CPU_RUN_PLACEHOLDER %t.out

SYCL/Sampler/unnormalized-none-nearest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// UNSUPPORTED: hip || cuda
1+
// UNSUPPORTED: hip
22
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
33
// RUN: %HOST_RUN_PLACEHOLDER %t.out
44
// RUN: %CPU_RUN_PLACEHOLDER %t.out

SYCL/SpecConstants/2020/handler-api.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
// RUN: %CPU_RUN_PLACEHOLDER %t.out
1414
// RUN: %GPU_RUN_PLACEHOLDER %t.out
1515
// FIXME: ACC devices use emulation path, which is not yet supported
16-
// FIXME: CUDA uses emulation path, which is not yet supported
17-
// UNSUPPORTED: cuda || hip
16+
// UNSUPPORTED: hip
1817

1918
#include <cstdlib>
2019
#include <iostream>

SYCL/SpecConstants/2020/host_apis.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// RUN: -fsycl-dead-args-optimization
33
// RUN: %BE_RUN_PLACEHOLDER %t.out
44

5-
// UNSUPPORTED: cuda
65
// UNSUPPORTED: hip
76

87
#include <sycl/sycl.hpp>

SYCL/SpecConstants/2020/kernel-bundle-api.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
// RUN: %CPU_RUN_PLACEHOLDER %t.out
1414
// RUN: %GPU_RUN_PLACEHOLDER %t.out
1515
// FIXME: ACC devices use emulation path, which is not yet supported
16-
// FIXME: CUDA uses emulation path, which is not yet supported
17-
// UNSUPPORTED: cuda || hip
16+
// UNSUPPORTED: hip
1817

1918
#include <cstdlib>
2019
#include <iostream>

SYCL/SpecConstants/2020/non_native/cuda.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,5 @@
33
// RUN: %clangxx -fsycl -fsycl-targets=nvptx64-nvidia-cuda %S/Inputs/common.cpp -o %t.out
44
// RUN: env SYCL_DEVICE_FILTER=cuda %t.out
55

6-
// TODO: enable this test then compile-time error in sycl-post-link is fixed
7-
// UNSUPPORTED: cuda
8-
96
// This test checks correctness of SYCL2020 non-native specialization constants
107
// on CUDA device

SYCL/SpecConstants/2020/vector-convolution-demo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %CPU_RUN_PLACEHOLDER %t.out
33
// RUN: %GPU_RUN_PLACEHOLDER %t.out
44

5-
// UNSUPPORTED: cuda || hip
5+
// UNSUPPORTED: hip
66

77
// This test checks the spenario of using specialization constants with an
88
// 'array of array' as well as a 'stuct with an array of array' types for

SYCL/lit.cfg.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,19 @@
100100
config.substitutions.append( ('%obj_ext', '.o') )
101101
config.substitutions.append( ('%sycl_include', config.sycl_include ) )
102102

103+
# Intel GPU FAMILY availability
104+
if lit_config.params.get('gpu-intel-gen9', False):
105+
config.available_features.add('gpu-intel-gen9')
106+
if lit_config.params.get('gpu-intel-gen11', False):
107+
config.available_features.add('gpu-intel-gen11')
108+
if lit_config.params.get('gpu-intel-gen12', False):
109+
config.available_features.add('gpu-intel-gen12')
110+
111+
# Intel GPU DEVICE availability
103112
if lit_config.params.get('gpu-intel-dg1', False):
104113
config.available_features.add('gpu-intel-dg1')
105-
106114
if lit_config.params.get('gpu-intel-dg2', False):
107115
config.available_features.add('gpu-intel-dg2')
108-
109116
if lit_config.params.get('gpu-intel-pvc', False):
110117
config.available_features.add('gpu-intel-pvc')
111118

0 commit comments

Comments
 (0)