arrayfire.opencl module¶
Functions specific to OpenCL backend.
This module provides interoperability with other OpenCL libraries.
-
class
arrayfire.opencl.DEVICE_TYPE[source]¶ Bases:
enum.EnumArrayFire wrapper for CL_DEVICE_TYPE
-
ACC= <DEVICE_TYPE.ACC: 8>¶
-
CPU= <DEVICE_TYPE.CPU: 2>¶
-
GPU= <DEVICE_TYPE.GPU: 4>¶
-
UNKNOWN= <DEVICE_TYPE.UNKNOWN: -1>¶
-
-
class
arrayfire.opencl.PLATFORM[source]¶ Bases:
enum.EnumArrayFire enum for common platforms
-
AMD= <PLATFORM.AMD: 0>¶
-
APPLE= <PLATFORM.APPLE: 1>¶
-
BEIGNET= <PLATFORM.BEIGNET: 4>¶
-
INTEL= <PLATFORM.INTEL: 2>¶
-
NVIDIA= <PLATFORM.NVIDIA: 3>¶
-
POCL= <PLATFORM.POCL: 5>¶
-
UNKNOWN= <PLATFORM.UNKNOWN: -1>¶
-
-
arrayfire.opencl.add_device_context(dev, ctx, que)[source]¶ Add a new device to arrayfire opencl device manager
Parameters: dev : cl_device_id
ctx : cl_context
que : cl_command_queue
-
arrayfire.opencl.delete_device_context(dev, ctx)[source]¶ Delete a device
Parameters: dev : cl_device_id
ctx : cl_context
-
arrayfire.opencl.get_context(retain=False)[source]¶ Get the current OpenCL context being used by ArrayFire.
Parameters: retain : bool. optional. Default: False.
Specifies if the context needs to be retained by arrayfire before returning.
Returns: context : integer denoting the context id.
-
arrayfire.opencl.get_device_id()[source]¶ Get native (unsorted) OpenCL device ID
Returns: idx : int.
Specifies the cl_device_id of the device.
-
arrayfire.opencl.get_queue(retain)[source]¶ Get the current OpenCL command queue being used by ArrayFire.
Parameters: retain : bool. optional. Default: False.
Specifies if the context needs to be retained by arrayfire before returning.
Returns: queue : integer denoting the queue id.