MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / Context

Method Context

include/CL/opencl.hpp:3105–3134  ·  view source on GitHub ↗

! \brief Constructs a context including a list of specified devices. * * Wraps clCreateContext(). */

Source from the content-addressed store, hash-verified

3103 * Wraps clCreateContext().
3104 */
3105 Context(
3106 const vector<Device>& devices,
3107 const cl_context_properties* properties = nullptr,
3108 void (CL_CALLBACK * notifyFptr)(
3109 const char *,
3110 const void *,
3111 size_type,
3112 void *) = nullptr,
3113 void* data = nullptr,
3114 cl_int* err = nullptr)
3115 {
3116 cl_int error;
3117
3118 size_type numDevices = devices.size();
3119 vector<cl_device_id> deviceIDs(numDevices);
3120
3121 for( size_type deviceIndex = 0; deviceIndex < numDevices; ++deviceIndex ) {
3122 deviceIDs[deviceIndex] = (devices[deviceIndex])();
3123 }
3124
3125 object_ = ::clCreateContext(
3126 properties, (cl_uint) numDevices,
3127 deviceIDs.data(),
3128 notifyFptr, data, &error);
3129
3130 detail::errHandler(error, __CREATE_CONTEXT_ERR);
3131 if (err != nullptr) {
3132 *err = error;
3133 }
3134 }
3135
3136 /*! \brief Constructs a context including a specific device.
3137 *

Callers

nothing calls this directly

Calls 7

clCreateContextFunction · 0.85
errHandlerFunction · 0.85
clCreateContextFromTypeFunction · 0.85
getDevicesMethod · 0.80
errMethod · 0.80
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected