Skip to content

Example extension for initializing Bigarray types that are allocated on cache lines

License

Notifications You must be signed in to change notification settings

ColinShaw/ocaml-cache-aligned-bigarray

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

OCaml Cache-Aligned Bigarray

The stock OCaml Bigarray, presumably for portability reasons, does not cache-align. That is to say, it uses malloc(). At the expense of a little memory, we can eek out a little more performance for numerical operations by cache-aligning the Bigarray.

This is an example replacement for Bigarray using cache-aligned allocation. It is not intended to fully support Bigarray for all types, both C and FORTRAN layouts, or for multiple dimensions. My application was pretty specific on types; you will get the idea quickly reading through the code and can expand it easily to suit. You will have to know your hardware and set the cache line size accordingly.

About

Example extension for initializing Bigarray types that are allocated on cache lines

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published