Table of Contents
Fetching ...

AVX / NEON Intrinsic Functions: When Should They Be Used?

Théo Boivin, Joeffrey Legaux

Abstract

A cross-configuration benchmark is proposed to explore the capacities and limitations of AVX / NEON intrinsic functions in a generic context of development project, when a vectorisation strategy is required to optimise the code. The main aim is to guide developers to choose when using intrinsic functions, depending on the OS, architecture and/or available compiler. Intrinsic functions were observed highly efficient in conditional branching, with intrinsic version execution time reaching around 5% of plain code execution time. However, intrinsic functions were observed as unnecessary in many cases, as the compilers already well auto-vectorise the code.

AVX / NEON Intrinsic Functions: When Should They Be Used?

Abstract

A cross-configuration benchmark is proposed to explore the capacities and limitations of AVX / NEON intrinsic functions in a generic context of development project, when a vectorisation strategy is required to optimise the code. The main aim is to guide developers to choose when using intrinsic functions, depending on the OS, architecture and/or available compiler. Intrinsic functions were observed highly efficient in conditional branching, with intrinsic version execution time reaching around 5% of plain code execution time. However, intrinsic functions were observed as unnecessary in many cases, as the compilers already well auto-vectorise the code.
Paper Structure (10 sections, 2 equations, 3 figures, 1 table)

This paper contains 10 sections, 2 equations, 3 figures, 1 table.

Figures (3)

  • Figure 1: Benchmarking results --- Execution time ratio, based on \ref{['equ:execution-time-ratio']}, as a function of configuration and optimisation level. Standard deviation is based on \ref{['equ:standard-deviation-execution-time-ratio']}. Each graph corresponds to a scenario (see \ref{['list:plain-scenarios']} for details), whose index is indicated in the top right corner.
  • Figure 2: Benchmarking results --- Execution times ($\Delta T_P$ and $\Delta T_I$) as a function of configuration, for most aggressive optimisation (O2 for MSVC++ and O3 for other compilers). Standard deviation is the sample uncertainty (fifty runs). Each graph corresponds to a scenario (see \ref{['list:plain-scenarios']} for scenarios details), whose index is indicated on the top right corner. Background areas distinguish each device (Linux, macOS or Windows) from one another.
  • Figure 3: Flowchart for choice of intrinsics use, deduced from benchmark results. The use of intrinsics is supposed available in the development context (in terms of readability and maintainability). The objective of such a routine is to optimise final performance, so by setting the optimisation level to most aggressive (O2 for MSVC++ and O3 for other compilers).