Software for computing the Canonical Polyadic Decomposition (CPD), also known as PARAllel FACtors (PARAFAC), using the Concurrent Alternating Least Squares Algorithm (CALS).
- CMake 3.17.5 or higher.
A bash script is provided, to help install CMake 3.17.5 (for Linux) in the
externfolder and updates thePATHenvironment variable to point to it. Try using it by navigating to the directory where you cloned CALS and running:source scripts/environment_setup.sh. Then, using the same terminal session, runningcmake --versionshould return version 3.17.5. - OpenMP
- BLAS/LAPACK (not required for MATLAB MEX generation). Either of the following libraries has been tested to work:
- Intel MKL
- OpenBLAS
- CUDA 11
- MATLAB 2019b
CALS has been tested to compile with g++-8, g++-10 and clang-10.
Clone the CP-CALS repo using:
git clone https://github.com/HPAC/CP-CALS.gitUse the following commands to compile the MKL version.
cd CP-CALS/build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DWITH_MKL=ON ..
make -j 8 allor the following commands to compile the OpenBLAS version.
cd CP-CALS/build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DWITH_OPENBLAS=ON ..
make -j 8 allUse the following commands to compile the MKL version with CUDA enabled.
cd CP-CALS/build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DWITH_MKL=ON \
-DWITH_CUBLAS=ON ..
make -j 8 allTo compile the MEX files for Matlab use:
cd CP-CALS/build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DWITH_MATLAB=ON \
-DMATLAB_PATH=/path/to/Matlab ..
make -j 8 allsrc/examples/driver contains a demonstration of how to use CALS (The -h flag is supported for a look at possible input arguments).
After compiling the MATLAB MEX, one can execute file matlab/matlab_src/TTB_vs_CALS.m in MATLAB. This executable performs a comparisson of TensorToolbox and CALS. The user first needs to point MATLAB to the CALS MEX and the Tensor Toolbox source code by editing the first two lines of the file.