Om  1.0.0
A universal framework for multimedia simulation
Public Types | Public Member Functions | Static Public Member Functions | List of all members
om::math::SIMDFlags Class Reference

A class that contains flags that specify the type of SIMD operations supported. More...

#include <omSIMDFlags.h>

Public Types

enum  Flag {
  SSE = (1 << 0), SSE_2 = (1 << 1), SSE_3 = (1 << 2), SSSE_3 = (1 << 3),
  SSE_4_1 = (1 << 4), SSE_4_2 = (1 << 5), SSE_4 = SSE_4_1 | SSE_4_2, AVX = (1 << 6),
  AVX_2 = (1 << 7), AVX_512F = (1 << 8), AVX_512PF = (1 << 9), AVX_512ER = (1 << 10),
  AVX_512CD = (1 << 11), ARM_NEON = (1 << 30), ALTIVEC = (1 << 31), UNDEFINED = 0
}
 An enum that specifies the different SIMD flags specifing the CPU capabilities. More...
 

Public Member Functions

 SIMDFlags ()
 Create a new SIMD flags object with no flags set. More...
 
 SIMDFlags (Flag flag)
 Create a new SIMD flags object with the specified flag value initially set. More...
 
 SIMDFlags (UInt32 newFlags)
 Create a new SIMD flags object with the specified initial combined flags value. More...
 
 operator UInt32 () const
 Convert this flags object to an integer value. More...
 
Bool isSet (Flag flag) const
 Return whether or not the specified flag value is set for this flags object. More...
 
void set (Flag flag, Bool newIsSet)
 Set whether or not the specified flag value is set for this flags object. More...
 

Static Public Member Functions

static SIMDFlags get ()
 Return an object containing the SIMD flags for the current CPU. More...
 

Detailed Description

A class that contains flags that specify the type of SIMD operations supported.

These flags allow the user to determine at runtime the capabilities of the CPU, and to then choose one code path or another based on the result.

Member Enumeration Documentation

An enum that specifies the different SIMD flags specifing the CPU capabilities.

Enumerator
SSE 

A flag indicating that SSE is supported by the CPU.

SSE_2 

A flag indicating that SSE2 is supported by the CPU.

SSE_3 

A flag indicating that SSE3 is supported by the CPU.

SSSE_3 

A flag indicating that SSSE3 is supported by the CPU.

SSE_4_1 

A flag indicating that SSE 4.1 is supported by the CPU.

SSE_4_2 

A flag indicating that SSE 4.2 is supported by the CPU.

SSE_4 

A flag indicating that SSE 4.1 and SSE 4.2 is supported by the CPU.

AVX 

A flag indicating that AVX is supported by the CPU.

AVX_2 

A flag indicating that AVX2 is supported by the CPU.

AVX_512F 

A flag indicating that AVX-512F is supported by the CPU.

AVX_512PF 

A flag indicating that AVX-512PF is supported by the CPU.

AVX_512ER 

A flag indicating that AVX-512ER is supported by the CPU.

AVX_512CD 

A flag indicating that AVX-512CD is supported by the CPU.

ARM_NEON 

A flag indicating that the ARM NEON SIMD is supported by the CPU.

ALTIVEC 

A flag indicating that Altivec is supported by the CPU.

UNDEFINED 

The flag value when no flags are set.

Constructor & Destructor Documentation

om::math::SIMDFlags::SIMDFlags ( )
inline

Create a new SIMD flags object with no flags set.

om::math::SIMDFlags::SIMDFlags ( Flag  flag)
inline

Create a new SIMD flags object with the specified flag value initially set.

om::math::SIMDFlags::SIMDFlags ( UInt32  newFlags)
inline

Create a new SIMD flags object with the specified initial combined flags value.

Member Function Documentation

om::math::SIMDFlags::operator UInt32 ( ) const
inline

Convert this flags object to an integer value.

This operator is provided so that the object can be used as an integer value for bitwise logical operations.

Bool om::math::SIMDFlags::isSet ( Flag  flag) const
inline

Return whether or not the specified flag value is set for this flags object.

void om::math::SIMDFlags::set ( Flag  flag,
Bool  newIsSet 
)
inline

Set whether or not the specified flag value is set for this flags object.

static SIMDFlags om::math::SIMDFlags::get ( )
static

Return an object containing the SIMD flags for the current CPU.


The documentation for this class was generated from the following file: