This repository was archived by the owner on Mar 28, 2023. It is now read-only.
forked from llvm/llvm-test-suite
-
Notifications
You must be signed in to change notification settings - Fork 130
[SYCL] Adds extensive testing for SYCL2020 implicitly device copyable types. #1583
Merged
bader
merged 5 commits into
intel:intel
from
maarquitos14:maronas/implicit-device-copyable-types
Feb 15, 2023
Merged
[SYCL] Adds extensive testing for SYCL2020 implicitly device copyable types. #1583
bader
merged 5 commits into
intel:intel
from
maarquitos14:maronas/implicit-device-copyable-types
Feb 15, 2023
Conversation
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
Signed-off-by: Maronas, Marcos <[email protected]>
Signed-off-by: Maronas, Marcos <[email protected]>
Comment on lines
42
to
59
{ | ||
sycl::buffer<std::pair<int, float>, 1> buf_pair_arr{ | ||
result_pair_arr, sycl::range<1>(arr_size)}; | ||
sycl::buffer<std::pair<int, float>, 1> buf_pair{&result_pair, | ||
sycl::range<1>(1)}; | ||
|
||
q.submit([&](sycl::handler &cgh) { | ||
auto acc_pair_arr = | ||
sycl::accessor{buf_pair_arr, cgh, sycl::read_write}; | ||
auto acc_pair = sycl::accessor{buf_pair, cgh, sycl::read_write}; | ||
cgh.single_task([=]() { | ||
for (auto i = 0; i < arr_size; i++) { | ||
acc_pair_arr[i] = pair_arr[i]; | ||
} | ||
acc_pair[0] = pair; | ||
}); | ||
}).wait_and_throw(); | ||
} |
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.
This looks like it is the same for most of the test cases, except for the type used. Could it be moved to a common function? I'm thinking something like:
template <typename DataT, size_t ArrSize>
void CaptureAndCopy(const DataT *data_arr, const DataT &data_scalar, DataT *result_arr, DataT *result_scalar) {
sycl::buffer<DataT, 1> buf_arr{result_arr, sycl::range<1>(ArrSize)};
sycl::buffer<DataT, 1> buf_scalar{&result_scalar, sycl::range<1>(1)};
q.submit([&](sycl::handler &cgh) {
auto acc_arr = sycl::accessor{buf_arr, cgh, sycl::read_write};
auto acc_scalar = sycl::accessor{buf_scalar, cgh, sycl::read_write};
cgh.single_task([=]() {
for (auto i = 0; i < ArrSize; i++) {
acc_arr[i] = data_arr[i];
}
acc_scalar[0] = data_scalar;
});
});
}
Signed-off-by: Maronas, Marcos <[email protected]>
steffenlarsen
approved these changes
Feb 9, 2023
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.
LGTM!
Signed-off-by: Maronas, Marcos <[email protected]>
Signed-off-by: Maronas, Marcos <[email protected]>
steffenlarsen
pushed a commit
that referenced
this pull request
Feb 17, 2023
…1596) #1583 introduced a clang-format issue. This fixes the issue. --------- Signed-off-by: Maronas, Marcos <[email protected]>
myler
pushed a commit
to myler/llvm-test-suite
that referenced
this pull request
Mar 22, 2023
…e types. (intel#1583) Signed-off-by: Maronas, Marcos <[email protected]>
myler
pushed a commit
to myler/llvm-test-suite
that referenced
this pull request
Mar 22, 2023
…ntel#1596) intel#1583 introduced a clang-format issue. This fixes the issue. --------- Signed-off-by: Maronas, Marcos <[email protected]>
aelovikov-intel
pushed a commit
to aelovikov-intel/llvm
that referenced
this pull request
Mar 27, 2023
…e types. (intel/llvm-test-suite#1583) Signed-off-by: Maronas, Marcos <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Signed-off-by: Maronas, Marcos [email protected]