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
47684368
Unverified
Commit
47684368
authored
Oct 22, 2025
by
Peter Eastman
Committed by
GitHub
Oct 22, 2025
Browse files
Fixed SymmetrySite on HIP platform (#5118)
parent
895fcd4c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
5 deletions
+35
-5
platforms/hip/src/HipIntegrationUtilities.cpp
platforms/hip/src/HipIntegrationUtilities.cpp
+35
-5
No files found.
platforms/hip/src/HipIntegrationUtilities.cpp
View file @
47684368
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
* This is part of the OpenMM molecular simulation toolkit. *
* This is part of the OpenMM molecular simulation toolkit. *
* See https://openmm.org/development. *
* See https://openmm.org/development. *
* *
* *
* Portions copyright (c) 2009-202
1
Stanford University and the Authors. *
* Portions copyright (c) 2009-202
5
Stanford University and the Authors. *
* Portions copyright (c) 2020-2023 Advanced Micro Devices, Inc. *
* Portions copyright (c) 2020-2023 Advanced Micro Devices, Inc. *
* Authors: Peter Eastman, Nicholas Curtis *
* Authors: Peter Eastman, Nicholas Curtis *
* Contributors: *
* Contributors: *
...
@@ -133,9 +133,39 @@ void HipIntegrationUtilities::applyConstraintsImpl(bool constrainVelocities, dou
...
@@ -133,9 +133,39 @@ void HipIntegrationUtilities::applyConstraintsImpl(bool constrainVelocities, dou
void
HipIntegrationUtilities
::
distributeForcesFromVirtualSites
()
{
void
HipIntegrationUtilities
::
distributeForcesFromVirtualSites
()
{
ContextSelector
selector
(
context
);
ContextSelector
selector
(
context
);
if
(
numVsites
>
0
)
{
Vec3
boxVectors
[
3
];
context
.
getPeriodicBoxVectors
(
boxVectors
[
0
],
boxVectors
[
1
],
boxVectors
[
2
]);
mm_double4
recipBoxVectorsDouble
[
3
];
context
.
computeReciprocalBoxVectors
(
recipBoxVectorsDouble
);
if
(
context
.
getUseDoublePrecision
())
{
mm_double4
boxVectorsDouble
[
3
];
for
(
int
i
=
0
;
i
<
3
;
i
++
)
boxVectorsDouble
[
i
]
=
mm_double4
(
boxVectors
[
i
][
0
],
boxVectors
[
i
][
1
],
boxVectors
[
i
][
2
],
0
);
vsiteForceKernel
->
setArg
(
18
,
boxVectorsDouble
[
0
]);
vsiteForceKernel
->
setArg
(
19
,
boxVectorsDouble
[
1
]);
vsiteForceKernel
->
setArg
(
20
,
boxVectorsDouble
[
2
]);
vsiteForceKernel
->
setArg
(
21
,
recipBoxVectorsDouble
[
0
]);
vsiteForceKernel
->
setArg
(
22
,
recipBoxVectorsDouble
[
1
]);
vsiteForceKernel
->
setArg
(
23
,
recipBoxVectorsDouble
[
2
]);
}
else
{
mm_float4
boxVectorsFloat
[
3
],
recipBoxVectorsFloat
[
3
];
for
(
int
i
=
0
;
i
<
3
;
i
++
)
{
boxVectorsFloat
[
i
]
=
mm_float4
((
float
)
boxVectors
[
i
][
0
],
(
float
)
boxVectors
[
i
][
1
],
(
float
)
boxVectors
[
i
][
2
],
0
);
recipBoxVectorsFloat
[
i
]
=
mm_float4
((
float
)
recipBoxVectorsDouble
[
i
].
x
,
(
float
)
recipBoxVectorsDouble
[
i
].
y
,
(
float
)
recipBoxVectorsDouble
[
i
].
z
,
0
);
}
vsiteForceKernel
->
setArg
(
18
,
boxVectorsFloat
[
0
]);
vsiteForceKernel
->
setArg
(
19
,
boxVectorsFloat
[
1
]);
vsiteForceKernel
->
setArg
(
20
,
boxVectorsFloat
[
2
]);
vsiteForceKernel
->
setArg
(
21
,
recipBoxVectorsFloat
[
0
]);
vsiteForceKernel
->
setArg
(
22
,
recipBoxVectorsFloat
[
1
]);
vsiteForceKernel
->
setArg
(
23
,
recipBoxVectorsFloat
[
2
]);
}
for
(
int
i
=
numVsiteStages
-
1
;
i
>=
0
;
i
--
)
{
for
(
int
i
=
numVsiteStages
-
1
;
i
>=
0
;
i
--
)
{
vsiteForceKernel
->
setArg
(
2
,
context
.
getLongForceBuffer
());
vsiteForceKernel
->
setArg
(
2
,
context
.
getLongForceBuffer
());
vsiteForceKernel
->
setArg
(
1
5
,
i
);
vsiteForceKernel
->
setArg
(
2
5
,
i
);
vsiteForceKernel
->
execute
(
numVsites
);
vsiteForceKernel
->
execute
(
numVsites
);
}
}
}
}
}
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