KhronosGroup / KhronosGroup/OpenCL-Docs

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

Open
#789 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
421
Forks
132
Avg merge
5d 13h
Merged PRs (30d)
11

Description

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: https://github.com/KhronosGroup/OpenCL-Docs/pull/777#issuecomment-1116293667

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?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the clCreateImage section of the OpenCL 3.0.10 specification and compare the documented CL_INVALID_HOST_PTR and CL_INVALID_VALUE conditions quoted in the issue. Identify the source file containing that reference text, then make the restriction on a non-NULL host_ptr when creating an image from another memory object explicit and verify the generated specification wording.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.