let say I have a vector
Code: Select all
V[v0,v1,v2,...,vN]
I want to convert it to the vector
Code: Select all
e(2*j*PI*V)
Is there anything in MAGMA to address this operation?
Thanks much in advance,
/v
Code: Select all
V[v0,v1,v2,...,vN]
Code: Select all
e(2*j*PI*V)
Code: Select all
#include <magma_v2.h> // for magma_ceildiv
#include <math_constants.h> // for CUDART_PI
__global__
void exponential_kernel( int n, double* v )
{
const int i = threadIdx.x + blockIdx.x*blockDim.x;
if (i < n) {
v[i] = exp( 2 * i * CUDART_PI * v[i] );
}
}
void exponential( int n, double* x, cudaStream_t stream )
{
const int nb = 32;
exponential_kernel<<< magma_ceildiv( n, nb ), nb, 0, stream >>>( n, x );
}