clGetDeviceIDsFromVA_APIMediaAdapterINTEL support

Change-Id: I3d43f00795c36562585bee7b4ee96123389586c7
This commit is contained in:
Dunajski, Bartosz
2018-01-29 12:25:49 +01:00
parent f5513b6a1d
commit 6ab39150e0
9 changed files with 72 additions and 6 deletions

View File

@ -26,6 +26,8 @@
#include "runtime/command_queue/command_queue.h"
#include "runtime/context/context.h"
#include "runtime/helpers/get_info.h"
#include "runtime/platform/platform.h"
#include "runtime/device/device.h"
#include "runtime/sharings/va/va_sharing.h"
#include "runtime/sharings/va/va_surface.h"
#include <cstring>
@ -49,6 +51,23 @@ clCreateFromVA_APIMediaSurfaceINTEL(cl_context context, cl_mem_flags flags, VASu
return VASurface::createSharedVaSurface(pContext, pContext->getSharing<VASharingFunctions>(), flags, surface, plane, errcodeRet);
}
cl_int CL_API_CALL
clGetDeviceIDsFromVA_APIMediaAdapterINTEL(cl_platform_id platform, cl_va_api_device_source_intel mediaAdapterType,
void *mediaAdapter, cl_va_api_device_set_intel mediaAdapterSet, cl_uint numEntries,
cl_device_id *devices, cl_uint *numDevices) {
Platform *pPlatform = nullptr;
auto status = validateObjects(WithCastToInternal(platform, &pPlatform));
if (status != CL_SUCCESS) {
return CL_INVALID_PLATFORM;
}
cl_device_id device = pPlatform->getDevice(0);
GetInfoHelper::set(devices, device);
GetInfoHelper::set(numDevices, 1u);
return CL_SUCCESS;
}
cl_int CL_API_CALL
clEnqueueAcquireVA_APIMediaSurfacesINTEL(cl_command_queue commandQueue,
cl_uint numObjects,

View File

@ -76,6 +76,7 @@ std::string VaSharingBuilderFactory::getExtensions() {
void VaSharingBuilderFactory::fillGlobalDispatchTable() {
crtGlobalDispatchTable.clCreateFromVA_APIMediaSurfaceINTEL = clCreateFromVA_APIMediaSurfaceINTEL;
crtGlobalDispatchTable.clGetDeviceIDsFromVA_APIMediaAdapterINTEL = clGetDeviceIDsFromVA_APIMediaAdapterINTEL;
crtGlobalDispatchTable.clEnqueueReleaseVA_APIMediaSurfacesINTEL = clEnqueueReleaseVA_APIMediaSurfacesINTEL;
crtGlobalDispatchTable.clEnqueueAcquireVA_APIMediaSurfacesINTEL = clEnqueueAcquireVA_APIMediaSurfacesINTEL;
}
@ -88,6 +89,7 @@ void VaSharingBuilderFactory::fillGlobalDispatchTable() {
}
void *VaSharingBuilderFactory::getExtensionFunctionAddress(const std::string &functionName) {
RETURN_FUNC_PTR_IF_EXIST(clCreateFromVA_APIMediaSurfaceINTEL);
RETURN_FUNC_PTR_IF_EXIST(clGetDeviceIDsFromVA_APIMediaAdapterINTEL);
RETURN_FUNC_PTR_IF_EXIST(clEnqueueAcquireVA_APIMediaSurfacesINTEL);
RETURN_FUNC_PTR_IF_EXIST(clEnqueueReleaseVA_APIMediaSurfacesINTEL);
@ -95,5 +97,5 @@ void *VaSharingBuilderFactory::getExtensionFunctionAddress(const std::string &fu
}
static SharingFactory::RegisterSharing<VaSharingBuilderFactory, VASharingFunctions> vaSharing;
}
} // namespace OCLRT
#endif