customGBGradientChainRule.cl 511 Bytes
Newer Older
Peter Eastman's avatar
Peter Eastman committed
1
2
3
4
/**
 * Compute chain rule terms for computed values that depend explicitly on particle coordinates.
 */

5
__kernel void computeGradientChainRuleTerms(__global real4* restrict forceBuffers, __global const real4* restrict posq
Peter Eastman's avatar
Peter Eastman committed
6
7
8
        PARAMETER_ARGUMENTS) {
    unsigned int index = get_global_id(0);
    while (index < NUM_ATOMS) {
9
10
        real4 pos = posq[index];
        real4 force = forceBuffers[index];
Peter Eastman's avatar
Peter Eastman committed
11
12
13
14
15
        COMPUTE_FORCES
        forceBuffers[index] = force;
        index += get_global_size(0);
    }
}