Skip to content

StRigaud/CLIc_prototype

 
 

Repository files navigation

Build & test CI-Tests Codecov License Website GitHub stars GitHub forks

CLIc

CLIc is a prototype for CLesperanto - a multi-language framework for GPU-accelerated image processing. It uses OpenCL kernels from CLIJ

It is a preliminary projet and mainly focussed on running a few kernel using the OpenCL C++ API from Khronos.

Usage example

#include "clesperanto.h"  // CLIc include

int main( int argc, char** argv)
{
    // Initialisation of clEsperanto with default device
    cle::Clesperanto cle;

    // store data to process in vector
    std::array<size_t,3> dimensions = {width, height, depth};
    std::vector<float> data (width * height * depth); 

    /*
     * ... fill input with data to process  
     */

    // push data from host to device
    auto gpu_src = cle.Push<float>(data, dimensions);
    // allocate space on device
    auto gpu_dst = cle.Create<float>(dimensions);
    // apply filter with parameters
    cle.AddImageAndScalar(gpu_src, gpu_dst, 10);
    // pull output from device to host
    auto output = cle.Pull<float>(gpu_dst); 

    return EXIT_SUCCESS;
}

See more complete example on usage by looking at the kernels tests.

Installation

Requirements

CLIc rely on OpenCL language for parallelisation and CMake for configuration and build.
Follow the installation guide for helps on compilation and installation.

Quick install

Clone the repository and update the submodules

git clone [email protected]:clEsperanto/CLIc_prototype.git CLIc
cd CLIc && git submodule update --init --recursive

Create a build folder and configure cmake to generate the adapted makefile. Then compile the library and install it at specified location on your system.

cmake -S . -B ./build -D CMAKE_INSTALL_PREFIX=/path/to/installation/folder
cmake --build ./build --parallel 10 --target install

You can modify installation location using -D CMAKE_INSTALL_PREFIX=/path/to/installation/folder.

CLIc can be uninstall by running the following command

cmake --build ./build --target uninstall

Kernels

CLIc filters rely on the clEsperanto branch of CLIj OpenCL kernels.

Feedback welcome!

clEsperanto is developed in the open because we believe in the open source community. Feel free to drop feedback as github issue or via image.sc.

Packages

No packages published

Languages

  • C++ 91.9%
  • CMake 7.5%
  • Python 0.6%