Unverified Commit f29d6cc5 authored by informatorius's avatar informatorius Committed by GitHub
Browse files

Update IntegrationUtilities.cpp (#2891)

* Update IntegrationUtilities.cpp

* Use pinned buffer and for context download
* use template to reduce duplicate code

* Remove template and only add PinnedBuffer for minor performance improvement

* Use pinned buffer for minor performance improvement

Co-authored-by: xxx <yyy>
parent 698769b9
......@@ -834,7 +834,7 @@ double IntegrationUtilities::computeKineticEnergy(double timeShift) {
double energy = 0.0;
if (context.getUseDoublePrecision() || context.getUseMixedPrecision()) {
vector<mm_double4> velm;
auto velm = (mm_double4*)context.getPinnedBuffer();
context.getVelm().download(velm);
for (int i = 0; i < numParticles; i++) {
mm_double4 v = velm[i];
......@@ -843,7 +843,7 @@ double IntegrationUtilities::computeKineticEnergy(double timeShift) {
}
}
else {
vector<mm_float4> velm;
auto velm = (mm_float4*)context.getPinnedBuffer();
context.getVelm().download(velm);
for (int i = 0; i < numParticles; i++) {
mm_float4 v = velm[i];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment