Nek5000 / occa

JIT Compilation for Multiple Architectures: C++, OpenMP, CUDA, HIP, OpenCL, Metal

Home Page:https://libocca.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

occa

 

Build codecov.io Slack

 

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, HIP, OpenCL, Metal)
  • 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/cpp/1_add_vectors
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)

About

JIT Compilation for Multiple Architectures: C++, OpenMP, CUDA, HIP, OpenCL, Metal

https://libocca.org

License:MIT License


Languages

Language:C++ 87.9%Language:C 4.2%Language:Fortran 3.8%Language:Shell 1.0%Language:CMake 0.9%Language:Makefile 0.9%Language:Objective-C++ 0.9%Language:Python 0.3%Language:Emacs Lisp 0.1%