Expand description
The universal compiler invocation library for Rust-CXX-CUDA interoperation and dependency management.
This crate serves as a universal bridge between Rust code and heterogeneous C++/CUDA/.. codes. It does the following work:
-
Manages and exports/imports the C++ headers between crates, through
export_csrc
. This feature makes use of the Cargo dependency management framework to conveniently manage C++/CUDA code dependencies. -
Compile C++(OpenMP)/CUDA sources with out-of-the-box compilation settings and common platform detections.
-
Generates bindings of C++/CUDA host functions making use of
ulib::UVec
, through [bindgen
].
Functions
- Generate universal bindings for
export "C"
functions inside a specified c++/cuda source, and write that binding to a Rust source underOUT_DIR/uccbind
. - This exports the
csrc
directory to the environment variable, so that it can be found and included by crates that depend on the current crate. - This imports the
csrc
directory of all direct dependency crates that were exported usingexport_csrc
, save their files in a temp dir insideOUT_DIR
, and return the path of that dir. If that dir is used as include search path, you can then use#include <crates/{crate name}/xxx.hpp>
to include thecsrc/xxx.hpp
file in the dependency.