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

cl_khr_command_buffer access to read-only memory objects #1312

Open
joshqti opened this issue Feb 11, 2025 · 4 comments
Open

cl_khr_command_buffer access to read-only memory objects #1312

joshqti opened this issue Feb 11, 2025 · 4 comments
Labels
cl_khr_command_buffer Relating to the command-buffer family of extension

Comments

@joshqti
Copy link
Contributor

joshqti commented Feb 11, 2025

clCommandFillImageKHR and similar should restrict target images to be write or read-write. clEnqueueFillImage permits fills of read-only images, which may not be implemented in a performant way in the context of command buffers.

@lakshmih lakshmih added the cl_khr_command_buffer Relating to the command-buffer family of extension label Feb 11, 2025
@bashbaug bashbaug moved this from To do to Needs WG discussion in OpenCL specification maintenance Feb 11, 2025
@EwanC
Copy link
Contributor

EwanC commented Feb 11, 2025

I'd need to double check the exact mapping in of sycl::buffer objects to cl_mem creation flags in DPC++, but I think in SYCL-Graphs we could use buffers created with the read only flag in the OpenCL cl_khr_command_buffer backend.

@bashbaug
Copy link
Contributor

Even though the current behavior is non-intuitive, I think it would be more confusing if the command buffer behavior (clCommandFillImageKHR) deviated from the command queue behavior (clEnqueueFillImage).

Could we solve this via the immutable memory object extension, which would disallow updating the memory object through both paths? #1280

@bashbaug bashbaug changed the title cl_khr_command_buffers cl_khr_command_buffer access to read-only memory objects Feb 13, 2025
@bashbaug
Copy link
Contributor

Discussed in the February 11th teleconference, without a conclusion:

  • There is a potential issue for both read-only buffers and read-only images.
  • Note, there is also a request to provide even more host access via, see: Add buffer read/write commands to command-buffer extension #1281
  • Philosophically, do we want to disallow functionality like this that may be useful but may harm performance?
  • Additionally, do we want command buffer behavior to be consistent with command queue behavior, or are we comfortable if the command buffer behavior and the command queue behavior deviate?

@joshqti
Copy link
Contributor Author

joshqti commented Feb 25, 2025

Can we make writing with calls such as fill image or copy image, to read-only images optional, as determined by a device info query?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cl_khr_command_buffer Relating to the command-buffer family of extension
Projects
Status: Needs WG discussion
Development

No branches or pull requests

4 participants