-
Notifications
You must be signed in to change notification settings - Fork 790
[SYCL] Ignore placeholder template parameter for accessor #8071
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 13 commits into
intel:sycl
from
maarquitos14:maronas/ignore_placeholder_accessor
Jan 31, 2023
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
ef67b84
Ignore placeholder template parameter for accessor
maarquitos14 631bad6
Fixes two typos resulting in incorrect behavior
maarquitos14 c3850b4
Merge remote-tracking branch 'intel/origin/sycl' into maronas/ignore_…
maarquitos14 df2d89e
Addressing code review suggestions
maarquitos14 2d82ebf
Merge remote-tracking branch 'intel/origin/sycl' into maronas/ignore_…
maarquitos14 2fabb9a
Merge remote-tracking branch 'intel/origin/sycl' into maronas/ignore_…
maarquitos14 991af44
Bring back %python substitution in sycl_symbols_linux.dump
maarquitos14 15fcfe7
Merge remote-tracking branch 'intel/origin/sycl' into maronas/ignore_…
maarquitos14 bee29ac
Add missing Windows symbols
maarquitos14 7b5d154
Fixing Windows ABI break.
maarquitos14 e7e8d9a
Fixing Windows ABI break
maarquitos14 f3691f8
Addressing code review comments.
maarquitos14 3919fda
Replacing ASSERT by EXPECT in unittest.
maarquitos14 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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,136 @@ | ||
#include <gtest/gtest.h> | ||
|
||
#include <helpers/PiImage.hpp> | ||
#include <helpers/PiMock.hpp> | ||
#include <numeric> | ||
#include <sycl/sycl.hpp> | ||
|
||
TEST(AccessorPlaceholderTest, NoCommandGroupPlaceholderNoneTargetDevice) { | ||
static constexpr sycl::access_mode acmode = sycl::access_mode::read; | ||
static constexpr sycl::access::target actarget = sycl::access::target::device; | ||
using AccT = sycl::accessor<int, 1, acmode, actarget>; | ||
int data(14); | ||
sycl::range<1> r(1); | ||
sycl::buffer<int, 1> data_buf(&data, r); | ||
AccT acc(data_buf); | ||
EXPECT_TRUE(acc.is_placeholder()); | ||
} | ||
|
||
TEST(AccessorPlaceholderTest, NoCommandGroupPlaceholderTrueTargetDevice) { | ||
static constexpr sycl::access_mode acmode = sycl::access_mode::read; | ||
static constexpr sycl::access::target actarget = sycl::access::target::device; | ||
static constexpr sycl::access::placeholder acplaceholder = | ||
sycl::access::placeholder::true_t; | ||
using AccT = sycl::accessor<int, 1, acmode, actarget, acplaceholder>; | ||
int data(14); | ||
sycl::range<1> r(1); | ||
sycl::buffer<int, 1> data_buf(&data, r); | ||
AccT acc(data_buf); | ||
EXPECT_TRUE(acc.is_placeholder()); | ||
} | ||
|
||
TEST(AccessorPlaceholderTest, NoCommandGroupPlaceholderFalseTargetDevice) { | ||
static constexpr sycl::access_mode acmode = sycl::access_mode::read; | ||
static constexpr sycl::access::target actarget = sycl::access::target::device; | ||
static constexpr sycl::access::placeholder acplaceholder = | ||
sycl::access::placeholder::false_t; | ||
using AccT = sycl::accessor<int, 1, acmode, actarget, acplaceholder>; | ||
int data(14); | ||
sycl::range<1> r(1); | ||
sycl::buffer<int, 1> data_buf(&data, r); | ||
AccT acc(data_buf); | ||
EXPECT_TRUE(acc.is_placeholder()); | ||
} | ||
|
||
TEST(AccessorPlaceholderTest, PlaceholderNoneTargetDevice) { | ||
static constexpr sycl::access_mode acmode = sycl::access_mode::read; | ||
static constexpr sycl::access::target actarget = sycl::access::target::device; | ||
using AccT = sycl::accessor<int, 1, acmode, actarget>; | ||
int data(14); | ||
sycl::range<1> r(1); | ||
sycl::buffer<int, 1> data_buf(&data, r); | ||
sycl::unittest::PiMock Mock; | ||
sycl::platform Plt = Mock.getPlatform(); | ||
sycl::queue q{Plt.get_devices()[0]}; | ||
q.submit([&](sycl::handler &cgh) { | ||
AccT acc(data_buf, cgh); | ||
EXPECT_FALSE(acc.is_placeholder()); | ||
}); | ||
} | ||
|
||
TEST(AccessorPlaceholderTest, PlaceholderTrueTargetDevice) { | ||
static constexpr sycl::access_mode acmode = sycl::access_mode::read; | ||
static constexpr sycl::access::target actarget = sycl::access::target::device; | ||
static constexpr sycl::access::placeholder acplaceholder = | ||
sycl::access::placeholder::true_t; | ||
using AccT = sycl::accessor<int, 1, acmode, actarget, acplaceholder>; | ||
int data(14); | ||
sycl::range<1> r(1); | ||
sycl::buffer<int, 1> data_buf(&data, r); | ||
sycl::unittest::PiMock Mock; | ||
sycl::platform Plt = Mock.getPlatform(); | ||
sycl::queue q{Plt.get_devices()[0]}; | ||
q.submit([&](sycl::handler &cgh) { | ||
AccT acc(data_buf, cgh); | ||
EXPECT_FALSE(acc.is_placeholder()); | ||
}); | ||
} | ||
|
||
TEST(AccessorPlaceholderTest, PlaceholderFalseTargetDevice) { | ||
static constexpr sycl::access_mode acmode = sycl::access_mode::read; | ||
static constexpr sycl::access::target actarget = sycl::access::target::device; | ||
static constexpr sycl::access::placeholder acplaceholder = | ||
sycl::access::placeholder::false_t; | ||
using AccT = sycl::accessor<int, 1, acmode, actarget, acplaceholder>; | ||
int data(14); | ||
sycl::range<1> r(1); | ||
sycl::buffer<int, 1> data_buf(&data, r); | ||
sycl::unittest::PiMock Mock; | ||
sycl::platform Plt = Mock.getPlatform(); | ||
sycl::queue q{Plt.get_devices()[0]}; | ||
q.submit([&](sycl::handler &cgh) { | ||
AccT acc(data_buf, cgh); | ||
EXPECT_FALSE(acc.is_placeholder()); | ||
}); | ||
} | ||
|
||
TEST(AccessorPlaceholderTest, PlaceholderNoneTargetHost) { | ||
static constexpr sycl::access_mode acmode = sycl::access_mode::read; | ||
static constexpr sycl::access::target actarget = | ||
sycl::access::target::host_buffer; | ||
using AccT = sycl::accessor<int, 1, acmode, actarget>; | ||
int data(14); | ||
sycl::range<1> r(1); | ||
sycl::buffer<int, 1> data_buf(&data, r); | ||
AccT acc(data_buf); | ||
EXPECT_FALSE(acc.is_placeholder()); | ||
EXPECT_EQ(acc[0], data); | ||
} | ||
|
||
TEST(AccessorPlaceholderTest, PlaceholderTrueTargetHost) { | ||
static constexpr sycl::access_mode acmode = sycl::access_mode::read; | ||
static constexpr sycl::access::target actarget = | ||
sycl::access::target::host_buffer; | ||
static constexpr sycl::access::placeholder acplaceholder = | ||
sycl::access::placeholder::true_t; | ||
using AccT = sycl::accessor<int, 1, acmode, actarget, acplaceholder>; | ||
int data(14); | ||
sycl::range<1> r(1); | ||
sycl::buffer<int, 1> data_buf(&data, r); | ||
AccT acc(data_buf); | ||
EXPECT_FALSE(acc.is_placeholder()); | ||
} | ||
|
||
TEST(AccessorPlaceholderTest, PlaceholderFalseTargetHost) { | ||
static constexpr sycl::access_mode acmode = sycl::access_mode::read; | ||
static constexpr sycl::access::target actarget = | ||
sycl::access::target::host_buffer; | ||
static constexpr sycl::access::placeholder acplaceholder = | ||
sycl::access::placeholder::false_t; | ||
using AccT = sycl::accessor<int, 1, acmode, actarget, acplaceholder>; | ||
int data(14); | ||
sycl::range<1> r(1); | ||
sycl::buffer<int, 1> data_buf(&data, r); | ||
AccT acc(data_buf); | ||
EXPECT_FALSE(acc.is_placeholder()); | ||
} |
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
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.