This repo provides code that calculates pairwise matrix distances for dense and sparse matrices.
- R 4.3.0+
- CMake 3.10+
- (Optional) CUDA 11+
Please, install NVIDIA Container Toolkit first.
docker run --name gades --gpus all -it akhtyamovpavel/gades-gpugit clone https://github.com/lab-medvedeva/GADES-main.git
cd GADES-main
Rscript install.RThis command builds code of the library using CMake, checks GPU and install package using CPU+GPU or only CPU code.
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug ..
makemtrx.so file will be appeared in the root folder.
library(GADES)
mtx <- matrix(runif(100000), nrow=100)
dist.matrix <- mtrx_distance(mtx, batch_size = 5000, metric = 'kendall', type='gpu', sparse=F, write=T)library(GADES)
library(Matrix)
mtx <- rsparsematrix(nrow=100, ncol=1000, density=0.1)
dist.matrix <- mtrx_distance(mtx, batch_size = 5000, metric = 'kendall', type='cpu', sparse=T, write=T)library(GADES)
library(Matrix)
mtx <- rsparsematrix(nrow=100, ncol=1000, density=0.1)
dist.matrix <- mtrx_distance(mtx, batch_size = 5000, metric = 'kendall', type='gpu', sparse=T, write=T)