customGBGradientChainRule.cl 491 Bytes
Newer Older
Peter Eastman's avatar
Peter Eastman committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/**
 * Compute chain rule terms for computed values that depend explicitly on particle coordinates.
 */

__kernel void computeGradientChainRuleTerms(__global float4* forceBuffers, __global float4* posq
        PARAMETER_ARGUMENTS) {
    unsigned int index = get_global_id(0);
    while (index < NUM_ATOMS) {
        float4 pos = posq[index];
        float4 force = forceBuffers[index];
        COMPUTE_FORCES
        forceBuffers[index] = force;
        index += get_global_size(0);
    }
}