Skip to content
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

Add new test for get_pointer_type and get_pointer_device USM API #131

Merged
merged 6 commits into from Jul 22, 2021

Conversation

vasilytric
Copy link
Contributor

Provide verification to cooperation USM functions get_pointer_type
and get_pointer_device with four memory allocation types:
host, device, shared and non USM allocation.

Provide verification to cooperation USM functions get_pointer_type
and get_pointer_device with four memory allocation types:
host, device, shared and non USM allocation.
@bader bader requested review from illuhad and keryell June 27, 2021 19:47
tests/usm/usm.h Outdated Show resolved Hide resolved
Co-authored-by: Peter Žužek <peterzuzek@gmail.com>
sycl::malloc_host<elems_typeT>(num_elements, context), deleter);
return usm_memory;
} else {
static_assert(alloc != alloc, "Unknown USM allocation type");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this to have a dependent static_assert to avoid triggering with false independently from the if constexpr?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If i correctly understood you.
We using static_assert here to interrupt compilation if test developer try to allocate memory from non USM allocation type (here we using all available allocation types from SYCL2020 spec section #4.8.2. "Kinds of unified shared memory")

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My question was about

static_assert(false, "Unknown USM allocation type");

that you cannot probably use?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that good decision, thanks for your advice
This change was made in: 684a2ec

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@keryell @vasilytric I assume 684a2ec will break compilation due non-conditional static_assert. See SO thread for details

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@keryell Yes, static_assert(false, "Unknown USM allocation type"); cannot be used

tests/usm/usm.h Outdated Show resolved Hide resolved
@vasilytric vasilytric requested a review from bader as a code owner July 9, 2021 09:05
@bader bader requested a review from keryell July 9, 2021 09:08
This reverts commit 684a2ec.
This commit added compilation brake changes.
@bader bader merged commit 3f2dc5e into KhronosGroup:SYCL-2020 Jul 22, 2021
jiezzhang added a commit to jiezzhang/SYCL-CTS that referenced this pull request Dec 1, 2021
…0920

Auto pulldown for intel/SYCL-2020 branch on 20210920
JIRA: CMPLRLLVM-31299
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants