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

Function getContext

include/af/oneapi.h:168–174  ·  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

166 \note Set \p retain to true if this value will be passed to a cl::Context constructor
167 */
168 static inline cl_context getContext(bool retain = false)
169 {
170 cl_context ctx;
171 af_err err = afcl_get_context(&ctx, retain);
172 if (err != AF_SUCCESS) throw af::exception("Failed to get OpenCL context from arrayfire");
173 return ctx;
174 }
175
176 /**
177 Get a handle to ArrayFire's OpenCL command queue

Callers 1

arrayFunction · 0.70

Calls 1

afcl_get_contextFunction · 0.50

Tested by

no test coverage detected