Skip to content

Commit ea99348

Browse files
committed
[SYCL][doc] Expand device_global related PI API
This commit changes the PI API introduced by the device_global design document, aligning it with the corresponding OpenCL API and the rest of PI API. Additionally, it changes the references to relevant CUDA API functions from referring to the CUDA runtime API to refer to the CUDA driver API, which is the API used by the CUDA backend. Signed-off-by: Steffen Larsen <[email protected]>
1 parent 769851c commit ea99348

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

sycl/doc/design/DeviceGlobal.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -563,11 +563,20 @@ instance of a device global variable in a `pi_program`. This functionality is
563563
exposed as two new PI interfaces:
564564

565565
```
566-
pi_result piextCopyToDeviceVariable(pi_device Device, pi_program Program,
567-
const char *name, const void *src, size_t count, size_t offset);
568-
569-
pi_result piextCopyFromDeviceVariable(pi_device Device, pi_program Program,
570-
const char *name, void *dst, size_t count, size_t offset);
566+
pi_result piextEnqueueDeviceVariableRead(pi_queue Queue, pi_program Program,
567+
const char *Name, pi_bool BlockingRead,
568+
size_t Count, size_t Offset, void *Dst,
569+
pi_uint32 NumEventsInWaitList,
570+
const pi_event *EventsWaitList,
571+
pi_event *Event);
572+
573+
pi_result piextEnqueueDeviceVariableWrite(pi_queue Queue, pi_program Program,
574+
const char *Name,
575+
pi_bool BlockingWrite, size_t Count,
576+
size_t Offset, const void *Src,
577+
pi_uint32 NumEventsInWaitList,
578+
const pi_event *EventsWaitList,
579+
pi_event *Event);
571580
```
572581

573582
In both cases the `name` parameter is the same as the `sycl-unique-id` string
@@ -616,8 +625,8 @@ depends upon implementation of that OpenCL extension.
616625

617626
[10]: <opencl-extensions/cl_intel_global_variable_access.asciidoc>
618627

619-
The CUDA backend has existing APIs `cudaMemcpyToSymbol()` and
620-
`cudaMemcpyFromSymbol()` which can be used to implement these PI interfaces.
628+
The CUDA backend has existing APIs `cuModuleGetGlobal()` and `cuMemcpyAsync()`
629+
which can be used to implement these PI interfaces.
621630

622631

623632
## Design choices

0 commit comments

Comments
 (0)