MCPcopy Index your code
hub / github.com/autumnai/rust-cublas

github.com/autumnai/rust-cublas @0.1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.1.0 ↗ · + Follow
93 symbols 203 edges 13 files 19 documented · 20%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

rust-cuBLAS • Join the chat at https://gitter.im/autumnai/collenchyma Build Status Coverage Status Crates.io License

rust-cuBLAS provides safe wrapper for CUDA's cuBLAS library, so you can use it comfortably and safely in your Rust application.

As cuBLAS currently relies on CUDA to allocate memory on the GPU, you might also look into rust-cuda.

rust-cublas was developed at Autumn for the Rust Machine Intelligence Framework Leaf.

rust-cublas is part of the High-Performance Computation Framework Collenchyma, for the BLAS Plugin. For an easy, unified interface for BLAS operations, such as those provided by cuBLAS, you might check out Collenchyma.

For more information,

Getting Started

If you're using Cargo, just add rust-cuBLAS to your Cargo.toml:

[dependencies]
cublas = "0.1.0"

If you're using Cargo Edit, you can call:

$ cargo add cublas

Building

rust-cublas depends on the cuBLAS runtime libraries, which can be obtained from NVIDIA.

Manual Configuration

rust-cublas's build script will by default attempt to locate cublas via pkg-config. This will not work in some situations, for example, * on systems that don't have pkg-config, * when cross compiling, or * when cuBLAS is not installed in the default system library directory (e.g. /usr/lib).

Therefore the build script can be configured by exporting the following environment variables:

  • CUBLAS_LIB_DIR

If specified, a directory that will be used to find cuBLAS runtime libraries. e.g. /opt/cuda/lib

  • CUBLAS_STATIC

If specified, cuBLAS libraries will be statically rather than dynamically linked.

  • CUBLAS_LIBS

If specified, will be used to find cuBLAS libraries under a different name.

If either CUBLAS_LIB_DIR or CUBLAS_INCLUDE_DIR are specified, then the build script will skip the pkg-config step.

If your also need to run the compiled binaries yourself, make sure that they are available:

# Linux; for other platforms consult the instructions that come with cuBLAS
cd <cublas_installpath>
export LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH

Contributing

Want to contribute? Awesome! We have instructions to help you get started contributing code or documentation.

We have a mostly real-time collaboration culture and happens here on Github and on the Collenchyma Gitter Channel. You can also reach out to the Maintainers {@MJ, @hobofan}.

License

Licensed under either of

  • Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
  • MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Core symbols most depended-on inside this repo

id_c
called by 45
cublas/src/api/context.rs
filled_tensor
called by 13
cublas/src/api/level1.rs
set_pointer_mode
called by 8
cublas/src/api/util.rs
get_native_backend
called by 7
cublas/src/api/level1.rs
get_cuda_backend
called by 7
cublas/src/api/level1.rs
write_to_memory
called by 3
cublas/src/api/level3.rs
as_c
called by 3
cublas/src/api/enums.rs
pointer_mode
called by 3
cublas/src/api/context.rs

Shape

Method 39
Enum 23
Function 23
Class 8

Languages

Rust100%

Modules by API surface

cublas/src/api/level1.rs25 symbols
cublas-sys/src/generated.rs15 symbols
cublas/src/api/util.rs11 symbols
cublas/src/api/context.rs10 symbols
cublas-sys/template/generated.gen.rs9 symbols
cublas/src/api/level3.rs7 symbols
cublas-sys/template/generated.header.rs6 symbols
cublas/src/error.rs4 symbols
cublas/src/api/enums.rs4 symbols
cublas/src/lib.rs1 symbols
cublas-sys/build.rs1 symbols

For agents

$ claude mcp add rust-cublas \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact