mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-23 07:39:01 +00:00
Semaphore types bug fixes revised (#1822)
* Added support for SYNC_FD and other handle types * Fix consistency test Deleted test cases that are no longer testable according to the spec. * Fix multi-import tests -Delete obsolete code relating to offsets -Propagate dedicated memory change * Fix error handling Some subtests did not fail on incorrect result. Changes to macros to fail, so this does not occur again. * Delete invalid test cases Test cases are not related to this extension. * External memory test Add support for any handle type supported by the platform. Change-Id: I6765fde5e7929988f49bfbf2df2f41d5263b6abc * Update multi-import tests to use new semaphore types * Fix formatting * Addressed review comments. Deleted VULKAN_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_NT_KMT as it appears to be redundant.
This commit is contained in:
@@ -50,6 +50,10 @@ typedef cl_int (*pfnclEnqueueReleaseExternalMemObjectsKHR)(
|
||||
const cl_mem *mem_objects, cl_uint num_events_in_wait_list,
|
||||
const cl_event *event_wait_list, cl_event *event);
|
||||
typedef cl_int (*pfnclReleaseSemaphoreKHR)(cl_semaphore_khr sema_object);
|
||||
typedef cl_int (*pfnclGetSemaphoreHandleForTypeKHR)(
|
||||
cl_semaphore_khr sema_object, cl_device_id device,
|
||||
cl_external_semaphore_handle_type_khr handleType, size_t handle_size,
|
||||
void *handle, size_t *handleSize);
|
||||
|
||||
extern pfnclCreateSemaphoreWithPropertiesKHR
|
||||
clCreateSemaphoreWithPropertiesKHRptr;
|
||||
@@ -83,8 +87,7 @@ public:
|
||||
clExternalMemory();
|
||||
clExternalMemory(const VulkanDeviceMemory *deviceMemory,
|
||||
VulkanExternalMemoryHandleType externalMemoryHandleType,
|
||||
uint64_t offset, uint64_t size, cl_context context,
|
||||
cl_device_id deviceId);
|
||||
uint64_t size, cl_context context, cl_device_id deviceId);
|
||||
|
||||
virtual ~clExternalMemory();
|
||||
cl_mem getExternalMemoryBuffer();
|
||||
@@ -111,9 +114,12 @@ public:
|
||||
class clExternalSemaphore {
|
||||
protected:
|
||||
cl_semaphore_khr m_externalSemaphore;
|
||||
VulkanExternalSemaphoreHandleType m_externalHandleType;
|
||||
cl_device_id m_device;
|
||||
cl_context m_context;
|
||||
const VulkanSemaphore &m_deviceSemaphore;
|
||||
int fd;
|
||||
void *handle;
|
||||
clExternalSemaphore(const clExternalSemaphore &externalSemaphore);
|
||||
|
||||
public:
|
||||
clExternalSemaphore(
|
||||
@@ -121,8 +127,8 @@ public:
|
||||
VulkanExternalSemaphoreHandleType externalSemaphoreHandleType,
|
||||
cl_device_id deviceId);
|
||||
virtual ~clExternalSemaphore() noexcept(false);
|
||||
void signal(cl_command_queue command_queue);
|
||||
void wait(cl_command_queue command_queue);
|
||||
int signal(cl_command_queue command_queue);
|
||||
int wait(cl_command_queue command_queue);
|
||||
cl_semaphore_khr &getCLSemaphore();
|
||||
// operator openclExternalSemaphore_t() const;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user