-
Notifications
You must be signed in to change notification settings - Fork 797
[SYCL] Improve is_compatible #9769
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
dm-vodopyanov
merged 10 commits into
intel:sycl
from
KornevNikita:improve-is-compatible
Jun 14, 2023
Merged
Changes from 5 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
08ff2dc
[WIP][SYCL] Improve is_compatible
KornevNikita b0c54ef
Modify logic
KornevNikita 44d5c89
Add tests for CUDA & HIP
KornevNikita 1bafaa7
Add test with multiple bin images
KornevNikita 7cce706
Improve base test & add esimd backend
KornevNikita b4cb2dd
Update tests requirements & add spir64 test
KornevNikita 187bf48
Improve esimd BE handling & add esimd test
KornevNikita d3ea554
Fix build
KornevNikita 12cef4a
Merge remote-tracking branch 'upstream/sycl' into improve-is-compatible
KornevNikita 712f2ef
Apply suggestions
KornevNikita File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
14 changes: 14 additions & 0 deletions
14
sycl/test-e2e/OptionalKernelFeatures/is_compatible/Inputs/is_compatible_with_env.cpp
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#include <sycl/sycl.hpp> | ||
|
||
int main() { | ||
sycl::device dev; | ||
if (sycl::is_compatible<class Kernel>(dev)) { | ||
sycl::queue q(dev); | ||
q.submit([&](sycl::handler &cgh) { | ||
cgh.parallel_for<class Kernel>(sycl::range<1>{1}, | ||
[=](sycl::id<1> Id) { int x = Id[0]; }); | ||
}).wait_and_throw(); | ||
return 0; | ||
} | ||
return 1; | ||
} |
7 changes: 7 additions & 0 deletions
7
sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_amdgcn.cpp
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// REQUIRES: hip | ||
|
||
// RUN: %clangxx -fsycl -Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=gfx906 -fsycl-targets=amdgcn-amd-amdhsa %S/Inputs/is_compatible_with_env.cpp -o %t.out | ||
|
||
// RUN: env ONEAPI_DEVICE_SELECTOR=hip:gpu %{run} %t.out | ||
// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:gpu %{run} not %t.out | ||
// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:cpu %{run} not %t.out |
7 changes: 7 additions & 0 deletions
7
sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_nvptx64.cpp
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// REQUIRES: cuda | ||
|
||
// RUN: %clangxx -fsycl -fsycl-targets=nvptx64-nvidia-cuda %S/Inputs/is_compatible_with_env.cpp -o %t.out | ||
|
||
// RUN: env ONEAPI_DEVICE_SELECTOR=cuda:gpu %{run} %t.out | ||
// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:gpu %{run} not %t.out | ||
// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:cpu %{run} not %t.out |
8 changes: 8 additions & 0 deletions
8
sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_several_targets.cpp
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// REQUIRES: level_zero, accelerator | ||
|
||
// RUN: %clangxx -fsycl -fsycl-targets=spir64_fpga,spir64_gen -Xsycl-target-backend "-device *" %S/Inputs/is_compatible_with_env.cpp -o %t.out | ||
|
||
// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:cpu %{run} not %t.out | ||
// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:acc %{run} %t.out | ||
// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:gpu %{run} %t.out | ||
// RUN: env ONEAPI_DEVICE_SELECTOR=level_zero:gpu %{run} %t.out |
7 changes: 7 additions & 0 deletions
7
sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64_fpga.cpp
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// REQUIRES: gpu, accelerator | ||
KornevNikita marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
// RUN: %clangxx -fsycl -fsycl-targets=spir64_fpga %S/Inputs/is_compatible_with_env.cpp -o %t.out | ||
|
||
// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:fpga %{run} %t.out | ||
// RUN: env ONEAPI_DEVICE_SELECTOR=*:gpu %{run} not %t.out | ||
// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:cpu %{run} not %t.out |
7 changes: 7 additions & 0 deletions
7
sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64_gen.cpp
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// REQUIRES: ocloc, gpu, level_zero, opencl | ||
|
||
// RUN: %clangxx -fsycl -fsycl-targets=spir64_gen -Xsycl-target-backend "-device *" %S/Inputs/is_compatible_with_env.cpp -o %t.out | ||
|
||
// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:gpu %{run} %t.out | ||
// RUN: env ONEAPI_DEVICE_SELECTOR=level_zero:gpu %{run} %t.out | ||
// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:cpu %{run} not %t.out |
7 changes: 7 additions & 0 deletions
7
sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64_x86_64.cpp
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// REQUIRES: level_zero | ||
KornevNikita marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
// RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64 %S/Inputs/is_compatible_with_env.cpp -o %t.out | ||
|
||
// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:cpu %{run} %t.out | ||
// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:gpu %{run} not %t.out | ||
// RUN: env ONEAPI_DEVICE_SELECTOR=level_zero:gpu %{run} not %t.out |
File renamed without changes.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.