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

[SYCL 2020][USM] Add USM queue shortcuts, memcpy, memset, fill, prefetch, mem_advise stub, test cases #323

Merged
merged 5 commits into from
Oct 2, 2020

Conversation

illuhad
Copy link
Collaborator

@illuhad illuhad commented Oct 1, 2020

  • Add USM queue shortcuts (e.g. queue::parallel_for)
  • Add handler::memcpy
  • Add handler::memset
  • Add USM handler::fill
  • Add handler::prefetch
  • Add test cases for all of the above
  • Add mem_advise (stub only, see caveats below)

Testing results:

  • CPU backend passes all tests
  • CUDA backend passes all tests
  • HIP backend passes all tests, except memset (see below)

Caveats:

  • All the plumbing for prefetch on HIP is there, but the actual call to hipMemPrefetchAsync() is commented out because this function does not yet exist in HIP - likely because HIP doesn't have proper unified memory, so prefetching doesn't make sense.
  • It seems hipMemsetAsync() does weird things causing the memset() tests to fail on HIP. This is probably a bug in HIP/ROCm. Since I'm using an older ROCm, it's possible that this is already fixed - needs more investigation.
  • mem_advise() is currently only implemented as a stub that throws an exception when actually used.
    • The reason this is a bit more complicated is because the CUDA model doesn't have an async variant for this. This means to get async mem_advise semantics in SYCL we need to launch a host task that then executes cudaMemAdvise(). For this we would first need to implement host tasks, which we don't have yet.
    • Additionally, HIP doesn't have a hipMemAdvise() at all - probably because of a similar reasoning as the missing hipMemPrefetchAsync()
    • On CPU it's not needed because shared allocations on the CPU backend are trivial.

@illuhad illuhad merged commit 2ebdc45 into develop Oct 2, 2020
@illuhad illuhad deleted the feature/sycl-2020/add-usm-handler-functions branch October 2, 2020 13:05
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

1 participant