Skip to content

Commit 6be4f45

Browse files
nikhiljnvkpet
andauthored
Clarify Acquire/Release behavior for external memory (KhronosGroup#1176)
* Clarify Acquire/Release behavior for external memory Clarify Acquire/Release behavior for external memory specs to call out the scope of operations as well as the behavior in case of multiple acquire/release calls. Fixes KhronosGroup#1078, KhronosGroup#1086 * Updates to Acquire/Release clarifications (KhronosGroup#1183) Address review comments on PR#1176 Fixes KhronosGroup#1078, KhronosGroup#1086 * Address left-over comments (KhronosGroup#1194) Address some of the comments that were left out in earlier update. * Fix the typo for "acquired" Fix the typo suggested by Kevin to replace aquired to acquired. Co-authored-by: Kévin Petit <kevin.petit@arm.com> --------- Co-authored-by: Kévin Petit <kevin.petit@arm.com>
1 parent c6cceb1 commit 6be4f45

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

api/opencl_runtime_layer.asciidoc

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5427,6 +5427,23 @@ handle is used by an OpenCL command queued to a command-queue without being
54275427
acquired.
54285428
This is to guarantee that the state of the memory objects is up-to-date and
54295429
they are accessible to OpenCL.
5430+
5431+
The following restrictions shall apply -
5432+
* Each memory object must be acquired only once. Acquiring a memory object
5433+
multiple times without releasing it results in implementation-defined
5434+
behavior.
5435+
* The acquire must be performed on a command-queue associated with a device
5436+
that was one of the devices specified via {CL_MEM_DEVICE_HANDLE_LIST_KHR}
5437+
when the memory object was imported using {clCreateBufferWithProperties} or
5438+
{clCreateImageWithProperties}. If {CL_MEM_DEVICE_HANDLE_LIST_KHR} was not
5439+
specified, the acquire can be performed on a command-queue associated with
5440+
any device in the context.
5441+
* The memory object will be acquired for all devices specified
5442+
via {CL_MEM_DEVICE_HANDLE_LIST_KHR} when the memory object was imported
5443+
using {clCreateBufferWithProperties} or {clCreateImageWithProperties}.
5444+
If {CL_MEM_DEVICE_HANDLE_LIST_KHR} was not specified, the memory object
5445+
will be acquired for all devices in the context.
5446+
54305447
See <<cl_khr_external_memory-Sample-Code, "`Example with Acquire /
54315448
Release`">> for more details on how to use this API.
54325449

@@ -5503,6 +5520,23 @@ Applications must release the memory objects that are acquired using
55035520
commands in the other API.
55045521
This is to guarantee that the state of memory objects is up-to-date and they
55055522
are accessible to the other API.
5523+
5524+
The following restrictions shall apply -
5525+
* Each memory object must be released only once. Releasing a memory object
5526+
multiple times without acquiring it results in implementation-defined
5527+
behavior.
5528+
* The release must be performed on a command-queue associated with a device
5529+
that was one of the devices specified via {CL_MEM_DEVICE_HANDLE_LIST_KHR}
5530+
when the memory object was imported using {clCreateBufferWithProperties} or
5531+
{clCreateImageWithProperties}. If {CL_MEM_DEVICE_HANDLE_LIST_KHR} was not
5532+
specified, the release can be performed on a command-queue associated with
5533+
any device in the context.
5534+
* The memory object will be released for all devices specified via
5535+
{CL_MEM_DEVICE_HANDLE_LIST_KHR} when the memory object was imported
5536+
using {clCreateBufferWithProperties} or {clCreateImageWithProperties}.
5537+
If {CL_MEM_DEVICE_HANDLE_LIST_KHR} was not specified, the memory object
5538+
will be released for all devices in the context.
5539+
55065540
See "`Example with Acquire / Release`" provided in
55075541
<<cl_khr_external_memory-Sample-Code>> for more details on how to use this
55085542
API.

0 commit comments

Comments
 (0)