-
Notifications
You must be signed in to change notification settings - Fork 798
[SYCL] [E2E] fix reenabled tests #15975
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
AlexeySachkov
merged 16 commits into
intel:sycl
from
dklochkov-emb:sycl-fix-reenabled-e2e-tests
Dec 19, 2024
Merged
Changes from 10 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
f42b6b8
[SYCL] [E2E] fix reenabled tests
dklochkov-emb e9df52d
[SYCL] do not test zero level backend with other backends
dklochkov-emb 6c55155
[SYCL] fix firmatting
dklochkov-emb ef0c989
[SYCL] remove unnecessary include for cuda build
dklochkov-emb fe763c3
[SYCL] fix include issue
dklochkov-emb e3504c6
[SYCL] fix CUDA build
dklochkov-emb ebaf36e
[SYCL][E2E] fix cuda test build option
dklochkov-emb 8719cdc
[SYCL][E2E] include missing header
dklochkov-emb 0d57a09
[SYCL][E2E] do not use additional cuda build option
dklochkov-emb d208a9b
[SYCL][E2E] disable cuda test and create issue
dklochkov-emb 173303b
[SYCL][E2E] do not pass unused variable
dklochkov-emb 8625a1b
[SYCL][E2E] remove test which exists in sycl/test
dklochkov-emb 62ae7c3
Merge branch 'sycl' into sycl-fix-reenabled-e2e-tests
dklochkov-emb 2aa9d12
[SYCL] [E2E] remove duplicated env variable from lit config
dklochkov-emb 6de1ba2
Merge branch 'sycl' into sycl-fix-reenabled-e2e-tests
dklochkov-emb e7ffec6
[SYCL] include kernel bundle header in test
dklochkov-emb 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
85 changes: 85 additions & 0 deletions
85
sycl/test-e2e/Basic/interop/Interop_level_zero_backend.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,85 @@ | ||
| // RUN: %if any-device-is-level_zero %{ %{build} -isystem %sycl_include -DBUILD_FOR_L0 -o %t-l0.out %} | ||
|
|
||
| #include <sycl/backend.hpp> | ||
| #include <sycl/detail/core.hpp> | ||
| #include <sycl/properties/all_properties.hpp> | ||
| #include <sycl/usm.hpp> | ||
| using namespace sycl; | ||
|
|
||
| constexpr auto BACKEND = backend::ext_oneapi_level_zero; | ||
| using nativeDevice = ze_device_handle_t; | ||
| using nativeQueue = ze_command_queue_handle_t; | ||
| using nativeEvent = ze_event_handle_t; | ||
|
|
||
| constexpr int N = 100; | ||
| constexpr int VAL = 3; | ||
|
|
||
| int main() { | ||
|
|
||
| assert(static_cast<bool>( | ||
| std::is_same_v<backend_traits<BACKEND>::return_type<device>, | ||
| nativeDevice>)); | ||
| assert(static_cast<bool>( | ||
| std::is_same_v<backend_traits<BACKEND>::return_type<queue>, | ||
| nativeQueue>)); | ||
| assert(static_cast<bool>( | ||
| std::is_same_v<backend_traits<BACKEND>::return_type<event>, | ||
| nativeEvent>)); | ||
|
|
||
| device Device; | ||
| backend_traits<BACKEND>::return_type<device> NativeDevice = | ||
| get_native<BACKEND>(Device); | ||
| // Create sycl device with a native device. | ||
| auto InteropDevice = make_device<BACKEND>(NativeDevice); | ||
|
|
||
| context Context(InteropDevice); | ||
|
|
||
| // Create sycl queue with device created from a native device. | ||
| queue Queue(InteropDevice, {sycl::property::queue::in_order()}); | ||
| backend_traits<BACKEND>::return_type<queue> NativeQueue = | ||
| get_native<BACKEND>(Queue); | ||
| backend_traits<BACKEND>::input_type<queue> InputType(NativeQueue, Device); | ||
|
|
||
| auto InteropQueue = make_queue<BACKEND>(InputType, Context); | ||
|
|
||
| auto A = (int *)malloc_device(N * sizeof(int), InteropQueue); | ||
| std::vector<int> vec(N, 0); | ||
|
|
||
| auto Event = Queue.submit([&](handler &h) { | ||
| h.parallel_for<class kern1>(range<1>(N), | ||
| [=](id<1> item) { A[item] = VAL; }); | ||
| }); | ||
|
|
||
| backend_traits<BACKEND>::return_type<event> NativeEvent = | ||
| get_native<BACKEND>(Event); | ||
| backend_traits<BACKEND>::input_type<event> EventInputType; | ||
| EventInputType.NativeHandle = NativeEvent; | ||
| // Create sycl event with a native event. | ||
| event InteropEvent = make_event<BACKEND>(EventInputType, Context); | ||
|
|
||
| // depends_on sycl event created from a native event. | ||
| auto Event2 = InteropQueue.submit([&](handler &h) { | ||
| h.depends_on(InteropEvent); | ||
| h.parallel_for<class kern2>(range<1>(N), [=](id<1> item) { A[item]++; }); | ||
| }); | ||
|
|
||
| auto Event3 = InteropQueue.memcpy(&vec[0], A, N * sizeof(int), Event2); | ||
| Event3.wait(); | ||
|
|
||
| if constexpr (BACKEND == backend::ext_oneapi_hip) { | ||
| try { | ||
| backend_traits<BACKEND>::return_type<context> NativeContext = | ||
| get_native<BACKEND>(Context); | ||
| } catch (sycl::exception &e) { | ||
| assert(e.code() == sycl::errc::feature_not_supported); | ||
| } | ||
| } | ||
|
|
||
| free(A, InteropQueue); | ||
|
|
||
| for (const auto &val : vec) { | ||
| assert(val == VAL + 1); | ||
| } | ||
|
|
||
| return 0; | ||
| } | ||
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
11 changes: 5 additions & 6 deletions
11
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 |
|---|---|---|
| @@ -1,8 +1,7 @@ | ||
| // REQUIRES: ocloc, level_zero, gpu, cpu | ||
| // REQUIRES: ocloc, any-device-is-level_zero, any-device-is-gpu, any-device-is-cpu | ||
|
|
||
| // RUN: %clangxx -fsycl -fsycl-targets=spir64_fpga,spir64_gen -Xsycl-target-backend "-device *" %S/Inputs/is_compatible_with_env.cpp -o %t.out | ||
| // RUN: %clangxx -fsycl -fsycl-targets=spir64_gen -Xsycl-target-backend=spir64_gen "-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:fpga %{run} %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-unfiltered-devices} not %t.out | ||
| // RUN: env ONEAPI_DEVICE_SELECTOR=opencl:gpu %{run-unfiltered-devices} %t.out | ||
| // RUN: env ONEAPI_DEVICE_SELECTOR=level_zero:gpu %{run-unfiltered-devices} %t.out |
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is
BUILD_FOR_L0still used? I think it can be dropped, no?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, dropped. Thanks.