Add acquire/release (#1899)

Add acquire/release commands where appropriate. This is related to 1886.
This commit is contained in:
joshqti
2024-05-21 08:45:41 -07:00
committed by GitHub
parent fb39357911
commit 4fceb78b93
3 changed files with 178 additions and 7 deletions

View File

@@ -96,6 +96,26 @@ void init_cl_vk_ext(cl_platform_id opencl_platform, cl_uint num_devices,
"clReImportSemaphoreSyncFdKHR!");
}
}
clEnqueueAcquireExternalMemObjectsKHRptr =
(pfnclEnqueueAcquireExternalMemObjectsKHR)
clGetExtensionFunctionAddressForPlatform(
opencl_platform, "clEnqueueAcquireExternalMemObjectsKHR");
if (nullptr == clEnqueueAcquireExternalMemObjectsKHRptr)
{
throw std::runtime_error("Failed to get the function pointer of "
"clEnqueueAcquireExternalMemObjectsKHR!");
}
clEnqueueReleaseExternalMemObjectsKHRptr =
(pfnclEnqueueReleaseExternalMemObjectsKHR)
clGetExtensionFunctionAddressForPlatform(
opencl_platform, "clEnqueueReleaseExternalMemObjectsKHR");
if (nullptr == clEnqueueReleaseExternalMemObjectsKHRptr)
{
throw std::runtime_error("Failed to get the function pointer of "
"clEnqueueReleaseExternalMemObjectsKHR!");
}
}
cl_int setMaxImageDimensions(cl_device_id deviceID, size_t &max_width,