Skip to content

Commit

Permalink
Added missing test cases for CL_SEMAPHORE_DEVICE_HANDLE_LIST_KHR queries
Browse files Browse the repository at this point in the history
  • Loading branch information
shajder committed Aug 29, 2024
1 parent 0a00a1f commit b48b8c7
Show file tree
Hide file tree
Showing 5 changed files with 776 additions and 640 deletions.
4 changes: 3 additions & 1 deletion test_conformance/extensions/cl_khr_semaphore/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ test_definition test_list[] = {
ADD_TEST_VERSION(semaphores_cross_queues_io, Version(1, 2)),
ADD_TEST_VERSION(semaphores_multi_signal, Version(1, 2)),
ADD_TEST_VERSION(semaphores_multi_wait, Version(1, 2)),
ADD_TEST_VERSION(semaphores_queries, Version(1, 2)),
ADD_TEST_VERSION(semaphores_device_list_queries, Version(1, 2)),
ADD_TEST_VERSION(semaphores_no_device_list_queries, Version(1, 2)),
ADD_TEST_VERSION(semaphores_multi_device_context_queries, Version(1, 2)),
ADD_TEST_VERSION(semaphores_import_export_fd, Version(1, 2)),
ADD_TEST_VERSION(semaphores_negative_create_invalid_context, Version(1, 2)),
ADD_TEST_VERSION(semaphores_negative_create_invalid_property,
Expand Down
14 changes: 12 additions & 2 deletions test_conformance/extensions/cl_khr_semaphore/procs.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,18 @@ extern int test_semaphores_multi_signal(cl_device_id deviceID,
int num_elements);
extern int test_semaphores_multi_wait(cl_device_id deviceID, cl_context context,
cl_command_queue queue, int num_elements);
extern int test_semaphores_queries(cl_device_id deviceID, cl_context context,
cl_command_queue queue, int num_elements);
extern int test_semaphores_device_list_queries(cl_device_id deviceID,
cl_context context,
cl_command_queue queue,
int num_elements);
extern int test_semaphores_no_device_list_queries(cl_device_id deviceID,
cl_context context,
cl_command_queue queue,
int num_elements);
extern int test_semaphores_multi_device_context_queries(cl_device_id deviceID,
cl_context context,
cl_command_queue queue,
int num_elements);
extern int test_semaphores_import_export_fd(cl_device_id deviceID,
cl_context context,
cl_command_queue queue,
Expand Down
24 changes: 23 additions & 1 deletion test_conformance/extensions/cl_khr_semaphore/semaphore_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,33 @@
#define CL_KHR_SEMAPHORE_BASE_H

#include <CL/cl_ext.h>

#include <vector>

#include "harness/deviceInfo.h"
#include "harness/testHarness.h"

#include "harness/typeWrappers.h"

// scope guard helper to ensure proper releasing of sub devices
struct SubDevicesScopeGuarded
{
SubDevicesScopeGuarded(const cl_int dev_count)
{
sub_devices.resize(dev_count);
}
~SubDevicesScopeGuarded()
{
for (auto &device : sub_devices)
{
cl_int err = clReleaseDevice(device);
if (err != CL_SUCCESS)
log_error("\n Releasing sub-device failed \n");
}
}

std::vector<cl_device_id> sub_devices;
};

struct SemaphoreBase
{
SemaphoreBase(cl_device_id device): device(device) {}
Expand Down
Loading

0 comments on commit b48b8c7

Please sign in to comment.