OpenCL-accelerated 2D convolutions for Rust
This library provides 2D convolutions accelerated with OpenCL. Convolutions are particularly useful for deep learning tasks, such as image recognition; they are a basic building block for convolutional neural networks.
The library is intended mostly for quick-and-dirty hacking in deep learning research, in which one needs a separate spatial convolution primitive. Note that full-scale DL frameworks (TensorFlow, PyTorch, etc.) will most probably be a more robust and scalable tool for more high-level tasks.
Usage
See crate docs for the examples of usage.
Installing OpenCL
OpenCL has a variety of implementations. For quick testing, one may use POCL; it is open source and not tied to hardware (at the cost of being CPU-based, i.e., orders of magnitude slower than OpenCL implementations by GPU vendors). POCL may be installed from sources with the commands like these (showcased here for Ubuntu Bionic):
# Install utils for build
# Install OpenCL-related utils
# Install LLVM / Clang from the official APT repository
|
# Get POCL sources
# latest stable version
# Build POCL from the sources
&&
# Verify installation
# If successful, `clinfo` should display information about the POCL platform.
License
Licensed under the Apache 2.0 license.