Crates.io | RayBNN_Sparse |
lib.rs | RayBNN_Sparse |
version | 2.0.2 |
source | src |
created_at | 2023-09-05 23:38:25.455112 |
updated_at | 2024-06-18 05:49:51.73534 |
description | Sparse Matrix Library for GPUs, CPUs, and FPGAs via CUDA, OpenCL, and oneAPI |
homepage | |
repository | https://github.com/BrosnanYuen/RayBNN_Sparse |
max_upload_size | |
id | 964919 |
size | 129,654 |
Sparse Matrix Library for GPUs, CPUs, and FPGAs via CUDA, OpenCL, and oneAPI
Supports CSR, COO, CSC, and block sparse matrices
Requires Arrayfire and Arrayfire Rust
Supports f16, f32, f64, Complexf16, Complexf32, Complexf64
Install the Arrayfire 3.9.0 binaries at https://arrayfire.com/binaries/
or build from source https://github.com/arrayfire/arrayfire/wiki/Getting-ArrayFire
arrayfire = { version = "3.8.1", package = "arrayfire_fork" }
num = "0.4.1"
num-traits = "0.2.16"
half = { version = "2.3.1" , features = ["num-traits"] }
RayBNN_Sparse = "2.0.2"
let mut WRowIdxCSR = RayBNN_Sparse::Util::Convert::COO_to_CSR(&WRowIdxCOO,7);
let mut WRowIdxCOO = RayBNN_Sparse::Util::Convert::CSR_to_COO(&WRowIdxCSR);
let valsel = RayBNN_Sparse::Util::Search::COO_find(&WRowIdxCOO,&idxsel);
let valsel = RayBNN_Sparse::Util::Search::COO_batch_find(&WRowIdxCOO,&idxsel,4);
let global_idx = RayBNN_Sparse::Util::Convert::get_global_weight_idx(
2000,
&WRowIdxCOO,
&WColIdx
);
let global_idx = RayBNN_Sparse::Util::Convert::get_global_weight_idx2(
2000,
&WRowIdxCOO,
&WColIdx
);
RayBNN_Sparse::Util::Remove::clear_input::<f32>(
&mut WValues,
&mut WRowIdxCOO,
&mut WColIdx,
3
);
RayBNN_Sparse::Util::Remove::clear_output::<f32>(
&mut WValues,
&mut WRowIdxCOO,
&mut WColIdx,
7-2
);
RayBNN_Sparse::Util::Remove::clear_input_to_hidden::<f64>(
&mut WValues,
&mut WRowIdxCOO,
&mut WColIdx,
3
);
RayBNN_Sparse::Util::Remove::delete_smallest_weights::<f32>(
&mut WValues,
&mut WRowIdxCOO,
&mut WColIdx,
3
);
RayBNN_Sparse::Util::Remove::delete_weights_with_prob::<f64>(
&mut WValues,
&mut WRowIdxCOO,
&mut WColIdx,
3
);
let valsel = RayBNN_Sparse::Util::Convert::remap_rows(&dictionary, &idx,1000);
RayBNN_Sparse::Matrix::Block::matmul::<f64>(
&input_start,
&input_end,
&block_start,
&block_end,
&input,
&block
);
RayBNN_Sparse::Matrix::Block::trans_matmul::<f64>(
&input_start,
&input_end,
&block_start,
&block_end,
&input,
&block
);
let result = RayBNN_Sparse::Util::Search::parallel_lookup(
0,
1,
&idx_arr,
&test_arr,
);