-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed
try_compile
with try_run
in cmake SYCL feature check
- Loading branch information
1 parent
83712f6
commit 993728e
Showing
5 changed files
with
47 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
#include <sycl/sycl.hpp> | ||
#include <iostream> | ||
|
||
|
||
int main() { | ||
sycl::queue q; | ||
|
||
int* i = sycl::malloc_shared<int>(1, q); | ||
q.submit([&](sycl::handler& cgh) { | ||
q.parallel_for(sycl::nd_range<1>{{1}, {1}}, [=](sycl::nd_item<1> item) { | ||
cgh.parallel_for(sycl::nd_range<1>{{1}, {1}}, [=](sycl::nd_item<1> item) { | ||
// call only the group algorithms used in SYCL-Bench | ||
sycl::reduce_over_group(item.get_group(), 0, sycl::plus<int>{}); | ||
*i = sycl::reduce_over_group(item.get_group(), 1, sycl::plus<int>{}); | ||
}); | ||
}); | ||
}).wait(); | ||
|
||
assert(*i == 1); | ||
sycl::free(i, q); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters