"examples/hello/Makefile" did not exist on "74aff2d62765ab8121b5ca38225bb709cdfd6700"
customGBValuePerParticle.cl 683 Bytes
Newer Older
1
2
3
4
/**
 * Reduce a pairwise computed value, and compute per-particle values.
 */

5
__kernel void computePerParticleValues(int bufferSize, int numBuffers, __global float* valueBuffers, __global float4* posq
6
7
8
9
10
11
12
13
14
15
16
17
        PARAMETER_ARGUMENTS) {
    unsigned int index = get_global_id(0);
    while (index < NUM_ATOMS) {
        // Reduce the pairwise value

        int totalSize = bufferSize*numBuffers;
        float sum = valueBuffers[index];
        for (int i = index+bufferSize; i < totalSize; i += bufferSize)
            sum += valueBuffers[i];

        // Now calculate other values

18
        float4 pos = posq[index];
19
20
21
22
        COMPUTE_VALUES
        index += get_global_size(0);
    }
}