← All compilation units

Flyology_SIMD.Algorithms.Runtime

Description

Complete-array and complete-buffer algorithms with one coarse runtime backend selection.

Add_Saturate

procedure Add_Saturate
  (Data : in out Byte_Array; Value : U8; Backend : Features.Backend_Kind := Features.Best_Available)

Add one byte to every element with unsigned saturation after one runtime backend selection.

Parameters
Data

The complete byte buffer to transform in place.

Value

The unsigned byte addend broadcast to every element.

Backend

The compiled and available backend to use.

AXPY

procedure AXPY
  (Y       : in out F32_Array;
   A       : F32;
   X       : F32_Array;
   Backend : Features.Backend_Kind := Features.Best_Available)

Replace each Y element with A * X + Y after one runtime backend selection. Multiplication and addition are separate operations.

Parameters
Y

The complete destination and addend array.

A

The scalar multiplier applied to X.

X

The complete source array with bounds matching Y.

Backend

The compiled and available backend to use.

AXPY

procedure AXPY
  (Y       : in out F64_Array;
   A       : F64;
   X       : F64_Array;
   Backend : Features.Backend_Kind := Features.Best_Available)

Replace each Y element with A * X + Y after one runtime backend selection. Multiplication and addition are separate operations.

Parameters
Y

The complete destination and addend array.

A

The scalar multiplier applied to X.

X

The complete source array with bounds matching Y.

Backend

The compiled and available backend to use.

Clamp

procedure Clamp
  (Data : in out F32_Array; Low, High : F32; Backend : Features.Backend_Kind := Features.Best_Available)

Replace each element with Min_Number (Max_Number (Element, Low), High) after one runtime backend selection.

Parameters
Data

The complete array to transform in place.

Low

The lower operand supplied to Max_Number.

High

The upper operand supplied to Min_Number.

Backend

The compiled and available backend to use.

Clamp

procedure Clamp
  (Data : in out F64_Array; Low, High : F64; Backend : Features.Backend_Kind := Features.Best_Available)

Replace each element with Min_Number (Max_Number (Element, Low), High) after one runtime backend selection.

Parameters
Data

The complete array to transform in place.

Low

The lower operand supplied to Max_Number.

High

The upper operand supplied to Min_Number.

Backend

The compiled and available backend to use.

Count

function Count
  (Data : Byte_Array; Needle : U8; Backend : Features.Backend_Kind := Features.Best_Available)
   return Natural

Count one byte after one runtime backend selection.

Parameters
Data

The complete byte array to scan.

Needle

The byte to count.

Backend

The compiled and available backend to use.

Return value

The number of matching elements.

Count_In_Range

function Count_In_Range
  (Data : Byte_Array; Low, High : U8; Backend : Features.Backend_Kind := Features.Best_Available)
   return Natural

Count bytes in an inclusive unsigned interval after one runtime backend selection. An inverted interval is empty.

Parameters
Data

The complete byte array to scan.

Low

The inclusive lower byte bound.

High

The inclusive upper byte bound.

Backend

The compiled and available backend to use.

Return value

The number of elements in the interval.

Dot_Product

function Dot_Product
  (Left, Right : F32_Array; Backend : Features.Backend_Kind := Features.Best_Available) return F32

Multiply and add corresponding binary32 elements after one runtime backend selection. Use the four-group accumulation order from Generic_Floating.Dot_Product.

Parameters
Left

The left complete array.

Right

The right complete array with matching bounds.

Backend

The compiled and available backend to use.

Return value

The lane-grouped sum of corresponding products.

Dot_Product

function Dot_Product
  (Left, Right : F64_Array; Backend : Features.Backend_Kind := Features.Best_Available) return F64

Multiply and add corresponding binary64 elements after one runtime backend selection. Use the two-group accumulation order from Generic_Floating.Dot_Product.

Parameters
Left

The left complete array.

Right

The right complete array with matching bounds.

Backend

The compiled and available backend to use.

Return value

The lane-grouped sum of corresponding products.

Equal

function Equal
  (Left, Right : Byte_Array; Backend : Features.Backend_Kind := Features.Best_Available) return Boolean

Compare two complete byte buffers after one runtime backend selection.

Parameters
Left

The left complete byte array.

Right

The right complete byte array with matching bounds.

Backend

The compiled and available backend to use.

Return value

True when every corresponding byte is equal.

Find_First

function Find_First
  (Data : Byte_Array; Needle : U8; Backend : Features.Backend_Kind := Features.Best_Available)
   return Search_Result

Find one byte after one runtime backend selection.

Parameters
Data

The complete byte array to search.

Needle

The byte to find.

Backend

The compiled and available backend to use.

Return value

A found flag and the first matching Ada index.

Find_First_Difference

function Find_First_Difference
  (Left, Right : Byte_Array; Backend : Features.Backend_Kind := Features.Best_Available)
   return Search_Result

Find the first differing byte after one runtime backend selection.

Parameters
Left

The left complete byte array.

Right

The right complete byte array with matching bounds.

Backend

The compiled and available backend to use.

Return value

A found flag and the first differing Ada index.

Find_First_Of

function Find_First_Of
  (Data : Byte_Array; Needles : Byte_Array; Backend : Features.Backend_Kind := Features.Best_Available)
   return Search_Result

Find the first byte equal to any member of a small set after one runtime backend selection. Empty inputs have no match and duplicates have no effect.

Parameters
Data

The complete byte array to search.

Needles

The byte values that constitute the small set.

Backend

The compiled and available backend to use.

Return value

A found flag and the first matching Ada index.

Is_ASCII

function Is_ASCII
  (Data : Byte_Array; Backend : Features.Backend_Kind := Features.Best_Available) return Boolean

Validate ASCII after one runtime backend selection.

Parameters
Data

The complete byte array to validate.

Backend

The compiled and available backend to use.

Return value

True when every byte is less than 128.

Max_Number

function Max_Number
  (Data : F32_Array; Backend : Features.Backend_Kind := Features.Best_Available) return F32

Return the number maximum of a nonempty binary32 array after one runtime backend selection.

Parameters
Data

The nonempty complete array to reduce.

Backend

The compiled and available backend to use.

Return value

The maximum-number result.

Max_Number

function Max_Number
  (Data : F64_Array; Backend : Features.Backend_Kind := Features.Best_Available) return F64

Return the number maximum of a nonempty binary64 array after one runtime backend selection.

Parameters
Data

The nonempty complete array to reduce.

Backend

The compiled and available backend to use.

Return value

The maximum-number result.

Min_Number

function Min_Number
  (Data : F32_Array; Backend : Features.Backend_Kind := Features.Best_Available) return F32

Return the number minimum of a nonempty binary32 array after one runtime backend selection.

Parameters
Data

The nonempty complete array to reduce.

Backend

The compiled and available backend to use.

Return value

The minimum-number result.

Min_Number

function Min_Number
  (Data : F64_Array; Backend : Features.Backend_Kind := Features.Best_Available) return F64

Return the number minimum of a nonempty binary64 array after one runtime backend selection.

Parameters
Data

The nonempty complete array to reduce.

Backend

The compiled and available backend to use.

Return value

The minimum-number result.

Scale

procedure Scale
  (Data : in out F32_Array; Factor : F32; Backend : Features.Backend_Kind := Features.Best_Available)

Multiply every binary32 element by Factor after one runtime backend selection.

Parameters
Data

The complete array to transform in place.

Factor

The scalar multiplier applied once to every element.

Backend

The compiled and available backend to use.

Scale

procedure Scale
  (Data : in out F64_Array; Factor : F64; Backend : Features.Backend_Kind := Features.Best_Available)

Multiply every binary64 element by Factor after one runtime backend selection.

Parameters
Data

The complete array to transform in place.

Factor

The scalar multiplier applied once to every element.

Backend

The compiled and available backend to use.

Sum

function Sum (Data : F32_Array; Backend : Features.Backend_Kind := Features.Best_Available) return F32

Add all binary32 elements after one runtime backend selection. Use the four-group accumulation order from Generic_Floating.Sum.

Parameters
Data

The complete array to sum.

Backend

The compiled and available backend to use.

Return value

The lane-grouped sum of all elements.

Sum

function Sum (Data : F64_Array; Backend : Features.Backend_Kind := Features.Best_Available) return F64

Add all binary64 elements after one runtime backend selection. Use the two-group accumulation order from Generic_Floating.Sum.

Parameters
Data

The complete array to sum.

Backend

The compiled and available backend to use.

Return value

The lane-grouped sum of all elements.