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

Function addDevice

include/af/opencl.h:247–251  ·  view source on GitHub ↗

Push user provided device control constructs into the ArrayFire device manager pool This function should be used only when the user would like ArrayFire to use an user generated OpenCL context and related objects for ArrayFire operations. \param[in] dev is the OpenCL device for which user provided context will be used by ArrayFire \param[in] ctx is the user provided OpenCL cl_context

Source from the content-addressed store, hash-verified

245 \note ArrayFire does not take control of releasing the objects passed to it. The user needs to release them appropriately.
246*/
247static inline void addDevice(cl_device_id dev, cl_context ctx, cl_command_queue que)
248{
249 af_err err = afcl_add_device_context(dev, ctx, que);
250 if (err!=AF_SUCCESS) throw af::exception("Failed to push user provided device/context to ArrayFire pool");
251}
252#endif
253
254#if AF_API_VERSION >= 33

Callers 2

mainFunction · 0.50
TEST_FFunction · 0.50

Calls 1

afcl_add_device_contextFunction · 0.50

Tested by

no test coverage detected