Vector Optimized Library of Kernels 3.1.0
Architecture-tuned implementations of math kernels
volk_32f_x2_pow_32f

Overview

Raises the sample in aVector to the power of the number in bVector.

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

Note that the aVector values must be positive; otherwise the output may be inaccurate.

Dispatcher Prototype

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

Inputs

  • bVector: The input vector of indices (power values).
  • aVector: The input vector of base values.
  • num_points: The number of values in both input vectors.

Outputs

  • cVector: The output vector.

Example Calculate the first two powers of two (2^x).

int N = 10;
unsigned int alignment = volk_get_alignment();
float* increasing = (float*)volk_malloc(sizeof(float)*N, alignment);
float* twos = (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;
twos[ii] = 2.f;
}
volk_32f_x2_pow_32f(out, increasing, twos, N);
for(unsigned int ii = 0; ii < N; ++ii){
printf("out[%u] = %1.2f\n", ii, out[ii]);
}
volk_free(increasing);
volk_free(twos);
volk_free(out);