A Neural Network Toolkit.
- Dynamic and incremental graph construction (a.k.a. "define-by-run" style)
- On-demand memory allocation
- Automatic minibatch broadcasting
- Mostly device-independent
- Simple usage
This repository contains only the core C++ library of primitiv. Some bindings for other programming languages (e.g., Python) can be found in the official repository.
- CMake 3.1.0 or later
- C++11 compiler (GCC, Clang)
- (optional) Google Test
- Required only when
-DPRIMITIV_BUILD_TESTS=ON
.
- Required only when
- (optional) CUDA 7.5 or later
- Required only when
-DPRIMITIV_USE_CUDA=ON
- Required only when
- (optional) OpenCL 1.2/OpenCL C++ binding v2
- Required only when
-DPRIMITIV_USE_OPENCL=ON
- Required only when
git clone <this repository>
cd primitiv
mkdir build
cd build
cmake .. [-D(Options you need)]
make [-j <threads>]
[make test]
[make install]
PRIMITIV_BUILD_STATIC_LIBRARY
(default=OFF
)- Builds a static library instead of a shared object.
PRIMITIV_BUILD_TESTS
(default=OFF
)- Builds test binaries and generates
make test
command.
- Builds test binaries and generates
PRIMITIV_BUILD_TESTS_PROBABILISTIC
(default=OFF
)- Builds test cases that probabilistically fails.
PRIMITIV_GTEST_SOURCE_DIR
(default=""
)- Specifies the source directory of Google Test. If you want to use
googletest
module provided from Debian/Ubuntu repository, add-DPRIMITIV_GTEST_SOURCE_DIR=/usr/src/googletest/googletest
together with-PRIMITIV_BUILD_TESTS=ON
option.
- Specifies the source directory of Google Test. If you want to use
PRIMITIV_USE_CACHE
(default=OFF
)- Whether or not to use cached values to prevent increasing computation amount.
- Libraries built with this flag will tend to consume more memory.
PRIMITIV_USE_CUDA
(default=OFF
)- Enables CUDA backend (
devices::CUDA
class).
- Enables CUDA backend (
PRIMITIV_USE_OPENCL
(default=OFF
)- Enables OpenCL backend(
devices::OpenCL
class).
- Enables OpenCL backend(
- Other available options:
- CMake standard options.
- FindGTest options.
- FindCUDA options.
- FindOpenCL options.