Skip to content

Commit

Permalink
switch to the new memory and semaphore specific device handle lists (#…
Browse files Browse the repository at this point in the history
…1814)

* switch to the new memory and semaphore specific device handle lists

* remove support for older headers

* dummy commit
  • Loading branch information
bashbaug authored Nov 14, 2023
1 parent 8b1a44f commit eec46a0
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
14 changes: 8 additions & 6 deletions test_conformance/common/vulkan_wrapper/opencl_vulkan_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -595,10 +595,11 @@ clExternalMemory::clExternalMemory(
throw std::runtime_error("Unsupported external memory type\n ");
}

extMemProperties.push_back((cl_mem_properties)CL_DEVICE_HANDLE_LIST_KHR);
extMemProperties.push_back(
(cl_mem_properties)CL_MEM_DEVICE_HANDLE_LIST_KHR);
extMemProperties.push_back((cl_mem_properties)devList[0]);
extMemProperties.push_back(
(cl_mem_properties)CL_DEVICE_HANDLE_LIST_END_KHR);
(cl_mem_properties)CL_MEM_DEVICE_HANDLE_LIST_END_KHR);
extMemProperties.push_back(0);

m_externalMemory = clCreateBufferWithProperties(
Expand Down Expand Up @@ -691,10 +692,11 @@ clExternalMemoryImage::clExternalMemoryImage(
throw std::runtime_error("getCLImageInfoFromVkImageInfo failed!!!");
}

extMemProperties1.push_back((cl_mem_properties)CL_DEVICE_HANDLE_LIST_KHR);
extMemProperties1.push_back(
(cl_mem_properties)CL_MEM_DEVICE_HANDLE_LIST_KHR);
extMemProperties1.push_back((cl_mem_properties)devList[0]);
extMemProperties1.push_back(
(cl_mem_properties)CL_DEVICE_HANDLE_LIST_END_KHR);
(cl_mem_properties)CL_MEM_DEVICE_HANDLE_LIST_END_KHR);
extMemProperties1.push_back(0);
m_externalMemory = clCreateImageWithProperties(
context, extMemProperties1.data(), CL_MEM_READ_WRITE, &img_format,
Expand Down Expand Up @@ -846,10 +848,10 @@ clExternalSemaphore::clExternalSemaphore(
}

sema_props.push_back(
(cl_semaphore_properties_khr)CL_DEVICE_HANDLE_LIST_KHR);
(cl_semaphore_properties_khr)CL_SEMAPHORE_DEVICE_HANDLE_LIST_KHR);
sema_props.push_back((cl_semaphore_properties_khr)devList[0]);
sema_props.push_back(
(cl_semaphore_properties_khr)CL_DEVICE_HANDLE_LIST_END_KHR);
(cl_semaphore_properties_khr)CL_SEMAPHORE_DEVICE_HANDLE_LIST_END_KHR);
sema_props.push_back(0);
m_externalSemaphore =
clCreateSemaphoreWithPropertiesKHRptr(context, sema_props.data(), &err);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ int test_external_semaphores_queries(cl_device_id deviceID, cl_context context,
SEMAPHORE_PARAM_TEST(CL_SEMAPHORE_TYPE_KHR, cl_semaphore_type_khr,
CL_SEMAPHORE_TYPE_BINARY_KHR);

SEMAPHORE_PARAM_TEST(CL_DEVICE_HANDLE_LIST_KHR, cl_device_id, deviceID);
SEMAPHORE_PARAM_TEST(CL_SEMAPHORE_DEVICE_HANDLE_LIST_KHR, cl_device_id,
deviceID);

SEMAPHORE_PARAM_TEST(
CL_SEMAPHORE_EXPORT_HANDLE_TYPES_KHR, cl_uint,
Expand Down
20 changes: 10 additions & 10 deletions test_conformance/vulkan/test_vulkan_api_consistency.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ int test_consistency_external_buffer(cl_device_id deviceID, cl_context _context,
int fd;

std::vector<cl_mem_properties> extMemProperties{
(cl_mem_properties)CL_DEVICE_HANDLE_LIST_KHR,
(cl_mem_properties)CL_MEM_DEVICE_HANDLE_LIST_KHR,
(cl_mem_properties)devList[0],
(cl_mem_properties)CL_DEVICE_HANDLE_LIST_END_KHR,
(cl_mem_properties)CL_MEM_DEVICE_HANDLE_LIST_END_KHR,
};
cl_external_memory_handle_type_khr type;
switch (vkExternalMemoryHandleType)
Expand Down Expand Up @@ -162,9 +162,9 @@ int test_consistency_external_buffer(cl_device_id deviceID, cl_context _context,
(cl_mem_properties)type,
(cl_mem_properties)-64, // Passing random invalid fd
#endif
(cl_mem_properties)CL_DEVICE_HANDLE_LIST_KHR,
(cl_mem_properties)CL_MEM_DEVICE_HANDLE_LIST_KHR,
(cl_mem_properties)devList[0],
(cl_mem_properties)CL_DEVICE_HANDLE_LIST_END_KHR,
(cl_mem_properties)CL_MEM_DEVICE_HANDLE_LIST_END_KHR,
0
};
buffer = clCreateBufferWithProperties(context, extMemProperties2.data(), 1,
Expand Down Expand Up @@ -257,9 +257,9 @@ int test_consistency_external_image(cl_device_id deviceID, cl_context _context,
void* handle = NULL;
int fd;
std::vector<cl_mem_properties> extMemProperties{
(cl_mem_properties)CL_DEVICE_HANDLE_LIST_KHR,
(cl_mem_properties)CL_MEM_DEVICE_HANDLE_LIST_KHR,
(cl_mem_properties)devList[0],
(cl_mem_properties)CL_DEVICE_HANDLE_LIST_END_KHR,
(cl_mem_properties)CL_MEM_DEVICE_HANDLE_LIST_END_KHR,
};
switch (vkExternalMemoryHandleType)
{
Expand Down Expand Up @@ -484,15 +484,15 @@ int test_consistency_external_semaphore(cl_device_id deviceID,
"Unsupported external sempahore handle type\n ");
}
sema_props1.push_back(
(cl_semaphore_properties_khr)CL_DEVICE_HANDLE_LIST_KHR);
(cl_semaphore_properties_khr)CL_SEMAPHORE_DEVICE_HANDLE_LIST_KHR);
sema_props1.push_back((cl_semaphore_properties_khr)devList[0]);
sema_props1.push_back(
(cl_semaphore_properties_khr)CL_DEVICE_HANDLE_LIST_END_KHR);
(cl_semaphore_properties_khr)CL_SEMAPHORE_DEVICE_HANDLE_LIST_END_KHR);
sema_props2.push_back(
(cl_semaphore_properties_khr)CL_DEVICE_HANDLE_LIST_KHR);
(cl_semaphore_properties_khr)CL_SEMAPHORE_DEVICE_HANDLE_LIST_KHR);
sema_props2.push_back((cl_semaphore_properties_khr)devList[0]);
sema_props2.push_back(
(cl_semaphore_properties_khr)CL_DEVICE_HANDLE_LIST_END_KHR);
(cl_semaphore_properties_khr)CL_SEMAPHORE_DEVICE_HANDLE_LIST_END_KHR);
sema_props1.push_back(0);
sema_props2.push_back(0);

Expand Down

0 comments on commit eec46a0

Please sign in to comment.