-
Notifications
You must be signed in to change notification settings - Fork 80
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
Various smaller bugfixes in tests #870
Changes from all commits
0f2a228
363c209
e6aed12
13b2277
ad599db
53fd92f
05c1a78
cb520fd
9fe6b29
52f993b
f9f2894
54d8b79
502a9bf
9008312
0fbac0d
e931257
8764459
8a68532
004bcbf
7d63aba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,19 +67,8 @@ class check_local_accessor_api_methods { | |
util::get_cts_object::range<data_dim<dims>::value>::get(1, 1, 1); | ||
error_buffer_t errorBuffer(errors.get(), sycl::range<1>(2)); | ||
|
||
queue.submit([&](sycl::handler &h) { | ||
queue.submit([&](sycl::handler& h) { | ||
auto acc = make_local_accessor_generic<T, dims, mode>(range, h); | ||
{ | ||
/** check size() method | ||
*/ | ||
auto accessorCount = acc.size(); | ||
check_return_type<size_t>(log, accessorCount, "size()"); | ||
const auto expectedCount = ((dims == 0) ? 1 : count); | ||
if (accessorCount != expectedCount) { | ||
fail_for_accessor<T, dims, mode, target>(log, typeName, | ||
"accessor does not return the correct count"); | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the problem here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This tests the legacy |
||
{ | ||
/** check get_count() method | ||
*/ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -172,15 +172,15 @@ class aquire_release { | |
refA.store(0); | ||
refB.store(0); | ||
sycl::group_barrier(item.get_group()); | ||
if (item.get_local_id() == 0) { | ||
if (item.get_local_id() == sycl::id(0)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do not think so, the constructors are implicit https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html#id-class There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And that is half of the problem, because In our implementation we use some hackery to avoid ambiguity here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So either the special-casing needs to be in the spec, or this explicit construction is correct. |
||
x = refA.load(); | ||
refB.store(1); | ||
} else { | ||
y = refB.load(); | ||
refA.store(1); | ||
} | ||
sycl::group_barrier(item.get_group()); | ||
if (item.get_local_id() == 0) | ||
if (item.get_local_id() == sycl::id(0)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Idem. |
||
res_acc[item.get_group_linear_id()] = !(x == 1 && y == 1); | ||
}); | ||
}); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -194,8 +194,14 @@ TEST_CASE("Constructors for sycl::exception with sycl::errc error codes", | |
check_exception(copy, errcode, sycl::sycl_category()); | ||
} | ||
SECTION("operator=(const exception& other)") { | ||
// sycl::exception is not default-constructible, so explicitly construct | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point! |
||
// `copy` with an error code that is different from `errcode` | ||
std::error_code other_errc(errcode == sycl::errc::success | ||
? sycl::errc::runtime | ||
: sycl::errc::success); | ||
|
||
sycl::exception e(std_errc); | ||
sycl::exception copy; | ||
sycl::exception copy(other_errc); | ||
CHECK_NOTHROW((copy = e)); | ||
check_exception(copy, errcode, sycl::sycl_category()); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -239,7 +239,8 @@ TEMPLATE_TEST_CASE_SIG("id can be implicitly conversion-constructed from item", | |
q.submit([r, &result_buf](sycl::handler& cgh) { | ||
sycl::accessor result{result_buf, cgh, sycl::write_only}; | ||
cgh.parallel_for<kernel_id<D>>(r, [=](sycl::item<D> itm) { | ||
if (itm.get_id() == id<D>{r} - 1) { | ||
// `ul` suffix is necessary to resolve ambiguity for id<1> | ||
if (itm.get_id() == id<D>{r} - 1ul) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure, but |
||
// Use assignment operator to trigger implicit conversion | ||
result[0] = itm; | ||
} | ||
|
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.
Why this
extern
definition?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.
It's the base template that's being specialized below. For a variable template marking it extern allows me to omit the (invalid) definition and cause a compiler error when it's used in a constexpr context.
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.
Why not. :-)