Difference between revisions of "OpenCL"

From NaplesPU Documentation
Jump to: navigation, search
Line 1: Line 1:
The OpenCL support for the nu+ architecture is made through [[http://portablecl.org/|//portablecl.org/]].  
+
The OpenCL support for the nu+ architecture is made through [[http://portablecl.org/|pocl]].  
  
== How to install vanilla ==
+
== How to install vanilla pocl ==
  
 
# Download  following the [[http://portablecl.org/download.html|link]].
 
# Download  following the [[http://portablecl.org/download.html|link]].

Revision as of 17:04, 14 September 2017

The OpenCL support for the nu+ architecture is made through [[1]].

How to install vanilla pocl

  1. Download following the [[2]].
  2. In order to build pocl, you need the following support libraries and tools:
    • Latest released version of LLVM & Clang
    • GNU make
    • libtool dlopen wrapper files (e.g. libltdl3-dev in Debian)
    • pthread (should be installed by default)
    • hwloc v1.0 or newer (e.g. libhwloc-dev)
    • pkg-config
    • cmake
    • libclang-3.8-dev if you are using Ubuntu 16.04 LTS
    On Ubuntu 16.04 LTS you can run the following code on a terminal
    sudo apt-get install llvm & clang & libltdl3-dev & libhwloc-dev & libhwloc-dev & libclang-3.8-dev & make & cmake
  3. Build and install
    cd <directory-with-pocl-sources>
    mkdir build
    cd build
    cmake [-D<option>=<value> ...] ..
    make && make install

Using pocl

To compile with pocl you have to execute:

gcc example1.c -o example `pkg-config --libs --cflags pocl`

See [[3]] and [[4]] for further informations.