• Stars
    star
    837
  • Rank 54,103 (Top 2 %)
  • Language LLVM
  • License
    Apache License 2.0
  • Created about 8 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Build NVIDIA® CUDA™ code for OpenCL™ 1.2 devices

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_py 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

Options

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 and/or NVIDIA K520 GPU (via aws)
  • Mac Book Pro 4th generation (thank you ASAPP :-) ), with:
    • Intel HD Graphics 530
    • Radeon Pro 450
    • Sierra OS

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

Plugins

You can install the following plugins:

  • Coriander-clblast: just do cocl_plugins.py install --repo-url https://github.com/hughperkins/coriander-clblast
  • Coriander-dnn: just do cocl_plugins.py install --repo-url https://github.com/hughperkins/coriander-dnn
  • Your plugin here?

How to create a plugin

Add to your own cmake project

  • use cocl_add_executable and cocl_add_library
  • see cmake usage

Testing

See testing

Assumptions/relaxations made by Coriander

See assumptions

Roadmap

Libraries

Coriander uses the following libraries:

  • clang/llvm: c/c++ parser/compiler; many contributors
  • thrust: parallel GPU library, from NVIDIA®
  • yaml-cpp: yaml for c++, by Jesse Beder
  • EasyCL: wrapper for OpenCL 1.2 boilerplate
  • argparsecpp: command-line parser for c++
  • gtest: unit tests for c++, from Google

Related projects

How to Cite

Please cite: CUDA-on-CL: a compiler and runtime for running NVIDIA® CUDA™ C++11 applications on OpenCL™ 1.2 Devices

License

Apache 2.0

News

  • June 23:
    • factorized CLBlast implementation of NVIDIA® CUDA™ cuBLAS API, into new plugin coriander-clblast
  • June 21:
    • created a new release v6.0.0, that marks a bunch of changes:
      • incorporates of course the earlier changes:
        • took some big steps towards portability and Windows compilation, ie using python 2.7 scripts, rather than bash scripts, and fixing many Windows-related compilation issues
        • the plugin architecture
        • factorizing the partial NVIDIA® CUDA™ cuDNN API implementation into a new plugin coriander-dnn
      • moved the default installation directory from /usr/local to ~/coriander
        • this means that plugins can be installed without sudo
        • it also makes it relatively easy to wipe and reinstall, for more effective jenkins testing
      • install_distro.py is now considerably more tested than a few days ago, and handles downloading llvm-4.0 automatically
  • Older news

More Repositories

1

DeepCL

OpenCL library to train deep convolutional neural networks
C++
849
star
2

tf-coriander

OpenCL 1.2 implementation for Tensorflow
C++
789
star
3

VeriGPU

OpenSource GPU, in Verilog, loosely based on RISC-V ISA
SystemVerilog
716
star
4

pytorch

Python wrappers for torch and lua
Python
431
star
5

cltorch

An OpenCL backend for torch.
C++
287
star
6

EasyCL

Easy to run kernels using OpenCL
C++
177
star
7

Jinja2CppLight

(very) lightweight version of Jinja2 for C++
C++
140
star
8

clnn

OpenCL backend for Torch nn neural networks library
Lua
123
star
9

howto-jenkins-ssl

quick how to on activating ssl on jenkins, so I can find it easily
109
star
10

jeigen

Java wrapper for Eigen C++ fast matrix library
C++
104
star
11

kgsgo-dataset-preprocessor

Dataset preprocessor for the KGS go dataset, eg according to Clark and Storkey input planes
Python
70
star
12

peaceful-pie

Control Unity from Python! Use for reinforcement learning.
C#
26
star
13

cpu-tutorial

Tutorial on building your own CPU, in Verilog
26
star
14

coriander-dnn

Partial implementation of NVIDIA® cuDNN API for Coriander, OpenCL 1.2
C++
22
star
15

rnn-notes

Notes on how element-research rnn works
17
star
16

luacpptemplater

Write Jinja2-style templates in C++. Uses lua as a scripting language (very lightweight)
C++
16
star
17

jfastparser

Very fast parsing of doubles and ints from a string
Java
15
star
18

pytorch-coriander

OpenCL build of pytorch - (in-progress, not useable)
Python
14
star
19

pub-prototyping

prototyping stuff
C++
13
star
20

securewebcmd

Execute commands on a linux server through a webpage. Secured using md5 hashing
JavaScript
12
star
21

neonCl-underconstruction

experimental port of nervana neon kernels in OpenCL
Python
11
star
22

selfstudy-IBP

Self-study notes for Indian Buffet Process, from reading through "The Indian Buffet Process: An Introduction and Review", Griffiths, Ghahramani, 2011
Jupyter Notebook
10
star
23

torch-modder-notes

Notes for torch maintainers/modders
10
star
24

pycudatorch

poc for using cuda torch from python :-)
Python
7
star
25

nimbix-admin

utility scripts for start/stop/ssh to nimbix instances
Python
7
star
26

coriander-CLBlast

BLAS implementation for Coriander, using CLBlast
C++
6
star
27

ArgParseCpp

C++ version of Python's ArgParse
C++
6
star
28

passwordbookmarklet

bookmarklet to generate unique secure passwords for each website from a single master password
JavaScript
5
star
29

torchunit

torchunit
Shell
4
star
30

UnityFluidSim-pub

UnityFluidSim-pub
C#
4
star
31

tinisles-googleauthenticator

Fork of the code at http://blog.tinisles.com/2011/10/google-authenticator-one-time-password-algorithm-in-javascript/
HTML
3
star
32

springgrid

Runs spring matches on a grid of botrunners
Python
3
star
33

osmp-cs

OSMP C# - Opensource Secondlife clone, from around 2005
C#
3
star
34

ailadder

code to create an ailadder webserver
Python
3
star
35

pycltorch

POC for Python wrappers for cltorch/clnn
Python
3
star
36

yet-another-measure-theoretic-probability-tutorial

Yet another measure theoretic probability tutorial
Jupyter Notebook
3
star
37

HughAI

HughAI Java AI for Spring
Java
3
star
38

selfstudy-LARS

least angle regression, reproducing for self-study
Jupyter Notebook
2
star
39

verigpu-cuda-frontend

Front-end for VeriGPU, providing NVIDIA® CUDA™ compatibility, for compatibility purposes
2
star
40

selfstudy-LIME

LIME
Jupyter Notebook
2
star
41

blameful-indenter

reindent code, whilst preserving git blame
Python
2
star
42

SpringRTS-CSharpAI

AI For Spring RTS game, in C#, from around 2006
C#
2
star
43

neon-benchmarks

benchmarks for neon, both cuda and OpenCL version
Python
2
star
44

FractalSpline-cpp

Provides SecondLife-like primitives , in C++/OpenGL. From around 2005
C++
2
star
45

relooper

Reloop llvm IR output, to have `for`s, `if`s, `while`s. From https://reviews.llvm.org/D12744
C++
2
star
46

osmp-cpp

OSMP C++ - opensource SecondLife clone, from around 2004
C++
2
star
47

chat-ai-npcs-video-resources

chat-ai-npcs-video-resources
C#
2
star
48

github-stars

get an email whenever someone stars your github repo :-)
Python
2
star
49

project-ideas

Ideas for projects
2
star
50

scalable-gpt-developer

scalable-gpt-developer
Python
2
star
51

gpu-experiments

Informal experiments on various gpu kernel questions
Python
1
star
52

dockerfiles

dockerfiles
1
star
53

virtualenv-move

Moves a python virtualenv
Shell
1
star
54

privacy-policies

privacy-policies
HTML
1
star
55

openpw

Password hash generator, including console, bookmarklet, chrome extension
JavaScript
1
star
56

headlessopenglstubs

stubs for opengl, glew, sdl, whatever it takes ;-), to get spring to run without an X session
1
star
57

ndplot

high-dimensional viewer, by projecting onto a 3d hypercube. Use the mouse to rotate the 3d projection.
Python
1
star
58

python-threadingx

Erlang-like threading functionality for Python
Python
1
star
59

youtube-likes

Receive a notification/email when someone 'like's one of your videos.
Python
1
star
60

youtube-rl-demos

Scripts, code used in youtube demos
Python
1
star
61

python-graphics-numpy

Scripts for youtube video on creating graphics in python using numpy
Python
1
star
62

SpringMapDesigner

3d MapDesigner for Spring
1
star
63

chinese-transcriptions

Transcriptions of Chinese language videos
1
star
64

pytorch-prettify

Prettifies exceptions coming out of pytorch
Jupyter Notebook
1
star
65

tf_cached_build

Cache tensorflow build dependencies, to accelerate repeated tf configures, or run on a plane
Python
1
star
66

cppsimpleargsparser

Simple C++ args parser. Easy to use. Automatically provides checking and usage printout.
C++
1
star
67

PortableTensor.Net

Cross-platform Tensor with transpose, slice as views over underlying data
C#
1
star