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

Commit 65a27fb

Browse files
[SYCL] Add a test for new partition property filtering (#76)
Signed-off-by: Chris Perkins <[email protected]>
1 parent d90df40 commit 65a27fb

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

SYCL/Plugin/sycl-partition-info.cpp

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
2+
// RUN: %HOST_RUN_PLACEHOLDER %t.out
3+
// RUN: %CPU_RUN_PLACEHOLDER %t.out
4+
// RUN: %GPU_RUN_PLACEHOLDER %t.out
5+
// RUN: %ACC_RUN_PLACEHOLDER %t.out
6+
7+
// various plugins may return a larger choice of partition properties than SYCL
8+
// supports ensure we are only returning SYCL standard partition properties.
9+
10+
#include <CL/sycl.hpp>
11+
#include <cassert>
12+
13+
using namespace sycl;
14+
15+
int main(void) {
16+
device d;
17+
18+
auto pp = d.get_info<info::device::partition_properties>();
19+
20+
for (auto &p : pp) {
21+
switch (p) {
22+
case info::partition_property::no_partition:
23+
case info::partition_property::partition_equally:
24+
case info::partition_property::partition_by_counts:
25+
case info::partition_property::partition_by_affinity_domain:
26+
break;
27+
default:
28+
assert(false && "Unrecognized partition property");
29+
}
30+
}
31+
32+
return 0;
33+
}

0 commit comments

Comments
 (0)