Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
f965707b
Unverified
Commit
f965707b
authored
Aug 25, 2024
by
Anton Gorenko
Browse files
Add ATMForce
Co-authored-by:
Emilio Gallicchio
<
emilio.gallicchio@gmail.com
>
parent
70771a51
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
0 deletions
+51
-0
platforms/hip/include/HipKernels.h
platforms/hip/include/HipKernels.h
+12
-0
platforms/hip/src/HipKernelFactory.cpp
platforms/hip/src/HipKernelFactory.cpp
+2
-0
platforms/hip/src/HipPlatform.cpp
platforms/hip/src/HipPlatform.cpp
+1
-0
platforms/hip/tests/TestHipATMForce.cpp
platforms/hip/tests/TestHipATMForce.cpp
+36
-0
No files found.
platforms/hip/include/HipKernels.h
View file @
f965707b
...
...
@@ -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
#endif
/*OPENMM_HIPKERNELS_H_*/
platforms/hip/src/HipKernelFactory.cpp
View file @
f965707b
...
...
@@ -140,5 +140,7 @@ KernelImpl* HipKernelFactory::createKernelImpl(std::string name, const Platform&
return
new
CommonApplyMonteCarloBarostatKernel
(
name
,
platform
,
cu
);
if
(
name
==
RemoveCMMotionKernel
::
Name
())
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
());
}
platforms/hip/src/HipPlatform.cpp
View file @
f965707b
...
...
@@ -107,6 +107,7 @@ HipPlatform::HipPlatform() {
registerKernelFactory
(
ApplyAndersenThermostatKernel
::
Name
(),
factory
);
registerKernelFactory
(
ApplyMonteCarloBarostatKernel
::
Name
(),
factory
);
registerKernelFactory
(
RemoveCMMotionKernel
::
Name
(),
factory
);
registerKernelFactory
(
CalcATMForceKernel
::
Name
(),
factory
);
platformProperties
.
push_back
(
HipDeviceIndex
());
platformProperties
.
push_back
(
HipDeviceName
());
platformProperties
.
push_back
(
HipUseBlockingSync
());
...
...
platforms/hip/tests/TestHipATMForce.cpp
0 → 100644
View file @
f965707b
/* -------------------------------------------------------------------------- *
* 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
()
{
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment