Skip to content

clEsperanto/CLIc

CLIc

Build OpenCL Build CUDA Build Metal CI-Tests Codecov License GitHub release (latest by date including pre-releases) DOI

CLIc is a backend library for clEsperanto - a multi-language framework for GPU-accelerated image processing. It relies on OpenCL kernels originally developped for CLIJ and can run on OpenCL, CUDA, or Metal.

The library is used for various user-oriented API libraries:

Documentation

A detail documentation of the library, installation, and API is available. If any information is missing, is incorrect, or you are facing any kind of difficulties, do not hesitate to raise an issue.

Usage example

#include "clesperanto.h"  // CLIc include

int main( int argc, char** argv)
{
    // Initialisation of clEsperanto with default device
    cle::BackendManager::getInstance().setBackend("opencl");
    auto device = cle::BackendManager::getInstance().getBackend().getDevice("", "gpu");

    // host vector to hold input and output
    std::vector<float> input (width * height * depth);
    std::vector<float> output (input.size());

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

    // push data from host to device
    auto gpu_src = cle::Push<float>(input.data(), width, height, depth, device);
    // apply filter with parameters
    auto gpu_dst = cle::tier1::AddImageAndScalar(device, gpu_src, nullptr, 10);
    // pull output from device to host
    cle::Pull<float>(gpu_dst, output.data());

    return EXIT_SUCCESS;
}

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

Feedback & Contribution

clEsperanto is developed in the open because we believe in the open source community. Feedback and contributions, of any kind, are very much welcome. Do not hesitate to contact us via github issue or image.sc. And if you liked our work, star the repository, share it with your friends, and use it to make cool stuff!

Acknowledgements

We acknowledge support by the Deutsche Forschungsgemeinschaft under Germany’s Excellence Strategy (EXC2068) Cluster of Excellence Physics of Life of TU Dresden and by the Institut Pasteur, Paris. This project has been made possible in part by grant number 2021-237734 (GPU-accelerating Fiji and friends using distributed CLIJ, NEUBIAS-style, EOSS4) from the Chan Zuckerberg Initiative DAF, an advised fund of the Silicon Valley Community Foundation, and by support from the French National Research Agency via the France BioImaging research infrastructure (ANR-24-INBS-0005 FBI BIOGEN).