pub mod bindings;
pub mod memory;
pub mod ops;
pub mod tests;
pub mod types;
#[cfg(target_arch = "wasm32")]
pub use memory::WasmAllocator;
#[cfg(target_arch = "wasm32")]
pub use ops::WasmOpRegistry;
#[cfg(target_arch = "wasm32")]
pub use types::{
WasmContext, WasmContextWithGpu, WasmFeatures, WasmTensorOps, WasmTimer, WasmWebGpuContext,
WebGpuBackend, WebGpuLimits,
};
#[cfg(not(target_arch = "wasm32"))]
pub use types::WasmContext;
pub mod utils {
pub fn is_wasm() -> bool {
cfg!(target_arch = "wasm32")
}
pub fn optimal_chunk_size() -> usize {
if is_wasm() {
1024
} else {
8192
}
}
pub fn recommended_memory_limit() -> usize {
if is_wasm() {
256 * 1024 * 1024 } else {
2 * 1024 * 1024 * 1024 }
}
}