Skip to content

Commit 65fc388

Browse files
authored
strengthen requirements for CL_DEVICE_TYPE query (#1069)
* strengthen requirements for CL_DEVICE_TYPE query * require that an OpenCL device only reports a single device type * clarify device types that may be used with clCreateContextFromType
1 parent be1aa79 commit 65fc388

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

api/opencl_platform_layer.asciidoc

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -383,35 +383,32 @@ include::{generated}/api/version-notes/CL_DEVICE_TYPE_ACCELERATOR.asciidoc[]
383383

384384
include::{generated}/api/version-notes/CL_DEVICE_TYPE_CUSTOM.asciidoc[]
385385
| Specialized devices that implement some of the OpenCL runtime APIs but
386-
do not support all required OpenCL functionality.
386+
do not support all of the required OpenCL functionality.
387387

388388
| {CL_DEVICE_TYPE_DEFAULT_anchor}
389389

390390
include::{generated}/api/version-notes/CL_DEVICE_TYPE_DEFAULT.asciidoc[]
391391
| The default OpenCL device in the platform.
392+
One device in the platform must be returned as the {CL_DEVICE_TYPE_DEFAULT}
393+
device when passed as the _device_type_ to {clGetDeviceIDs}.
394+
{CL_DEVICE_TYPE_DEFAULT} is only used to query OpenCL devices using
395+
{clGetDeviceIDs} or to create OpenCL contexts using
396+
{clCreateContextFromType}, and will never be returned in {CL_DEVICE_TYPE}
397+
for any OpenCL device.
392398
The default OpenCL device must not be a {CL_DEVICE_TYPE_CUSTOM} device.
393399

394400
| {CL_DEVICE_TYPE_ALL_anchor}
395401

396402
include::{generated}/api/version-notes/CL_DEVICE_TYPE_ALL.asciidoc[]
397403
| All OpenCL devices available in the platform, except for
398404
{CL_DEVICE_TYPE_CUSTOM} devices.
405+
{CL_DEVICE_TYPE_ALL} is only used to query OpenCL devices using
406+
{clGetDeviceIDs} or to create OpenCL contexts using
407+
{clCreateContextFromType}, and will never be returned in {CL_DEVICE_TYPE}
408+
for any OpenCL device.
399409

400410
|====
401411

402-
The device type is purely informational and has no semantic meaning.
403-
404-
Some devices may be more than one type.
405-
For example, a {CL_DEVICE_TYPE_CPU} device may also be a
406-
{CL_DEVICE_TYPE_GPU} device, or a {CL_DEVICE_TYPE_ACCELERATOR} device
407-
may also be some other, more descriptive device type.
408-
{CL_DEVICE_TYPE_CUSTOM} devices must not be combined with any other
409-
device types.
410-
411-
One device in the platform should be a {CL_DEVICE_TYPE_DEFAULT} device.
412-
The default device should also be a more specific device type, such
413-
as {CL_DEVICE_TYPE_CPU} or {CL_DEVICE_TYPE_GPU}.
414-
415412
// refError
416413

417414
{clGetDeviceIDs} returns {CL_SUCCESS} if the function is executed
@@ -483,10 +480,13 @@ device except for the following queries:
483480

484481
include::{generated}/api/version-notes/CL_DEVICE_TYPE.asciidoc[]
485482
| {cl_device_type_TYPE}
486-
| The type or types of the OpenCL device.
483+
| The type of the OpenCL device.
484+
The device type is purely informational and has no semantic meaning.
485+
The device must report a single device type, which must not be
486+
{CL_DEVICE_TYPE_DEFAULT} or {CL_DEVICE_TYPE_ALL}.
487487

488488
Please see the <<device-types-table, Device Types>> table
489-
for supported device types and device type combinations.
489+
for supported device types and device type descriptions.
490490

491491
| {CL_DEVICE_VENDOR_ID_anchor} footnote:[{fn-vendor-id}]
492492

0 commit comments

Comments
 (0)