customGBGradientChainRule.cl 555 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
        PARAMETER_ARGUMENTS) {
7
    INIT_PARAM_DERIVS
Peter Eastman's avatar
Peter Eastman committed
8
9
    unsigned int index = get_global_id(0);
    while (index < NUM_ATOMS) {
10
11
        real4 pos = posq[index];
        real4 force = forceBuffers[index];
Peter Eastman's avatar
Peter Eastman committed
12
13
14
15
        COMPUTE_FORCES
        forceBuffers[index] = force;
        index += get_global_size(0);
    }
16
    SAVE_PARAM_DERIVS
Peter Eastman's avatar
Peter Eastman committed
17
}