Unverified Commit f965707b authored by Anton Gorenko's avatar Anton Gorenko
Browse files

Add ATMForce


Co-authored-by: default avatarEmilio Gallicchio <emilio.gallicchio@gmail.com>
parent 70771a51
...@@ -339,6 +339,18 @@ public: ...@@ -339,6 +339,18 @@ public:
} }
}; };
/**
* This kernel is invoked by ATMForce to calculate the forces acting on the system and the energy of the system.
*/
class HipCalcATMForceKernel : public CommonCalcATMForceKernel {
public:
HipCalcATMForceKernel(std::string name, const Platform& platform, ComputeContext& cc) : CommonCalcATMForceKernel(name, platform, cc) {
}
ComputeContext& getInnerComputeContext(ContextImpl& innerContext) {
return *reinterpret_cast<HipPlatform::PlatformData*>(innerContext.getPlatformData())->contexts[0];
}
};
} // namespace OpenMM } // namespace OpenMM
#endif /*OPENMM_HIPKERNELS_H_*/ #endif /*OPENMM_HIPKERNELS_H_*/
...@@ -140,5 +140,7 @@ KernelImpl* HipKernelFactory::createKernelImpl(std::string name, const Platform& ...@@ -140,5 +140,7 @@ KernelImpl* HipKernelFactory::createKernelImpl(std::string name, const Platform&
return new CommonApplyMonteCarloBarostatKernel(name, platform, cu); return new CommonApplyMonteCarloBarostatKernel(name, platform, cu);
if (name == RemoveCMMotionKernel::Name()) if (name == RemoveCMMotionKernel::Name())
return new CommonRemoveCMMotionKernel(name, platform, cu); return new CommonRemoveCMMotionKernel(name, platform, cu);
if (name == CalcATMForceKernel::Name() )
return new HipCalcATMForceKernel(name, platform, cu);
throw OpenMMException((std::string("Tried to create kernel with illegal kernel name '")+name+"'").c_str()); throw OpenMMException((std::string("Tried to create kernel with illegal kernel name '")+name+"'").c_str());
} }
...@@ -107,6 +107,7 @@ HipPlatform::HipPlatform() { ...@@ -107,6 +107,7 @@ HipPlatform::HipPlatform() {
registerKernelFactory(ApplyAndersenThermostatKernel::Name(), factory); registerKernelFactory(ApplyAndersenThermostatKernel::Name(), factory);
registerKernelFactory(ApplyMonteCarloBarostatKernel::Name(), factory); registerKernelFactory(ApplyMonteCarloBarostatKernel::Name(), factory);
registerKernelFactory(RemoveCMMotionKernel::Name(), factory); registerKernelFactory(RemoveCMMotionKernel::Name(), factory);
registerKernelFactory(CalcATMForceKernel::Name(), factory);
platformProperties.push_back(HipDeviceIndex()); platformProperties.push_back(HipDeviceIndex());
platformProperties.push_back(HipDeviceName()); platformProperties.push_back(HipDeviceName());
platformProperties.push_back(HipUseBlockingSync()); platformProperties.push_back(HipUseBlockingSync());
......
/* -------------------------------------------------------------------------- *
* OpenMM *
* -------------------------------------------------------------------------- *
* This is part of the OpenMM molecular simulation toolkit originating from *
* Simbios, the NIH National Center for Physics-Based Simulation of *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2023 Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the "Software"), *
* to deal in the Software without restriction, including without limitation *
* the rights to use, copy, modify, merge, publish, distribute, sublicense, *
* and/or sell copies of the Software, and to permit persons to whom the *
* Software is furnished to do so, subject to the following conditions: *
* *
* The above copyright notice and this permission notice shall be included in *
* all copies or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
* THE AUTHORS, CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
#include "HipTests.h"
#include "TestATMForce.h"
void runPlatformTests() {
}
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