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

creating an image from a buffer and a non-NULL host_ptr #789

Open
bashbaug opened this issue May 3, 2022 · 0 comments
Open

creating an image from a buffer and a non-NULL host_ptr #789

bashbaug opened this issue May 3, 2022 · 0 comments

Comments

@bashbaug
Copy link
Contributor

bashbaug commented May 3, 2022

In the OpenCL teleconference on May 3rd we were discussing whether it is possible to create an image from a buffer and to pass a non-NULL host_ptr while creating the image - see related comment here: #777 (comment)

I believe this case is disallowed by the current spec (v3.0.10) although it is not directly disallowed. Specifically, for clCreateImage we have the following error conditions:

CL_INVALID_HOST_PTR if [...] host_ptr is not NULL but CL_MEM_COPY_HOST_PTR or CL_MEM_USE_HOST_PTR are not set in flags.

CL_INVALID_VALUE if an image is being created from another memory object (buffer or image) under one of the following circumstances: [...] 3) flags specifies CL_MEM_USE_HOST_PTR or CL_MEM_ALLOC_HOST_PTR or CL_MEM_COPY_HOST_PTR.

Because a non-NULL host_ptr requires either CL_MEM_COPY_HOST_PTR or CL_MEM_USE_HOST_PTR, and because creating an image from another memory object specifically disallows CL_MEM_USE_HOST_PTR and CL_MEM_COPY_HOST_PTR, it is impossible to create an image from a buffer and have a non-NULL host_ptr.

Should we find a way to document this more clearly?

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

No branches or pull requests

1 participant