Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cl_khr_command_buffer_multi_device Test Plan #1703

Open
9 tasks
EwanC opened this issue Apr 17, 2023 · 1 comment
Open
9 tasks

cl_khr_command_buffer_multi_device Test Plan #1703

EwanC opened this issue Apr 17, 2023 · 1 comment

Comments

@EwanC
Copy link
Contributor

EwanC commented Apr 17, 2023

CTS test plan for cl_khr_command_buffer_multi_device

1 Platform Info Query

  • Test platform can be queried for CL_PLATFORM_COMMAND_BUFFER_CAPABILITIES_KHR

2 Device Info Query

  • Test device can be queried for CL_DEVICE_COMMAND_BUFFER_NUM_SYNC_DEVICES_KHR &
    CL_DEVICE_COMMAND_BUFFER_SYNC_DEVICES_KHR

3 Multiple command-queues, same device

  • Test case for command-buffer recording commands to multiple queues
    targeting the same device:
  • Query if a device supports recording a command-buffer to multiple queues with CL_COMMAND_BUFFER_CAPABILITY_MULTIPLE_QUEUE_KHR
  • If such a device exits, create a command-buffer for that device passing > 1 queues to execute on.
  • Record at least one command to each queue using cl_sync_point_khr to sync
  • Finalize command buffer
  • Enqueue
  • If simultaneous enqueue is supported by the device, test enqueueing the command-buffer again while the first instance is pending
  • Flush and verify results

3 Multiple devices with native sync

  • Test case for command-buffer recording commands to command-queues
    attached to different devices that can natively synchronize with CL_DEVICE_COMMAND_BUFFER_SYNC_DEVICES_KHR
  • Query to see if device supports recording a command-queue across devices in CL_DEVICE_COMMAND_BUFFER_SYNC_DEVICES_KHR
  • If so, create a command-buffer passing 1 queue for each device with can be
    recorded against.
  • Record at least one command to each queue using cl_sync_point_khr to sync
  • Finalize command buffer
  • Enqueue
  • If simultaneous enqueue is supported by all devices, test enqueueing the command-buffer again while the first instance is pending
  • Flush and verify results

4 Multiple devices with emulated sync

  • Test case for command-buffer recording commands to command-queues
    attached to different devices that can synchronize with CL_COMMAND_BUFFER_PLATFORM_UNIVERSAL_SYNC_KHR
  • Query to see if a platform supports CL_COMMAND_BUFFER_PLATFORM_UNIVERSAL_SYNC_KHR
  • If so, create a command-buffer passing 1 queue for each device in the platform.
  • Record at least one command to each queue using cl_sync_point_khr to sync
  • Finalize command buffer
  • Enqueue
  • If simultaneous enqueue is supported by all devices, test enqueueing the command-buffer again while the first instance is pending
  • Flush and verify results

5 Manual Remap

  • Test case for creating a remapped command-buffer with clRemapCommandBufferKHR using the same number of queues.
  • Query to see if a platform supports CL_COMMAND_BUFFER_PLATFORM_REMAP_QUEUES_KHR.
  • If so, create a command-buffer using a single queue
  • Record at least one command using cl_sync_point_khr to sync
  • (a) Call clRemapCommandBufferKHR with another queue. If the platform has another device, then use a queue to the other
    device. Otherwise, use a queue to the same device with different properties.
  • Finalize both command-buffers
  • (b) Call clRemapCommandBufferKHR on original command-buffer with another queue. If the platform has another device, then use a queue to the other device. Otherwise, use a queue to the same device with different properties. May be same queue as (a).
  • Enqueue original command-buffer, command-buffer (a) and command-buffer (b).
  • If simultaneous enqueue is supported, clRemapCommandBufferKHR could be tested again on a command-buffer in the pending state.
  • Flush and verify results
  • Query remapped command-buffers with clGetCommandBufferInfoKHR and check returned values are okay

6 Automatic Remap

  • Test case for creating a remapped command-buffer with clRemapCommandBufferKHR using a different same number of queues.
  • Query to see if a platform supports CL_COMMAND_BUFFER_PLATFORM_AUTOMATIC_REMAP_KHR.
  • If so, create a command-buffer using a single queue
  • Record at least as many commands as there are devices on the platform using cl_sync_point_khr to sync
  • Finalize command-buffer
  • Call clRemapCommandBufferKHR on command-buffer with queues to all the devices on the platform, or if only one device then two queues to the same device.
  • Enqueue original command-buffer and remapped command-buffer
  • Flush and verify results
  • Query remapped command-buffer with clGetCommandBufferInfoKHR and check the returned values.

7 Multiple queue execution status

  • Test CL_EVENT_COMMAND_EXECUTION_STATUS when a command-buffer
    has commands recorded to multiple command-queues:
  • Query if device supports recording a command-buffer against multiple queues.
  • If so, create command-buffer targeting multiple queues
  • Record a command to each queue, finalize.
  • Enqueue command-buffer blocked on user-event, returning an output event
  • Check event execution status
  • unblock user event and flush()
  • Check event execution status

8 Multiple queue profiling

  • Test profiling of a command-buffer where commands are recorded to a
    different command-queues, potentially on different devices:
  • Query if device supports recording a command-buffer against multiple queues.
  • If so, create command-buffer with CL_COMMAND_BUFFER_PROFILING_ENABLE_KHR targeting
    multiple queues
  • Record a command to each queue, finalize and enqueue returning an event
  • Check event profiling queries succeed
@EwanC
Copy link
Contributor Author

EwanC commented May 21, 2024

Noting that a PR introducing negative testing of cl_khr_command_buffer, introducing negative testing of the following cl_khr_command_buffer_multi_device wording was proposed

CL_INVALID_COMMAND_QUEUE if the cl_khr_command_buffer_multi_device extension is supported; and either command_queue is NULL and command_buffer was created with more than one queue, or command_queue is not NULL and not a command-queue listed on command_buffer creation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant