MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / getContext

Function getContext

include/af/opencl.h:182–188  ·  view source on GitHub ↗

Get a handle to ArrayFire's OpenCL context \param[in] retain if true calls clRetainContext prior to returning the context \returns the current context being used by ArrayFire \note Set \p retain to true if this value will be passed to a cl::Context constructor */

Source from the content-addressed store, hash-verified

180 \note Set \p retain to true if this value will be passed to a cl::Context constructor
181 */
182 static inline cl_context getContext(bool retain = false)
183 {
184 cl_context ctx;
185 af_err err = afcl_get_context(&ctx, retain);
186 if (err != AF_SUCCESS) throw af::exception("Failed to get OpenCL context from arrayfire");
187 return ctx;
188 }
189
190 /**
191 Get a handle to ArrayFire's OpenCL command queue

Callers 15

arrayFunction · 0.70
mainFunction · 0.50
removeDeviceContextFunction · 0.50
findPlanFunction · 0.50
removeDeviceContextFunction · 0.50
afcl_get_contextFunction · 0.50
nativeAllocMethod · 0.50
registerResourcesMethod · 0.50
assignFunction · 0.50
qr_inplaceFunction · 0.50
buildProgramFunction · 0.50
loadModuleFromDiskFunction · 0.50

Calls 1

afcl_get_contextFunction · 0.50

Tested by

no test coverage detected