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
b01017d6
Unverified
Commit
b01017d6
authored
Nov 29, 2022
by
Peter Eastman
Committed by
GitHub
Nov 29, 2022
Browse files
Fix compilation error in OpenCL kernels on some platforms (#3857)
parent
f0bbea98
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
3 deletions
+4
-3
platforms/opencl/src/OpenCLBondedUtilities.cpp
platforms/opencl/src/OpenCLBondedUtilities.cpp
+1
-1
platforms/opencl/src/kernels/common.cl
platforms/opencl/src/kernels/common.cl
+2
-1
platforms/opencl/src/kernels/nonbonded.cl
platforms/opencl/src/kernels/nonbonded.cl
+1
-1
No files found.
platforms/opencl/src/OpenCLBondedUtilities.cpp
View file @
b01017d6
...
...
@@ -106,7 +106,7 @@ void OpenCLBondedUtilities::initialize(const System& system) {
stringstream
s
;
for
(
int
i
=
0
;
i
<
(
int
)
prefixCode
.
size
();
i
++
)
s
<<
prefixCode
[
i
];
s
<<
"__kernel void computeBondedForces(__global long* restrict forceBuffers, __global mixed* restrict energyBuffer, __global const real4* restrict posq, int groups, real4 periodicBoxSize, real4 invPeriodicBoxSize, real4 periodicBoxVecX, real4 periodicBoxVecY, real4 periodicBoxVecZ"
;
s
<<
"__kernel void computeBondedForces(__global
unsigned
long* restrict forceBuffers, __global mixed* restrict energyBuffer, __global const real4* restrict posq, int groups, real4 periodicBoxSize, real4 invPeriodicBoxSize, real4 periodicBoxVecX, real4 periodicBoxVecY, real4 periodicBoxVecZ"
;
for
(
int
force
=
0
;
force
<
numForces
;
force
++
)
{
string
indexType
=
"uint"
+
(
indexWidth
[
force
]
==
1
?
""
:
context
.
intToString
(
indexWidth
[
force
]));
s
<<
", __global const "
<<
indexType
<<
"* restrict atomIndices"
<<
force
;
...
...
platforms/opencl/src/kernels/common.cl
View file @
b01017d6
...
...
@@ -7,7 +7,7 @@
#
ifdef
cl_khr_int64_base_atomics
#
pragma
OPENCL
EXTENSION
cl_khr_int64_base_atomics
:
enable
#
else
void
atom_add
(
volatile
__global
unsigned
long*
p,
long
unsigned
val
)
{
__attribute__
((
overloadable
))
unsigned
long
atom_add
(
volatile
__global
unsigned
long*
p,
unsigned
long
val
)
{
volatile
__global
unsigned
int*
word
=
(
volatile
__global
unsigned
int*
)
p
;
#
ifdef
__ENDIAN_LITTLE__
int
lowIndex
=
0
;
...
...
@@ -21,6 +21,7 @@ void atom_add(volatile __global unsigned long* p, long unsigned val) {
upper
+=
carry
;
if
(
upper
!=
0
)
atomic_add
(
&word[1-lowIndex],
upper
)
;
return
0
;
}
#
endif
...
...
platforms/opencl/src/kernels/nonbonded.cl
View file @
b01017d6
...
...
@@ -14,7 +14,7 @@ typedef struct {
*
Compute
nonbonded
interactions.
*/
__kernel
void
computeNonbonded
(
__global
long*
restrict
forceBuffers,
__global
unsigned
long*
restrict
forceBuffers,
__global
mixed*
restrict
energyBuffer,
__global
const
real4*
restrict
posq,
__global
const
unsigned
int*
restrict
exclusions,
__global
const
int2*
restrict
exclusionTiles,
unsigned
int
startTileIndex,
unsigned
long
numTileIndices
#
ifdef
USE_CUTOFF
...
...
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