GithubHelp home page GithubHelp logo

openclblas.jl's Introduction

OpenCLBLAS.jl

######OpenCL BLAS library wrapper for Julia with samples

##What is this project?

This project focuses on running OpenCL BLAS with Julia matrices on GPU devices seamlessly, all OpenCL type definitions and functions were hand-typed from cl.h and clBLAS.h header.

Currently, I've only rewritten the example C program (single precision GEMM BLAS) provided with libclBLAS into test_sgemm.jl. I also made a separate high level function to manages all the memory involved with calling the C function clblasSgemm().

As a result, the OpenCLBLAS.sgemm() function cleans up the buffers, events, contexts, and queues in the GPU memory.

##Usage

The following example shows how a user can use the GEMM function to modify a matrix C.

include("sgemm.jl")

A = convert(Array{Float32,2}, [[11, 12, 13, 14, 15]';[21, 22, 23, 24, 25]';[31, 32, 33, 34, 35]';[41, 42, 43, 44, 45]'])
B = convert(Array{Float32,2}, [[11, 12, 13]';[21, 22, 23]';[31, 32, 33]';[41, 42, 43]';[51, 52, 53]'])
C = convert(Array{Float32,2}, [[11, 12, 13]';[21, 22, 23]';[31, 32, 33]';[41, 42, 43]'])
OpenCLBLAS.sgemm!('N','N',Float32(10),A,B, Float32(20), C)

The result can be seen in this query:

julia> C
4x3 Array{Float32, 2}:
 21370.0  22040.0  22710.0
 37070.0  38240.0  39410.0
 52770.0  54440.0  56110.0
 68470.0  70640.0  72810.0

julia>

##Progress

I'll add more OpenCLBLAS functions as I test them myself.

The following functions have been tested on a Windows x64 PC with an NVIDIA GPU:
-sGEMM

#####This project is based off the work of these projects:

OpenCL.jl by Jake Bolewski and Valentin Churavy
CUBLAS.jl by Nick Henderson

##License

The license can be found in the file 'LICENSE'.

openclblas.jl's People

Contributors

mikhail-j avatar

Watchers

 avatar  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.