Giter Club home page Giter Club logo

cuarrays.jl's Introduction

CuArrays

CuArrays provides a fully-functional GPU array, which can give significant speedups over normal arrays without code changes. CuArrays are implemented fully in Julia, making the implementation elegant and extremely generic.

Installation

CuArrays should work out-of-the-box on Julia 1.0. You only need to have a proper set-up of CUDA, meaning the rest of the Julia CUDA stack should work (notably CUDAapi.jl, CUDAdrv.jl and CUDAnative.jl). If you encounter any issues with CuArrays.jl, please make sure those other packages are working as expected.

Some parts of CuArrays.jl depend on optional libraries, such as cuDNN. The build process should notify about missing dependencies, i.e. inspect the output of Pkg.build("CuArrays") to see whether your installation is complete.

Features

xs = cu(rand(5, 5))
ys = cu[1, 2, 3]
xs_cpu = collect(xs)

Because CuArray is an AbstractArray, it doesn't have much of a learning curve; just use your favourite array ops as usual. The following are supported (on arbitrary numbers of arguments, dimensions etc):

  • Conversions and copy! with CPU arrays
  • General indexing (xs[1:2, 5, :])
  • permutedims
  • Concatenation (vcat(x, y), cat(3, xs, ys, zs))
  • map, fused broadcast (zs .= xs.^2 .+ ys .* 2)
  • fill!(xs, 0)
  • Reduction over dimensions (reducedim(+, xs, 3), sum(x -> x^2, xs, 1) etc)
  • Reduction to scalar (reduce(*, 1, xs), sum(xs) etc)
  • Various BLAS operations (matrix*matrix, matrix*vector)
  • FFTs, using the AbstractFFTs API

We welcome issues or PRs for functionality not on this list.

Note that some operations not on this list will work, but be slow, due to Base's generic implementations. This is intentional, to enable a "make it work, then make it fast" workflow. When you're ready you can disable slow fallback methods:

julia> CuArrays.allowscalar(false)
julia> xs[5]
ERROR: getindex is disabled

cuarrays.jl's People

Contributors

maleadt avatar mikeinnes avatar andreasnoack avatar vchuravy avatar jdnz avatar dfdx avatar simondanisch avatar haampie avatar mbeltagy avatar mohamed82008 avatar tejank10 avatar ralphas avatar gustafsson avatar bors[bot] avatar avik-pal avatar kshyatt avatar femtocleaner[bot] avatar jekbradbury avatar roger-luo avatar ilkerkesen avatar boathit avatar

Watchers

 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.