customGBValuePerParticle.cu 523 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
/**
 * Reduce a pairwise computed value, and compute per-particle values.
 */

extern "C" __global__ void computePerParticleValues(real4* posq, long long* valueBuffers
        PARAMETER_ARGUMENTS) {
    for (unsigned int index = blockIdx.x*blockDim.x+threadIdx.x; index < NUM_ATOMS; index += blockDim.x*gridDim.x) {
        // Load the pairwise value

10
        real sum = valueBuffers[index]/(real) 0x100000000;
11
12
13
14
15
16
17
        
        // Now calculate other values

        real4 pos = posq[index];
        COMPUTE_VALUES
    }
}