| 115 | // -------------------------------------------------------------------------------------------------------------------- |
| 116 | |
| 117 | COpenCLDevice::COpenCLDevice(CContext* context, |
| 118 | IOpenCLDeviceList* deviceList, |
| 119 | IPLint32 index) |
| 120 | { |
| 121 | #if defined(IPL_USES_OPENCL) |
| 122 | auto _context = context->mHandle.get(); |
| 123 | if (!_context) |
| 124 | throw Exception(Status::Failure); |
| 125 | |
| 126 | auto _deviceList = static_cast<COpenCLDeviceList*>(deviceList)->mHandle.get(); |
| 127 | if (!_deviceList) |
| 128 | throw Exception(Status::Failure); |
| 129 | |
| 130 | auto& _deviceDesc = (*_deviceList)[index]; |
| 131 | |
| 132 | new (&mHandle) Handle<OpenCLDevice>(ipl::make_shared<OpenCLDevice>(_deviceDesc.platform, _deviceDesc.device, _deviceDesc.numConvolutionCUs, _deviceDesc.numIRUpdateCUs), _context); |
| 133 | #endif |
| 134 | } |
| 135 | |
| 136 | COpenCLDevice::COpenCLDevice(CContext* context, |
| 137 | void* convolutionQueue, |