Module unsafe_optimizations

Module unsafe_optimizations 

Source
Expand description

Performance-critical unsafe optimizations

This module contains unsafe code for performance-critical paths in kernel approximation. All unsafe code is carefully reviewed and documented.

§Safety

All functions in this module that use unsafe code have detailed safety documentation explaining the invariants that must be upheld.

Functions§

batch_rbf_kernel_fast
Batch RBF kernel computation with unsafe optimizations
dot_product_unrolled
Unsafe dot product with manual loop unrolling
elementwise_op_fast
Fast element-wise operations with unrolled loops
fast_cosine_features
Fast cosine features computation for Random Fourier Features
matvec_multiply_fast
Fast matrix-vector multiplication using unsafe optimizations
rbf_kernel_fast
Fast exponential computation for RBF kernels
safe_dot_product
Safe wrapper for dot product with bounds checking
safe_matvec_multiply
Safe wrapper for matrix-vector multiplication