Set active device using cl_context and cl_device_id \param[in] dev is the OpenCL device id that is to be set as Active device inside ArrayFire \param[in] ctx is the OpenCL cl_context being used by ArrayFire */
| 259 | \param[in] ctx is the OpenCL cl_context being used by ArrayFire |
| 260 | */ |
| 261 | static inline void setDevice(cl_device_id dev, cl_context ctx) |
| 262 | { |
| 263 | af_err err = afcl_set_device_context(dev, ctx); |
| 264 | if (err!=AF_SUCCESS) throw af::exception("Failed to set device based on cl_device_id & cl_context"); |
| 265 | } |
| 266 | #endif |
| 267 | |
| 268 | #if AF_API_VERSION >= 33 |