KhronosGroup / OpenCL-Docs

OpenCL API, OpenCL C, Extensions, SPIR-V Environment Specs, Ref page, and C++ for OpenCL doc sources.
Other
359 stars 112 forks source link

Add buffer read/write commands to command-buffer extension #1281

Open EwanC opened 4 hours ago

EwanC commented 4 hours ago

The SYCL-Graph vendor extension in SYCL is layered on top of the cl_khr_command_buffer OpenCL extension. It currently cannot support the following graph nodes on OpenCL backends as there is no clCommandReadBuffer / clCommandWriteBuffer commands defined by cl_khr_command_buffer.

This is a feature request to add command append entry-points to cl_khr_command_buffer to support this, which could be optional to support if desired. PoCL vendor extension cl_pocl_command_buffer_host_buffer already exists to support this, so cc @pjaaskel

pjaaskel commented 4 hours ago

+1. Notifying @franz .

bashbaug commented 1 hour ago

Confirming: this feature would support reading into and writing from arbitrary host pointers, correct? The pointers would not need to be SVM or USM pointers?

I agree this is useful, but it also brings a surprising amount of complexity. For example, when is the host allowed to read from or write to the host pointers? When is the host allowed to free memory? Are there any requirements (e.g. alignment) for the host pointers?

If we relax this behavior then we should also consider relaxing the restriction on clCommandSVMMemcpyKHR (and clCommandSVMFillKHR?) to allow them to use arbitrary host pointers also.

One more question: Are these copy nodes required for SYCL-Graph? If so, this support would be required to support SYCL-Graph, even if it's optional in cl_khr_command_buffer, correct?