Vector Optimized Library of Kernels  1.4
Architecture-tuned implementations of math kernels
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages

Overview

Selects maximum value from each entry between bVector and aVector and store their results in the cVector.

c[i] = max(a[i], b[i])

Dispatcher Prototype

void volk_32f_x2_max_32f(float* cVector, const float* aVector, const float* bVector, unsigned int num_points)

Inputs

  • aVector: First input vector.
  • bVector: Second input vector.
  • num_points: The number of values in both input vectors.

Outputs

  • cVector: The output vector.

Example

int N = 10;
unsigned int alignment = volk_get_alignment();
float* increasing = (float*)volk_malloc(sizeof(float)*N, alignment);
float* decreasing = (float*)volk_malloc(sizeof(float)*N, alignment);
float* out = (float*)volk_malloc(sizeof(float)*N, alignment);
for(unsigned int ii = 0; ii < N; ++ii){
increasing[ii] = (float)ii;
decreasing[ii] = 10.f - (float)ii;
}
volk_32f_x2_max_32f(out, increasing, decreasing, N);
for(unsigned int ii = 0; ii < N; ++ii){
printf("out[%u] = %1.2f\n", ii, out[ii]);
}
volk_free(increasing);
volk_free(decreasing);
volk_free(out);