Code Monkey home page Code Monkey logo

clarrays.jl's Introduction

CLArrays

CLArrays.jl is unmaintained and does not work with Julia v1.0 and newer. Please use CUDA.jl, AMDGPU.jl, or oneAPI.jl instead.

Build status:

Implementation of the abstract GPU Array Interface

CLArray uses Transpiler.jl to compile Julia functions for the GPU using OpenCL.

It implements the full abstract gpu interface from GPUArrays, and most interactions will be through those functions. To learn how to use it, please refer to the GPUArray documentation:

CLArrays includes several other OpenCL-specific functions:

  • CLArrays.devices() returns a list of the OpenCL compute devices (CPU and GPU) available on the system.
  • 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.
  • is_gpu(dev::OpenCL.cl.Device) returns true if the given device is a GPU.
  • is_cpu(dev::OpenCL.cl.Device) returns true if the given device is a CPU.
  • 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.

Example

using CLArrays

for dev in CLArrays.devices()
    CLArrays.init(dev)
    x = zeros(CLArray{Float32}, 5, 5) # create a CLArray on device `dev`
end

# you can also filter with is_gpu, is_cpu
gpu_devices = CLArrays.devices(is_gpu)

Note that CLArrays.jl does not handle installing OpenCL drivers for your machine. You will need to make sure you have the appropriate drivers installed for your hardware.

Install OpenCL drivers for intel graphics in Linux

cd $HOME
git clone https://github.com/intel/beignet
cd $HOME/beignet
sudo apt-get install cmake pkg-config python ocl-icd-dev libegl1-mesa-dev ocl-icd-opencl-dev libdrm-dev libxfixes-dev libxext-dev llvm-3.6-dev clang-3.6 libclang-3.6-dev libtinfo-dev libedit-dev zlib1g-devD
mkdir build; cd build; cmake ..
make
make utest; . utests/setenv.sh; utests/utest_run
sudo make install

clarrays.jl's People

Contributors

davidbp avatar jpsamaroo avatar maaarcocr avatar maleadt avatar ranocha avatar simondanisch avatar ssfrr avatar vchuravy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.