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/|pocl]].  
+
The OpenCL support for the nu+ architecture is made through [http://portablecl.org/ pocl].  
  
 
== How to install vanilla pocl ==
 
== How to install vanilla pocl ==
  
# Download  following the [[http://portablecl.org/download.html|link]].
+
# Download  following the [http://portablecl.org/download.html link].
 
# In order to build pocl, you need the following support libraries and tools:
 
# In order to build pocl, you need the following support libraries and tools:
 
#* Latest released version of LLVM & Clang
 
#* Latest released version of LLVM & Clang
Line 31: Line 31:
 
gcc example1.c -o example `pkg-config --libs --cflags pocl`
 
gcc example1.c -o example `pkg-config --libs --cflags pocl`
 
</syntaxhighlight>
 
</syntaxhighlight>
See [[http://portablecl.org/docs/html/using.html]] and [[https://github.com/pocl/pocl/issues/282]] for further informations.
+
See [http://portablecl.org/docs/html/using.html] and [https://github.com/pocl/pocl/issues/282] for further informations.

Revision as of 17:08, 14 September 2017

The OpenCL support for the nu+ architecture is made through pocl.

How to install vanilla pocl

  1. Download following the link.
  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 [1] and [2] for further informations.