File tree Expand file tree Collapse file tree 2 files changed +44
-1
lines changed Expand file tree Collapse file tree 2 files changed +44
-1
lines changed Original file line number Diff line number Diff line change 1
1
// RUN: %clangxx -fsycl %s -o %t.out
2
2
// RUN: env SYCL_OVERRIDE_PI_OPENCL=opencl_test env SYCL_OVERRIDE_PI_LEVEL_ZERO=l0_test env SYCL_OVERRIDE_PI_CUDA=cuda_test env SYCL_OVERRIDE_PI_ROCM=rocm_test env SYCL_PI_TRACE=-1 %t.out > %t.log 2>&1
3
- // FileCheck %s --input-file %t.log
3
+ // RUN: FileCheck %s --input-file %t.log
4
4
5
5
#include < sycl/sycl.hpp>
6
6
Original file line number Diff line number Diff line change
1
+ // RUN: %clangxx -fsycl -DFAKE_PLUGIN -shared %s -o %t_fake_plugin.so
2
+ // RUN: %clangxx -fsycl %s -o %t.out
3
+ // RUN: env SYCL_OVERRIDE_PI_OPENCL=%t_fake_plugin.so env SYCL_OVERRIDE_PI_LEVEL_ZERO=%t_fake_plugin.so env SYCL_OVERRIDE_PI_CUDA=%t_fake_plugin.so env SYCL_OVERRIDE_PI_ROCM=%t_fake_plugin.so env SYCL_PI_TRACE=-1 %t.out > %t.log 2>&1
4
+ // RUN: FileCheck %s --input-file %t.log
5
+ // REQUIRES: linux
6
+
7
+ #ifdef FAKE_PLUGIN
8
+
9
+ #include < CL/sycl/detail/pi.h>
10
+
11
+ pi_result piPlatformsGet (pi_uint32 NumEntries, pi_platform *Platforms,
12
+ pi_uint32 *NumPlatforms) {
13
+ return PI_INVALID_OPERATION;
14
+ }
15
+
16
+ pi_result piTearDown (void *) { return PI_SUCCESS; }
17
+
18
+ pi_result piPluginInit (pi_plugin *PluginInit) {
19
+ PluginInit->PiFunctionTable .piPlatformsGet = piPlatformsGet;
20
+ PluginInit->PiFunctionTable .piTearDown = piTearDown;
21
+ return PI_SUCCESS;
22
+ }
23
+
24
+ #else
25
+
26
+ #include < sycl/sycl.hpp>
27
+
28
+ int main () {
29
+ try {
30
+ sycl::platform P{sycl::default_selector{}};
31
+ } catch (...) {
32
+ // NOP
33
+ }
34
+
35
+ return 0 ;
36
+ }
37
+
38
+ #endif
39
+
40
+ // CHECK: SYCL_PI_TRACE[basic]: Plugin found and successfully loaded: {{[0-9a-zA-Z_\/\.]+}}_fake_plugin.so
41
+ // CHECK: SYCL_PI_TRACE[basic]: Plugin found and successfully loaded: {{[0-9a-zA-Z_\/\.]+}}_fake_plugin.so
42
+ // CHECK: SYCL_PI_TRACE[basic]: Plugin found and successfully loaded: {{[0-9a-zA-Z_\/\.]+}}_fake_plugin.so
43
+ // CHECK: SYCL_PI_TRACE[basic]: Plugin found and successfully loaded: {{[0-9a-zA-Z_\/\.]+}}_fake_plugin.so
You can’t perform that action at this time.
0 commit comments