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 */
| 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 |
no test coverage detected