Git Product home page Git Product logo

occa's Introduction

OCCA

Build Status codecov.io Documentation Join the chat at https://gitter.im/libocca/occa

OCCA is an open-source (MIT license) library used to program current multi-core/many-core architectures. Devices (such as CPUs, GPUs, Intel's Xeon Phi, FPGAs, etc) are abstracted using an offload-model for application development and programming for the devices is done through a C-based (OKL) kernel. OCCA gives developers the ability to target devices at run-time by using run-time compilation for device kernels.

Installing

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

Environment

Setup environment variables inside the occa directory

Linux

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

Mac OSX

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

Hello World

cd ${OCCA_DIR}/examples/1_add_vectors/cpp
make
./main

occa Command

There is an executable occa provided inside ${OCCA_DIR}/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
  env             Print environment variables used in OCCA
  info            Prints information about available OCCA modes
  version         Prints OCCA library version

Arguments:
  COMMAND    Command to run

Bash Autocomplete

. <(occa autocomplete bash)

Useful environment variables:

Environment Variable Description
OCCA_DIR Directory where OCCA is installed, overwrites occa::OCCA_DIR set at compile-time
OCCA_CACHE_DIR Directory where kernels get cached (Default: ${HOME}/.occa)
OCCA_INCLUDE_PATH Path to find headers, such as CUDA and OpenCL headers (: delimited)
OCCA_LIBRARY_PATH Path to find .so libraries (: delimited)
OCCA_CXX C++ compiler used for run-time kernel compilation
OCCA_CXXFLAGS C++ compiler flags used for run-time kernel compilation
OCCA_OPENCL_COMPILER_FLAGS Additional OpenCL flags when compiling kernels
OCCA_CUDA_COMPILER Compiler used for run-time CUDA kernel compilation
OCCA_CUDA_COMPILER_FLAGS CUDA compiler flags used for run-time kernel compilation
OCCA_VERBOSE Verbose logging is suppresed if set to either: 0, n, no, false (Default: false)

occa's People

Contributors

dmed256 avatar lcw avatar tcew avatar jdahm avatar pdhahn avatar sapphire-arches avatar jedbrown avatar nicholasmalaya avatar reidatcheson avatar thilinarmtb avatar

Watchers

Anand Pratap Singh 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.