Name String cl_nv_d3d11_sharing Version Version 2, January 6, 2010 Number OpenCL Extension #4 Status Unknown Extension Type OpenCL platform extension Dependencies OpenCL 1.0 is required and a Direct3D 11 implementation supporting sharing of buffer and texture objects with OpenCL is required. Overview The goal of this extension is to provide interoperability between OpenCL and Direct3D 11. This is designed to function analogously to the OpenGL interoperability as defined in the OpenCL 1.0 specification and accompanying extensions. New Procedures and Functions cl_int clGetDeviceIDsFromD3D11NV( cl_platform_id platform, cl_d3d11_device_source_nv d3d_device_source, void *d3d_object, cl_d3d11_device_set_nv d3d_device_set, cl_uint num_entries, cl_device_id *devices, cl_uint *num_devices) cl_mem clCreateFromD3D11BufferNV( cl_context context, cl_mem_flags flags, ID3D11Buffer *resource, cl_int *errcode_ret) cl_mem clCreateFromD3D11Texture2DNV( cl_context context, cl_mem_flags flags, ID3D11Texture2D *resource, UINT subresource, cl_int *errcode_ret) cl_mem clCreateFromD3D11Texture3DNV( cl_context context, cl_mem_flags flags, ID3D11Texture3D *resource, UINT subresource, cl_int *errcode_ret) cl_int clEnqueueAcquireD3D11ObjectsNV( cl_command_queue command_queue, cl_uint num_objects, const cl_mem *mem_objects, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event) cl_int clEnqueueReleaseD3D11ObjectsNV( cl_command_queue command_queue, cl_uint num_objects, cl_mem *mem_objects, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event) New Tokens Accepted as a Direct3D 11 device source in the parameter of clGetDeviceIDsFromD3D11NV: CL_D3D11_DEVICE_NV 0x4019 CL_D3D11_DXGI_ADAPTER_NV 0x401A Accepted as a set of Direct3D 11 devices in the parameter of clGetDeviceIDsFromD3D11NV: CL_PREFERRED_DEVICES_FOR_D3D11_NV 0x401B CL_ALL_DEVICES_FOR_D3D11_NV 0x401C Accepted as a property name in the parameter of clCreateContext and clCreateContextFromType: CL_CONTEXT_D3D11_DEVICE_NV 0x401D Accepted as the property being queried in the parameter of clGetMemObjectInfo: CL_MEM_D3D11_RESOURCE_NV 0x401E Accepted as the property being queried in the parameter of clGetImageInfo: CL_IMAGE_D3D11_SUBRESOURCE_NV 0x401F Returned in the parameter of clGetEventInfo when is CL_EVENT_COMMAND_TYPE: CL_COMMAND_ACQUIRE_D3D11_OBJECTS_NV 0x4020 CL_COMMAND_RELEASE_D3D11_OBJECTS_NV 0x4021 Returned by clCreateContext and clCreateContextFromType if the Direct3D 11 device specified for interoperability is not compatible with the devices against which the context is to be created: CL_INVALID_D3D11_DEVICE_NV -1006 Returned by clCreateFromD3D11BufferNV when is not a Direct3D 11 buffer object, and by clCreateFromD3D11Texture2DNV and clCreateFromD3D11Texture3DNV when is not a Direct3D 11 texture object. CL_INVALID_D3D11_RESOURCE_NV -1007 Returned by clEnqueueAcquireD3D11ObjectsNV when any of are currently acquired by OpenCL CL_D3D11_RESOURCE_ALREADY_ACQUIRED_NV -1008 Returned by clEnqueueReleaseD3D11ObjectsNV when any of are not currently acquired by OpenCL CL_D3D11_RESOURCE_NOT_ACQUIRED_NV -1009 Additions to Chapter 4 of the OpenCL 1.0 Specification In section 4.3, replace the description of under clCreateContext with: " specifies a list of context property names and their corresponding values. Each property is followed immediately by the corresponding desired value. The list is terminated with zero. If a property is not specified in , then its default value (listed in table 4.4) is used (it is said to be specified implicitly). If is NULL or empty (points to a list whose first value is zero), all attributes take on their default values." Replace existing table 4.4 with: "-------------------------------------------------------------------------------------- cl_context_properties Value type Default value Description --------------------- ---------- ------------- ----------- CL_CONTEXT_PLATFORM cl_platform_id NULL Specifies the cl_platform_id on whic to create the OpenCL context. CL_CONTEXT_D3D11_DEVICE_NV ID3D11Device* NULL Specifies the ID3D11Device* to use for Direct3D 11 interoperabilty." --------------------------------------------------------------------------------------" Add to the list of errors for clCreateContext: "* CL_INVALID_D3D11_DEVICE_NV if the value of the property CL_CONTEXT_D3D11_DEVICE_NV is non-NULL and does not specify a valid Direct3D 11 device with which the cl_device_ids against which this context is to be created may interoperate. * CL_INVALID_OPERATION if Direct3D 11 interoperability is specified by setting CL_INVALID_D3D11_DEVICE_NV to a non-NULL value, and interoperability with another graphics API is also specified." Add to the list of errors for clCreateContextFromType the same new errors described above for clCreateContext. Additions to Chapter 5 of the OpenCL 1.0 Specification 5.2.9 Memory Object Queries Change the last paragraph before table 5.8 to read "clGetMemObjectInfo returns CL_SUCCESS if the function is executed successfully. Otherwise it returns one of the following errors: * CL_INVALID_VALUE if is not valid, or if the size in bytes specified by is less than the size of the return type as described in table 5.8 and is not NULL. * CL_INVALID_MEM_OBJECT if is a not a valid memory object. * CL_INVALID_D3D11_RESOURCE_NV if is CL_MEM_D3D11_RESOURCE_NV and was not created by the function clCreateFromD3D11BufferNV, clCreateFromD3D11Texture2DNV, or clCreateFromD3D11Texture3DNV." Extend table 5.8 to include the following entry. cl_mem_info Return type Info. returned in param_value ----------- --------------- ----------------------------- CL_MEM_D3D11_RESOURCE_NV ID3D11Resource* If was created using clCreateFromD3D11BufferNV, clCreateFromD3D11Texture2DNV, or clCreateFromD3D11Texture3DNV, returns the argument specified when was created. Change the last paragraph before table 5.9 to read "clGetImageInfo returns CL_SUCCESS if the function is executed successfully. Otherwise it returns one of the following errors: * CL_INVALID_VALUE if is not valid, or if the size in bytes specified by is less than the size of the return type as described in table 5.9 and is not NULL. * CL_INVALID_MEM_OBJECT if is a not a valid image object. * CL_INVALID_D3D11_RESOURCE_NV if is CL_MEM_D3D11_SUBRESOURCE_NV and was not created by the function clCreateFromD3D11Texture2DNV or clCreateFromD3D11Texture3DNV." Extend table 5.9 to include the following entry. cl_image_info Return type Info. returned in param_value ------------- --------------- ----------------------------- CL_IMAGE_D3D11_SUBRESOURCE_NV ID3D11Resource* If was created using clCreateFromD3D11Texture2DNV, or clCreateFromD3D11Texture3DNV, returns the argument specified when was created. 5.7 Event Objects Add to Table 5.15 in the "Info returned in " column for cl_event_info CL_EVENT_COMMAND_TYPE: CL_COMMAND_ACQUIRE_D3D11_OBJECTS_NV CL_COMMAND_RELEASE_D3D11_OBJECTS_NV Add new section 9.13 9.13 Sharing Memory Objects with Direct3D 11 Resources This section discusses OpenCL functions that allow applications to use Direct3D 11 resources as OpenCL memory objects. This allows efficient sharing of data between OpenCL and Direct3D 11. The OpenCL API may be used to execute kernels that read and/or write memory objects that are also Direct3D 11 resources. An OpenCL image object may be created from a Direct3D 11 texture or surface resource. An OpenCL buffer object may be created from a Direct3D 11 buffer resource. OpenCL memory objects may be created from Direct3D 11 objects if and only if the OpenCL context has been created from a Direct3D 11 device. 9.13.1 Querying OpenCL Devices Corresponding to Direct3D 11 Devices The OpenCL devices corresponding to a Direct3D 11 device may be queried. The OpenCL devices corresponding to a DXGI adapter may also be queried. The OpenCL devices corresponding to a Direct3D 11 device will be a subset of the OpenCL devices corresponding to the DXGI adapter against which the Direct3D 11 device was created. The OpenCL devices corresponding to a Direct3D 11 device or a DXGI device may be queried using the function cl_int clGetDeviceIDsFromD3D11NV( cl_platform_id platform, cl_d3d11_device_source_nv d3d_device_source, void *d3d_object, cl_d3d11_device_set_nv d3d_device_set, cl_uint num_entries, cl_device_id *devices, cl_uint *num_devices) refers to the platform ID returned by clGetPlatformIDs. specifies the type of , and must be one of the values shown in table 9.13.1.1. specifies the object whose corresponding OpenCL devices are being queried. The type of must be as specified in table 9.13.1.1. specifies the set of devices to return, and must be one of the values shown in table 9.13.1.2. is the number of cl_device_id entries that can be added to . If is not NULL then must be greater than zero. returns a list of OpenCL devices found. The cl_device_id values returned in can be used to identify a specific OpenCL device. If is NULL, this argument is ignored. The number of OpenCL devices returned is the mininum of the value specified by and the number of OpenCL devices corresponding to . returns the number of OpenCL devices available that correspond to . If is NULL, this argument is ignored. clGetDeviceIDsFromD3D11NV returns CL_SUCCESS if the function is executed successfully. Otherwise it may return * CL_INVALID_PLATFORM if is not a valid platform, * CL_INVALID_VALUE if is not a valid value, is not a valid value, is equal to zero and is not NULL, or if both and are NULL. * CL_DEVICE_NOT_FOUND if no OpenCL devices that correspond to were found. -------------------------------------------------------------------- cl_d3d_device_source_nv Type of ------------------------ -------------------- CL_D3D11_DEVICE_NV ID3D11Device * CL_D3D11_DXGI_ADAPTER_NV IDXGIAdapter * -------------------------------------------------------------------- Table 9.13.1.1: Types used to specify the object whose corresponding OpenCL devices are being queried by clGetDeviceIDsFromD3D11NV. -------------------------------------------------------------------- cl_d3d_device_set_nv Devices returned in ------------------------ ----------------------------- CL_PREFERRED_DEVICES_FOR_D3D11_NV The OpenCL devices associated with the specified Direct3D object. CL_ALL_DEVICES_FOR_D3D11_NV All OpenCL devices which may interoperate with the specified Direct3D object. Performance of sharing data on these devices may be considerably less than on the preferred devices. -------------------------------------------------------------------- Table 9.13.1.2: Sets of devices queriable using clGetDeviceIDsFromD3D11NV. 9.13.2 Lifetime of Shared Objects An OpenCL memory object created from a Direct3D 11 resource remains valid as long as the corresponding Direct3D 11 resource has not been deleted. If the Direct3D 11 resource is deleted through the Direct3D 11 API, subsequent use of the OpenCL memory object will result in undefined behavior, including but not limited to possible OpenCL errors, data corruption, and program termination. The successful creation of a cl_context against a Direct3D 11 device specified via the context create parameter CL_CONTEXT_D3D11_DEVICE_NV will increment the internal Direct3D reference count on the specified Direct3D 11 device. The internal Direct3D reference count on that Direct3D 11 device will be decremented when the OpenCL reference count on the returned OpenCL context drops to zero. The OpenCL context and corresponding command-queues are dependent on the existence of the Direct3D 11 device from which the OpenCL context was created. If the Direct3D 11 device is deleted through the Direct3D 11 API, subsequent use of the OpenCL context will result in undefined behavior, including but not limited to possible OpenCL errors, data corruption, and program termination. 9.13.3 Sharing Direct3D 11 Buffer Resources as OpenCL Buffer Objects The function cl_mem clCreateFromD3D11BufferNV( cl_context context, cl_mem_flags flags, ID3D11Buffer *resource, int *errcode_ret) creates an OpenCL buffer object from a Direct3D 11 buffer. is a valid OpenCL context created from a Direct3D 11 device. is a bit-field that is used to specify usage information. Refer to table 5.3 for a description of . Only CL_MEM_READ_ONLY, CL_MEM_WRITE_ONLY and CL_MEM_READ_WRITE values specified in table 5.3 can be used. is a pointer to the Direct3D 11 buffer to share. will return an appropriate error code. If is NULL, no error code is returned. clCreateFromD3D11BufferNV returns a valid non-zero OpenCL buffer object and is set to CL_SUCCESS if the buffer object is created successfully. Otherwise, it returns a NULL value with one of the following error values returned in : * CL_INVALID_CONTEXT if is not a valid context. * CL_INVALID_VALUE if values specified in are not valid. * CL_INVALID_D3D11_RESOURCE_NV if is not a Direct3D 11 buffer resource, if was created with the D3D11_USAGE flag D3D11_USAGE_IMMUTABLE, if a cl_mem from has already been created using clCreateFromD3D11BufferNV, or if was not created against the same Direct3D 11 device from which was created. * CL_OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host. The size of the returned OpenCL buffer object is the same as the size of . This call will increment the internal Direct3D reference count on . The internal Direct3D reference count on will be decremented when the OpenCL reference count on the returned OpenCL memory object drops to zero. 9.13.4 Sharing Direct3D 11 Texture and Resources as OpenCL Image Objects The function cl_mem clCreateFromD3D11Texture2DNV( cl_context context, cl_mem_flags flags, ID3D11Texture2D *resource, UINT subresource, int *errcode_ret) creates an OpenCL 2D image object from a subresource of a Direct3D 11 2D texture. is a valid OpenCL context created from a Direct3D 11 device. is a bit-field that is used to specify usage information. Refer to table 5.3 for a description of . Only CL_MEM_READ_ONLY, CL_MEM_WRITE_ONLY and CL_MEM_READ_WRITE values specified in table 5.3 can be used. is a pointer to the Direct3D 11 2D texture to share. is the subresource of to share. will return an appropriate error code. If is NULL, no error code is returned. clCreateFromD3D11Texture2DNV returns a valid non-zero OpenCL image object and is set to CL_SUCCESS if the image object is created successfully. Otherwise, it returns a NULL value with one of the following error values returned in : * CL_INVALID_CONTEXT if is not a valid context. * CL_INVALID_VALUE if values specified in are not valid or if is not a valid subresource index for . * CL_INVALID_D3D11_RESOURCE_NV if is not a Direct3D 11 texture resource, if was created with the D3D11_USAGE flag D3D11_USAGE_IMMUTABLE, if is a multisampled texture, if a cl_mem from subresource of has already been created using clCreateFromD3D11Texture2DNV, or if was not created against the same Direct3D 11 device from which was created. * CL_INVALID_IMAGE_FORMAT_DESCRIPTOR if the Direct3D 11 texture format of is not listed in table 9.13.4.1. * CL_OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host. The width and height of the returned OpenCL 2D image object are determined by the width and height of subresource of . The channel type and order of the returned OpenCL 2D image object is determined by the format of by table 9.13.4.1. This call will increment the internal Direct3D reference count on . The internal Direct3D reference count on will be decremented when the OpenCL reference count on the returned OpenCL memory object drops to zero. The function cl_mem clCreateFromD3D11Texture3DNV( cl_context context, cl_mem_flags flags, ID3D11Texture3D *resource, UINT subresource, int *errcode_ret) creates an OpenCL 3D image object from a subresource of a Direct3D 11 3D texture. is a valid OpenCL context created from a Direct3D 11 device. is a bit-field that is used to specify usage information. Refer to table 5.3 for a description of . Only CL_MEM_READ_ONLY, CL_MEM_WRITE_ONLY and CL_MEM_READ_WRITE values specified in table 5.3 can be used. is a pointer to the Direct3D 11 3D texture to share. is the subresource of to share. will return an appropriate error code. If is NULL, no error code is returned. clCreateFromD3D11Texture3DNV returns a valid non-zero OpenCL image object and is set to CL_SUCCESS if the image object is created successfully. Otherwise, it returns a NULL value with one of the following error values returned in : * CL_INVALID_CONTEXT if is not a valid context. * CL_INVALID_VALUE if values specified in are not valid or if is not a valid subresource index for . * CL_INVALID_D3D11_RESOURCE_NV if is not a Direct3D 11 texture resource, if was created with the D3D11_USAGE flag D3D11_USAGE_IMMUTABLE, if a cl_mem from subresource of has already been created using clCreateFromD3D11Texture3DNV, or if was not created against the same Direct3D 11 device from which was created. * CL_INVALID_IMAGE_FORMAT_DESCRIPTOR if the Direct3D 11 texture format of is not listed in table 9.13.4.1. * CL_OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host. The width, height, and depth of the return OpenCL 3D image object are determined by the width, height, and depth of subresource of . The channel type and order of the returned OpenCL 3D image object is determined by the format of by table 9.13.4.1. This call will increment the internal Direct3D reference count on . The internal Direct3D reference count on will be decremented when the OpenCL reference count on the returned OpenCL memory object drops to zero. ------------------------------------------------------------------ DXGI Format cl_channel_order cl_channel_type ------------------------------ ---------------- --------------- DXGI_FORMAT_R32G32B32A32_FLOAT CL_RGBA CL_FLOAT DXGI_FORMAT_R32G32B32A32_UINT CL_RGBA CL_UNSIGNED_INT32 DXGI_FORMAT_R32G32B32A32_SINT CL_RGBA CL_SIGNED_INT32 DXGI_FORMAT_R16G16B16A16_FLOAT CL_RGBA CL_HALF_FLOAT DXGI_FORMAT_R16G16B16A16_UNORM CL_RGBA CL_UNORM_INT16 DXGI_FORMAT_R16G16B16A16_UINT CL_RGBA CL_UNSIGNED_INT16 DXGI_FORMAT_R16G16B16A16_SNORM CL_RGBA CL_SNORM_INT16 DXGI_FORMAT_R16G16B16A16_SINT CL_RGBA CL_SIGNED_INT16 DXGI_FORMAT_R8G8B8A8_UNORM CL_RGBA CL_UNORM_INT8 DXGI_FORMAT_R8G8B8A8_UINT CL_RGBA CL_UNSIGNED_INT8 DXGI_FORMAT_R8G8B8A8_SNORM CL_RGBA CL_SNORM_INT8 DXGI_FORMAT_R8G8B8A8_SINT CL_RGBA CL_SIGNED_INT8 DXGI_FORMAT_R32G32_FLOAT CL_RG CL_FLOAT DXGI_FORMAT_R32G32_UINT CL_RG CL_UNSIGNED_INT32 DXGI_FORMAT_R32G32_SINT CL_RG CL_SIGNED_INT32 DXGI_FORMAT_R16G16_FLOAT CL_RG CL_HALF_FLOAT DXGI_FORMAT_R16G16_UNORM CL_RG CL_UNORM_INT16 DXGI_FORMAT_R16G16_UINT CL_RG CL_UNSIGNED_INT16 DXGI_FORMAT_R16G16_SNORM CL_RG CL_SNORM_INT16 DXGI_FORMAT_R16G16_SINT CL_RG CL_SIGNED_INT16 DXGI_FORMAT_R8G8_UNORM CL_RG CL_UNORM_INT8 DXGI_FORMAT_R8G8_UINT CL_RG CL_UNSIGNED_INT8 DXGI_FORMAT_R8G8_SNORM CL_RG CL_SNORM_INT8 DXGI_FORMAT_R8G8_SINT CL_RG CL_SIGNED_INT8 DXGI_FORMAT_R32_FLOAT CL_R CL_FLOAT DXGI_FORMAT_R32_UINT CL_R CL_UNSIGNED_INT32 DXGI_FORMAT_R32_SINT CL_R CL_SIGNED_INT32 DXGI_FORMAT_R16_FLOAT CL_R CL_HALF_FLOAT DXGI_FORMAT_R16_UNORM CL_R CL_UNORM_INT16 DXGI_FORMAT_R16_UINT CL_R CL_UNSIGNED_INT16 DXGI_FORMAT_R16_SNORM CL_R CL_SNORM_INT16 DXGI_FORMAT_R16_SINT CL_R CL_SIGNED_INT16 DXGI_FORMAT_R8_UNORM CL_R CL_UNORM_INT8 DXGI_FORMAT_R8_UINT CL_R CL_UNSIGNED_INT8 DXGI_FORMAT_R8_SNORM CL_R CL_SNORM_INT8 DXGI_FORMAT_R8_SINT CL_R CL_SIGNED_INT8 ------------------------------------------------------------------ Table 9.13.4.1: List of Direct3D 11 and corresponding OpenCL Image Formats. 9.13.5 Querying Direct3D properties of memory objects created from Direct3D 11 resources. Properties of Direct3D 11 objects may be queried using clGetMemObjectInfo and clGetImageInfo with CL_MEM_D3D11_RESOURCE_NV and CL_IMAGE_D3D11_SUBRESOURCE_NV as described in section 5.2.9. 9.13.6 Sharing memory objects created from Direct3D 11 resources between Direct3D 11 and OpenCL contexts The function cl_int clEnqueueAcquireD3D11ObjectsNV( cl_command_queue command_queue, cl_uint num_objects, const cl_mem *mem_objects, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event) is used to acquire OpenCL memory objects that have been created from Direct3D 11 resources. The Direct3D 11 objects are acquired by the OpenCL context associated with and can therefore be used by all command-queues associated with the OpenCL context. OpenCL memory objects created from Direct3D 11 resources must be acquired before they can be used by any OpenCL commands queued to a command-queue. If an OpenCL memory object created from a Direct3D 11 resource is used while it is not currently acquired by OpenCL, the call attempting to use that OpenCL memory object will return CL_D3D11_RESOURCE_NOT_ACQUIRED_NV. clEnqueueAcquireD3D11ObjectsNV provides the synchronization guarantee that any Direct3D 11 calls made before clEnqueueAcquireD3D11ObjectsNV is called will complete executing before reports completion and before the execution of any subsequent OpenCL work issued in begins. is a valid command-queue. is the number of memory objects to be acquired in . is a pointer to a list of OpenCL memory objects that were created from Direct3D 11 resources. and specify events that need to complete before this particular command can be executed. If is NULL, then this particular command does not wait on any event to complete. If is NULL, must be 0. If is not NULL, the list of events pointed to by must be valid and must be greater than 0. The events specified in act as synchronization points. returns an event object that identifies this particular command and can be used to query or queue a wait for this particular command to complete. can be NULL in which case it will not be possible for the application to query the status of this command or queue a wait for this command to complete. clEnqueueAcquireD3D11ObjectsNV returns CL_SUCCESS if the function is executed successfully. If is 0 and is NULL then the function does nothing and returns CL_SUCCESS. Otherwise it returns one of the following errors: * CL_INVALID_VALUE if is zero and is not a NULL value or if > 0 and is NULL. * CL_INVALID_MEM_OBJECT if memory objects in are not valid OpenCL memory objects or if memory objects in have not been created from Direct3D 11 resources. * CL_INVALID_COMMAND_QUEUE if is not a valid command-queue. * CL_INVALID_CONTEXT if context associated with was not created from an Direct3D 11 context. * CL_D3D11_RESOURCE_ALREADY_ACQUIRED_NV if memory objects in have previously been acquired using clEnqueueAcquireD3D11ObjectsNV but have not been released using clEnqueueReleaseD3D11ObjectsNV. * CL_INVALID_EVENT_WAIT_LIST if is NULL and > 0, or is not NULL and is 0, or if event objects in are not valid events. * CL_OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host. The function cl_int clEnqueueReleaseD3D11ObjectsNV( cl_command_queue command_queue, cl_uint num_objects, const cl_mem *mem_objects, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event) is used to release OpenCL memory objects that have been created from Direct3D 11 resources. The Direct3D 11 objects are released by the OpenCL context associated with . OpenCL memory objects created from Direct3D 11 resources which have been acquired by OpenCL must be released by OpenCL before they may be accessed by Direct3D 11. Accessing a Direct3D 11 resource while its corresponding OpenCL memory object is acquired is in error and will result in undefined behavior, including but not limited to possible OpenCL errors, data corruption, and program termination. clEnqueueReleaseD3D11ObjectsNV provides the synchronization guarantee that any calls to Direct3D 11 made after the call to clEnqueueReleaseD3D11ObjectsNV will not start executing until after all events in are complete and all work already submitted to completes execution. is the number of memory objects to be released in . is a pointer to a list of OpenCL memory objects that were created from Direct3D 11 resources. and specify events that need to complete before this particular command can be executed. If is NULL, then this particular command does not wait on any event to complete. If is NULL, must be 0. If is not NULL, the list of events pointed to by must be valid and must be greater than 0. The events specified in returns an event object that identifies this particular command and can be used to query or queue a wait for this particular command to complete. can be NULL in which case it will not be possible for the application to query the status of this command or queue a wait for this command to complete. clEnqueueReleaseExternalObjectsNV returns CL_SUCCESS if the function is executed successfully. If is 0 and is NULL the function does nothing and returns CL_SUCCESS. Otherwise it returns one of the following errors: * CL_INVALID_VALUE if is zero and is not a NULL value or if > 0 and is NULL. * CL_INVALID_MEM_OBJECT if memory objects in are not valid OpenCL memory objects or if memory objects in have not been created from Direct3D 11 resources. * CL_INVALID_COMMAND_QUEUE if is not a valid command-queue. * CL_INVALID_CONTEXT if context associated with was not created from a Direct3D 11 device. * CL_D3D11_RESOURCE_NOT_ACQUIRED_NV if memory objects in have not previously clEnqueueAcquireD3D11ObjectsNV, or have been released using clEnqueueReleaseD3D11ObjectsNV since the last time that they were acquired. * CL_INVALID_EVENT_WAIT_LIST if is NULL and > 0, or is not NULL and is 0, or if event objects in are not valid events. * CL_OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host. Revision History Version 2, 2010/01/06 (Jon Leech) - add missing extension template fields and publish in the Khronos Registry. Version 1, 2009/12/07 - branched from draft of cl_nv_d3d10_sharing.