logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

clGetDeviceIDsFromDX9MediaAdapterKHR - Query a media adapter for any associated OpenCL devices.

Authors

TheKhronosGroup

Description

       Queries a media adapter for any associated OpenCL devices. Adapters with associated OpenCL devices can
       enable media surface sharing between the two.

Errors

       Returns CL_SUCCESS if the function is executed successfully. Otherwise, it returns one of the following
       errors:

       •   CL_INVALID_PLATFORM if platform is not a valid platform.

       •   CL_INVALID_VALUE if num_media_adapters is zero or if media_adapters_type is NULL or if media_adapters
           is NULL.

       •   CL_INVALID_VALUE if any of the entries in media_adapters_type or media_adapters is not a valid value.

       •   CL_INVALID_VALUE if media_adapter_set is not a valid value.

       •   CL_INVALID_VALUE if num_entries is equal to zero and devices is not NULL or if both num_devices and
           devices are NULL.

       •   CL_DEVICE_NOT_FOUND if no OpenCL devices that correspond to adapters specified in media_adapters and
           media_adapters_type were found.

       •   CL_OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation
           on the device.

       •   CL_OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL
           implementation on the host.

Name

       clGetDeviceIDsFromDX9MediaAdapterKHR - Query a media adapter for any associated OpenCL devices.

       cl_intclGetDeviceIDsFromDX9MediaAdapterKHR(cl_platform_idplatform,cl_uintnum_media_adapters,cl_dx9_media_adapter_type_khr*media_adapters_type,void*media_adapters,cl_dx9_media_adapter_set_khrmedia_adapter_set,cl_uintnum_entries,cl_device_id*devices,cl_int*num_devices);

Notes

        1. OpenCL Specification
           page 88, section 9.10.7.1 - Querying OpenCL Devices corresponding....

The Khronos Group                                  11/18/2024                         CLGETDEVICEIDSFROMDX(3clc)

Parameters

platform
           Refers to the platform ID returned by clGetPlatformIDs(3clc).

       num_media_adapters
           The number of media adapters.

       media_adapters_type
           An array of num_media_adapters entries. Each entry specifies the type of media adapter and must be
           one of the values described in the table below.
           ┌───────────────────────────────┬────────────────────────┐
           │ cl_dx9_media_adapter_type_khrTypeofmediaadapters │
           ├───────────────────────────────┼────────────────────────┤
           │ CL_ADAPTER_D3D9_KHR           │ IDirect3DDevice9 *     │
           ├───────────────────────────────┼────────────────────────┤
           │ CL_ADAPTER_D3D9EX_KHR         │ IDirect3DDevice9Ex *   │
           ├───────────────────────────────┼────────────────────────┤
           │ CL_ADAPTER_DXVA_KHR           │ IDXVAHD_Device *       │
           └───────────────────────────────┴────────────────────────┘

       media_adapters
           An array of num_media_adapters entries. Each entry specifies the actual adapter whose type is
           specified by media_adapter_type. The media_adapters must be one of the types describes in the table
           above.

       media_adapter_set
           Specifies the set of adapters to return and must be one of the values described in the table below.
           ┌────────────────────────────────────────────┬──────────────────────────────────────┐
           │ cl_dx9_media_adapter_set_khrDescription                          │
           ├────────────────────────────────────────────┼──────────────────────────────────────┤
           │ CL_PREFERRED_DEVICES_FOR_MEDIA_ADAPTER_KHR │ The preferred OpenCL devices         │
           │                                            │ associated with the media adapter.   │
           ├────────────────────────────────────────────┼──────────────────────────────────────┤
           │ CL_ALL_DEVICES_FOR_MEDIA_ADAPTER_KHR       │ All OpenCL devices that may          │
           │                                            │ interoperate with the media adapter. │
           └────────────────────────────────────────────┴──────────────────────────────────────┘

       num_entries
           The number of cl_device_id entries that can be added to devices. If devices is not NULL, the
           num_entries must be greater than zero.

       devices
           Returns a list of OpenCL devices found that support the list of media adapters specified. The
           cl_device_id values returned in devices can be used to identify a specific OpenCL device. If devices
           argument is NULL, this argument is ignored. The number of OpenCL devices returned is the minimum of
           the value specified by num_entries or the number of OpenCL devices whose type matches device_type.

       num_devices
           Returns the number of OpenCL devices. If num_devices is NULL, this argument is ignored.

See Also

cl_khr_dx9_media_sharing(3clc), clGetDeviceIDsFromDX9MediaAdapterKHR(3clc),
       clCreateFromDX9MediaSurfaceKHR(3clc), clEnqueueAcquireDX9MediaSurfacesKHR(3clc),
       clEnqueueReleaseDX9MediaSurfacesKHR(3clc),

Specification

OpenCLSpecification[1]

See Also