Add Fastor library

This commit is contained in:
Bassem Girgis
2025-03-22 01:17:52 -05:00
parent 5546e086f6
commit 4dd5939693
132 changed files with 55086 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
#ifndef INNER_H_
#define INNER_H_
#include "Fastor/meta/meta.h"
#include "Fastor/backend/doublecontract.h"
namespace Fastor {
/* The dependency on doublecontract here is on purpose
as it creates a necessary layer of indirection to avoid
the case where M == 0
*/
template<typename T, size_t M,
enable_if_t_<is_greater_v_<M,0>, bool> = false>
FASTOR_INLINE T _inner(const T* FASTOR_RESTRICT a, const T* FASTOR_RESTRICT b) {
return _doublecontract<T,M,1>(a,b);
}
template<typename T, size_t M,
enable_if_t_<M==0, bool> = false>
FASTOR_INLINE T _inner(const T* FASTOR_RESTRICT a, const T* FASTOR_RESTRICT b) {
return (*a)*(*b);
}
} // end of namespace Fastor
#endif // INNER_H_