axze-az / cftal

a template based C++ short vector library with vectorized faithfully rounded elementary functions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cftal

A c++-20 template based short vector library with faithfully rounded elementary functions.

Description

Cftal is a c++-20 template based short vector library with specializations using intrinsic functions. Part of the library are vectorized elementary and special functions (erf, erfc, tgamma, lgamma, j0, y0, j1 and y1) in single and double precision. Vectorized half precision functions are work in progress. The elementary functions are faithfully rounded.

Specializations for x86 processors with instructions set extensions up to AVX2 are implemented and tested. The specializations for processors with AVX512 extensions are not tested yet.

Getting Started

Dependencies

  • the reproduction of the used constants in the code requires sollya (https://www.sollya.org), libsollya-dev to build extensions to sollya and the maxima (https://maxima.sourceforge.io) computer algebra system
  • the test code uses mpfr (https://www.mpfr.org) and requires libmpfr-dev to compile the programs testing the precision (and speed) of the vectorized elementary and special functions
  • the documentation in the doc directory requires pdflatex
  • only linux as build system was tested and
  • gcc or clang are the only compilers are used to date

Configuration

create a build directory in the root directory of the project, configure and build

  1. mkdir build
  2. cd build
  3. CC=clang-16 CXX=clang++-16 cmake -DCMAKE_BUILD_TYPE=release ..

You may also use gcc instead of clang:

  1. CC=gcc-13 CXX=g++-13 cmake -DCMAKE_BUILD_TYPE=release ..

If you want to use vectors of double's for the calculation of some elementary float functions, use -DCFTAL_CONFIG_USE_VF64_FOR_VF32=1 as an additional argument for cmake.

Build and test

During the build a number of test programs are built in ./test and a pdf is created in ./doc containing some documentation.

License

This project is licensed under the LGPL v2.1License.

About

a template based C++ short vector library with vectorized faithfully rounded elementary functions

License:GNU Lesser General Public License v2.1


Languages

Language:C++ 99.7%Language:C 0.2%Language:CMake 0.1%Language:Shell 0.0%