Skip to content

Latest commit

 

History

History
109 lines (78 loc) · 2.63 KB

README.md

File metadata and controls

109 lines (78 loc) · 2.63 KB

occa

 

Build Status codecov.io Gitter

 

What is OCCA?

In a nutshell, OCCA (like oca-rina) is an open-source library which aims to

  • Make it easy to program different types of devices (e.g. CPU, GPU, FPGA)
  • Provide a unified API for interacting with backend device APIs (e.g. OpenMP, CUDA, OpenCL)
  • Use just-in-time compilation to build backend kernels
  • Provide a kernel language, a minor extension to C, to abstract programming for each backend

 

Links

 

Installing

git clone --depth 1 https://github.com/libocca/occa.git
cd occa
make -j 4

 

Environment

Setup environment variables inside the occa directory

Linux

export PATH+=":${PWD}/bin"
export LD_LIBRARY_PATH+=":${PWD}/lib"

Mac OSX

export PATH+=":${PWD}/bin"
export DYLD_LIBRARY_PATH+=":${PWD}/lib"

 

Hello World

cd examples/1_add_vectors/cpp
make
./main

 

CLI

There is an executable occa provided inside bin

> occa --help

Usage: occa COMMAND

Can be used to display information of cache kernels.

Commands:
  autocomplete    Prints shell functions to autocomplete occa
                  commands and arguments
  cache           Cache kernels
  clear           Clears cached files and cache locks
  compile         Compile kernels
  env             Print environment variables used in OCCA
  info            Prints information about available backend modes
  modes           Prints available backend modes
  translate       Translate kernels
  version         Prints OCCA library version

Arguments:
  COMMAND    Command to run

 

Bash Autocomplete

. <(occa autocomplete bash)