C / C ++ library for lazy evaluation of SIMD / SSE expressions

Libraries such as intel- MKL or amd- ACML provide a more convenient interface for SIMD operations on vectors, but I want to combine several functions together. Are there any libraries available where I can register a parsing tree for an expression like

 log( tanh(x) + exp(x) ) 

and then evaluate it on all elements of the array? I want to avoid the temporary arrays tanh(x) , exp(x) and tanh(x) + exp(x) by calling the mkl or acml functions for tanh() , exp() and + .

I can deploy the loop manually and use the sse instructions directly, but wondered if there are C ++ libraries that do this for you, i.e.

 1. Handles SIMD/SSE functions 2. Allows building of parse trees out of SIMD/SSE functions. 

I am very new and have never used SSE or MKL / ACML before, just entering a new territory.

+4
source share
2 answers

It may not do exactly what you want, but I suggest you take a look at macstl . This is a SIMD valarray implementation that uses template metaprogramming and which can combine expressions in a single loop. You can use this as is, or perhaps as the basis for something closer to what you need.

+2
source

Take a look at Intel ABB . It uses the IIRC temporary assembly approach. It can use vector instructions and multithreading depending on the size of the vectors you are affecting.

+1
source

All Articles