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

Commit 3119014

Browse files
authored
[ESIMD] Add a test verifying that enable-preemption is on by default (#613)
Signed-off-by: Vyacheslav N Klochkov <[email protected]>
1 parent 8340e5c commit 3119014

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

SYCL/ESIMD/preemption.cpp

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
//==---------------- preemption.cpp - DPC++ ESIMD on-device test ----------==//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
// REQUIRES: gpu && linux
9+
// UNSUPPORTED: cuda || hip
10+
// TODO: remove XFAIL once GPU RT starts using "enablePreemption" by default.
11+
// XFAIL: *
12+
// RUN: %clangxx -fsycl %s -o %t.out
13+
// RUN: %GPU_RUN_PLACEHOLDER IGC_DumpToCustomDir=%t.dump IGC_ShaderDumpEnable=1 %t.out
14+
// RUN: grep enablePreemption %t.dump/*.asm
15+
16+
// The test expects to see "enablePreemption" switch in the compilation
17+
// switches. It fails if does not find it.
18+
19+
#include "esimd_test_utils.hpp"
20+
21+
#include <CL/sycl.hpp>
22+
#include <iostream>
23+
#include <sycl/ext/intel/experimental/esimd.hpp>
24+
25+
using namespace cl::sycl;
26+
27+
int main() {
28+
queue q;
29+
q.submit([&](handler &cgh) {
30+
cgh.parallel_for<class Test>(sycl::range<1>{1},
31+
[=](id<1> id) SYCL_ESIMD_KERNEL {});
32+
});
33+
return 0;
34+
}

0 commit comments

Comments
 (0)