You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 27, 2021. It is now read-only.
The only noteworthy functionality that isn't part of the GPUArray interface is how to select and initialize devices:
15
+
CLArrays includes several other OpenCL-specific functions:
16
+
17
+
*`CLArrays.devices()` returns a list of the OpenCL compute devices (CPU and GPU) available on the system.
18
+
*`CLArrays.init(dev::OpenCL.cl.Device)` will set the given device to be the active device. If you do not initialize a device explicitly, a default device will be chosen automatically, prioritizing GPU devices over CPU devices.
19
+
*`is_gpu(dev::OpenCL.cl.Device)` returns `true` if the given device is a GPU.
20
+
*`is_cpu(dev::OpenCL.cl.Device)` returns `true` if the given device is a CPU.
21
+
*`gpu_call(kernel::Function, A::GPUArray, args::Tuple, configuration = length(A))` calls the given function on the GPU. See the function documentation for more details.
22
+
23
+
### Example
16
24
17
25
```Julia
18
26
using CLArrays
@@ -21,6 +29,7 @@ for dev in CLArrays.devices()
21
29
CLArrays.init(dev)
22
30
x =zeros(CLArray{Float32}, 5, 5) # create a CLArray on device `dev`
0 commit comments