Open main menu

CDOT Wiki β

Changes

Algo holics

16 bytes added, 01:58, 8 April 2019
Kernel 2
double atomicAdd(double* address, double value)
=====Kernel Version 2=====
{| class="wikitable mw-collapsible mw-collapsed"
int i = blockIdx.y * blockDim.y + threadIdx.y;
if(i<n && j<n){
angle = pi * ( double ) ( i * ( 2 * j + 1 ) ) / ( double ) ( 2 * n ); double value = cos ( angle ) * a[j]; b[i] = atomicAdd(&b[i], value);
}
//square root of the whole cos transformed row term
if(j==n-1 && i<n){
b[i] *= sqrt ( 2.0 / ( double ) ( n ) );
}
}
57
edits