Crate ispc_compile
source ·Expand description
A small library meant to be used as a build dependency with Cargo for easily
integrating ISPC code into Rust projects. The
ispc_compile
crate provides functionality to use the ISPC compiler
from your build script to build your ISPC code into a library,
and generate Rust bindings to this library. The ispc_rt
crate is
still required at runtime to provide a macro to import the generated
bindings, along with the task system and performance instrumentation system.
Requirements for Compiling ISPC Code
Both the ISPC compiler and libclang
(for rust-bindgen) must be available in your path
to compile the ISPC code and generate the bindings. These are not required if using ispc_rt
to link against a previously compiled library.
Windows Users
You’ll need Visual Studio and will have to use the MSVC ABI version of Rust since ISPC
and Clang link with MSVC on Windows. For bindgen to find libclang you’ll need to copy
libclang.lib
to clang.lib
and place it in your path.
Re-exports
pub use crate::opt::Addressing;
pub use crate::opt::Architecture;
pub use crate::opt::MathLib;
pub use crate::opt::OptimizationOpt;
pub use crate::opt::TargetISA;
pub use crate::opt::TargetOS;
pub use crate::opt::CPU;
pub use bindgen;
Modules
- This module has various option flags and configs we can pass to ISPC, located here for convience and clutter reduction.
Structs
- Extra configuration to be passed to ISPC
Functions
- Compile the list of ISPC files into a static library and generate bindings using bindgen. The library name should not contain a lib prefix or a lib extension like ‘.a’ or ‘.lib’, the appropriate prefix and suffix will be added based on the compilation target.