Code Monkey home page Code Monkey logo

coriander's Introduction

Coriander

Build applications written in NVIDIA® CUDA™ code for OpenCL™ 1.2 devices.

Concept

  • leave applications in NVIDIA® CUDA™
  • compile into OpenCL 1.2
  • run on any OpenCL 1.2 GPU

How to use

  • Write an NVIDIA® CUDA™ sourcecode file, or find an existing one
  • Let's use cuda_sample.cu
  • Compile, using cocl:
$ cocl cuda_sample.cu
   ...
   ... (bunch of compily stuff) ...
   ...

    ./cuda_sample.cu compiled into ./cuda_sample

Run:

$ ./cuda_sample
Using Intel , OpenCL platform: Intel Gen OCL Driver
Using OpenCL device: Intel(R) HD Graphics 5500 BroadWell U-Processor GT2
hostFloats[2] 123
hostFloats[2] 222
hostFloats[2] 444

Advanced usage

What Coriander provides

  • compiler for host-side code, including memory allocation, copy, streams, kernel launches
  • compiler for device-side code, handling templated C++ code, converting it into bog-standard OpenCL 1.2 code
  • cuBLAS API implementations for GEMM, GEMV, SCAL, SAXPY (using Cedric Nugteren's CLBlast)
  • cuDNN API implementations for: convolutions (using im2col algorithm over Cedric Nugteren's CLBlast, pooling, ReLU, tanh, and sigmoid

How Coriander works

Kernel compilation proceeds in two steps:

Slides on the IWOCL website, here

Installation

Coriander development is carried out using the following platforms:

  • Ubuntu 16.04, with:
    • NVIDIA K80 GPU
  • Mac Sierra, with:
    • Intel HD Graphics 530
    • Radeon Pro 450

Other systems should work too, ideally. You will need at a minimum at least one OpenCL-enabled GPU, and appropriate OpenCL drivers installed, for the GPU. Both linux and Mac systems stand a reasonable chance of working ok.

For installation, please see installation.md

Testing

See testing.md

Simplifications made by Coriander

Coriander makes the following relaxations/simplifications:

  • ints are generally assumed to be no longer than 32-bit, and truncated to 32-bit mostly
  • floats are assumed to be singles. doubles in the original kernels are converted to floats in the OpenCL code
  • buffer offsets are generally taken to be int32s for now. This might change in the future

Related projects

License

Apache 2.0

News

  • May 20:
    • renamed to Coriander
  • May 18:
    • Presented Coriander at this year's IWOCL :-) Full IWOCL program here, and there is a link to my own slides
  • May 5:
  • May 1:
    • dnn tests pass on Radeon Pro 450, on Mac Sierra now
    • fix crash bugs in pooling forward/backward, on Mac Sierra
    • thanks to my employer ASAPP giving me use of a nice Mac Book Pro 4th Generation, with Radeon Pro 450, unit tests now pass on said hardware :-)
  • April 29:
    • Updated to latest EasyCL. This lets you use environment variable CL_GPUOFFSET to choose different gpus, eg set to 1 to use second gpu, to 2 to use third gpu, etc
  • Older news

coriander's People

Contributors

hughperkins avatar weimzh avatar guoyejun avatar iame6162013 avatar

Watchers

Marek Kolodziej 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.