Skip to content

Commit

Permalink
Add command-buffer context query
Browse files Browse the repository at this point in the history
Introduce query `CL_COMMAND_BUFFER_CONTEXT_KHR` for the
`cl_context` associated with a command-buffer.

This PR uses enum value `0x1299` which is also attempting
be used by another command-buffer PR
KhronosGroup#850
However, that PR still needs review so would prefer
to use that enum here as `0x1299` is contiguous with
the other command-buffer query enums, and I can find a new
value for PR KhronosGroup#850

Closes KhronosGroup#898
  • Loading branch information
EwanC committed Mar 31, 2023
1 parent 585786a commit 6138061
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions ext/cl_khr_command_buffer.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ This extension adds the ability to record and replay buffers of OpenCL commands.
| *Date* | *Version* | *Description*
| 2021-11-10 | 0.9.0 | First assigned version (provisional).
| 2022-08-24 | 0.9.1 | Specify an error if a command-buffer is finalized multiple times (provisional).
| 2023-03-31 | 0.9.2 | Introduce context query {CL_COMMAND_BUFFER_CONTEXT_KHR} (provisional).
|====

==== Dependencies
Expand Down Expand Up @@ -422,6 +423,7 @@ CL_COMMAND_BUFFER_NUM_QUEUES_KHR 0x1295
CL_COMMAND_BUFFER_REFERENCE_COUNT_KHR 0x1296
CL_COMMAND_BUFFER_STATE_KHR 0x1297
CL_COMMAND_BUFFER_PROPERTIES_ARRAY_KHR 0x1298
CL_COMMAND_BUFFER_CONTEXT_KHR 0x1299
// cl_event command-buffer enqueue command type
CL_COMMAND_COMMAND_BUFFER_KHR 0x12A8
Expand Down Expand Up @@ -1590,6 +1592,10 @@ _param_value_ by {clGetCommandBufferInfoKHR} is described in the table below.
or the implementation may return a property value of 0 (where 0 is used to
terminate the properties list).

| {CL_COMMAND_BUFFER_CONTEXT_KHR}
| {cl_context_TYPE}
| Return the context associated with _command_buffer_.

|====

{clGetCommandBufferInfoKHR} returns {CL_SUCCESS} if the function is executed
Expand Down
2 changes: 1 addition & 1 deletion xml/cl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1728,7 +1728,7 @@ server's OpenCL/api-docs repository.
<enum value="0x1296" name="CL_COMMAND_BUFFER_REFERENCE_COUNT_KHR"/>
<enum value="0x1297" name="CL_COMMAND_BUFFER_STATE_KHR"/>
<enum value="0x1298" name="CL_COMMAND_BUFFER_PROPERTIES_ARRAY_KHR"/>
<unused start="0x1299" comment="Reserved for MR199"/>
<enum value="0x1299" name="CL_COMMAND_BUFFER_CONTEXT_KHR"/>
<unused start="0x129A" end="0x129F" comment="Available to use"/>
<enum value="0x12A0" name="CL_MUTABLE_COMMAND_COMMAND_QUEUE_KHR"/>
<enum value="0x12A1" name="CL_MUTABLE_COMMAND_COMMAND_BUFFER_KHR"/>
Expand Down

0 comments on commit 6138061

Please sign in to comment.