Skip to content

[SYCL] Mark sycl::marray device copyable #4427

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
merged 3 commits into from
Sep 6, 2021

Conversation

vladimirlaz
Copy link
Contributor

@vladimirlaz vladimirlaz commented Aug 30, 2021

sycl::marray is device copyable if the element type is device copyable.
Also test was added to verify that the following types are device copyable:

  • sycl::marray when T is device copyable;
  • sycl::vec (all supported element types are device copyable);
  • sycl::id;
  • sycl::range.

sycl::marray is device copyable if element type is device copyable
@vladimirlaz vladimirlaz requested review from turinevgeny and a team as code owners August 30, 2021 13:17
@vladimirlaz
Copy link
Contributor Author

@intel/llvm-reviewers-runtime, could you please review the PR?

Copy link
Contributor

@alexbatashev alexbatashev left a comment

Choose a reason for hiding this comment

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

Overall LGTM, but I think we need a better test. On Windows the compiler can (possibly) produce types with different alignment on host and device. We either need a runtime test or a static test, that checks the alignment.

@vladimirlaz
Copy link
Contributor Author

we need a better test. On Windows the compiler can (possibly) produce types with
@alexbatashev, my expectation here is that if a type is device copyable it should have the same alignment on host and device. Otherwise scalar variable of element type will go into trouble as well.

@alexbatashev
Copy link
Contributor

@alexbatashev, my expectation here is that if a type is device copyable it should have the same alignment on host and device. Otherwise scalar variable of element type will go into trouble as well.

I share these expectations, I'm just not sure if compiler has the same point of view. Since device and host compilation are two separate processes, with two different ABIs. For SYCL-defined types we must ensure ABI is the same on host and device, at least we should update this test: https://github.com/intel/llvm/blob/sycl/sycl/test/abi/symbol_size_alignment.cpp

@vladimirlaz
Copy link
Contributor Author

@alexbatashev, my expectation here is that if a type is device copyable it should have the same alignment on host and device. Otherwise scalar variable of element type will go into trouble as well.

I share these expectations, I'm just not sure if compiler has the same point of view. Since device and host compilation are two separate processes, with two different ABIs. For SYCL-defined types we must ensure ABI is the same on host and device, at least we should update this test: https://github.com/intel/llvm/blob/sycl/sycl/test/abi/symbol_size_alignment.cpp

The requested test change does not look like connected to the PR. If there are gaps in testing it should be covered as separate issue/PR.

@bader bader merged commit 6e02880 into intel:sycl Sep 6, 2021
@vladimirlaz vladimirlaz deleted the marray_device_copyable branch October 8, 2021 06:19
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.

4 participants