KhronosGroup / KhronosGroup/SYCL-Docs

Can queue::memcpy() be invoked with two host pointers for a GPU queue?

Open
#475 7 comments 1 reaction 0 assignees View on GitHub
clarification
Dominant language
JavaScript
Stars
158
Forks
80
Avg merge
7d 6h
Merged PRs (30d)
5

Description

Let us assume a queue `q` that is running on a GPU (or any other device that is not a CPU).
Our description for `memcpy()` says:

> Copies numBytes of data from the pointer src to the pointer dest. The dest and src parameters must each either be a host pointer or a pointer within a USM allocation that is accessible on the handler’s device. If a pointer is to a USM allocation, that allocation must have been created from the same context as the handler’s queue. For more detail on USM, please see [Section 4.8](https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html#sec:usm).

This does not make it clear to me whether `q.memcpy(host_ptr1, host_ptr2, size)` is allowed for two host pointers `host_ptr1` and `host_ptr2`. If the `queue` is a CPU queue, that should naturally work because then everything is likely a USM system allocation, but for any other case it does not seem logical to me to allow it: After all, a GPU to which `q` is bound and where the memcpy is supposed to be executed might not even be able to access the two host pointers.

This is different from the case where one is a host pointer and the other a device pointer, since then the operation expresses a host->device or device->host copy which backends generally support.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the memcpy() description quoted in this issue and compare it with the referenced SYCL 2020 Section 4.8 on USM. Determine whether two host pointers are permitted for a non-CPU queue, then update the specification wording so the allowed behavior is unambiguous.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.