Skip to content

Verify that CL_MEM_USE_HOST_PTR works for pointers to Java arrays #7

Open
@gpu

Description

@gpu

According to the OpenCL specification for the clEnqueueMapBuffer function:

If the buffer object is created with CL_MEM_USE_HOST_PTR set in mem_flags, the following will be true:

  • The host_ptr specified in clCreateBuffer is guaranteed to contain the latest bits in the region being mapped when the clEnqueueMapBuffer command has completed.
  • The pointer value returned by clEnqueueMapBuffer will be derived from the host_ptr specified when the buffer object is created.

Although JOCL supports pointers to Java arrays (as far as reasonably possible), it is not clear whether this particular application pattern works as expected.

The goal of this issue is to

  • Check whether it works
  • If it does not work, make it work
  • If it can not be made work, prevent it (e.g. by throwing an exception when CL_MEM_USE_HOST_PTR is used with a pointer to a Java array)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions