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
a7ce5784
Commit
a7ce5784
authored
Jan 22, 2016
by
peastman
Browse files
Fixed errors in CustomManyParticleForce
parent
90ddfc31
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
10 deletions
+25
-10
.travis.yml
.travis.yml
+14
-4
platforms/cuda/src/kernels/customManyParticle.cu
platforms/cuda/src/kernels/customManyParticle.cu
+5
-3
platforms/opencl/src/kernels/customManyParticle.cl
platforms/opencl/src/kernels/customManyParticle.cl
+6
-3
No files found.
.travis.yml
View file @
a7ce5784
...
...
@@ -17,6 +17,7 @@ env:
matrix
:
include
:
-
sudo
:
required
dist
:
trusty
env
:
==CPU_OPENCL==
OPENCL=true
CUDA=false
...
...
@@ -33,7 +34,9 @@ matrix:
-DOPENMM_BUILD_AMOEBA_PLUGIN=OFF
-DOPENMM_BUILD_PYTHON_WRAPPERS=OFF
-DOPENMM_BUILD_C_AND_FORTRAN_WRAPPERS=OFF
-DOPENMM_BUILD_EXAMPLES=OFF"
-DOPENMM_BUILD_EXAMPLES=OFF
-DOPENCL_INCLUDE_DIR=$HOME/AMDAPPSDK/include
-DOPENCL_LIBRARY=$HOME/AMDAPPSDK/lib/x86_64/libOpenCL.so"
addons
:
{
apt
:
{
packages
:
[]}}
-
sudo
:
required
...
...
@@ -107,9 +110,16 @@ before_install:
sudo easy_install pytest;
fi
-
if [[ "$OPENCL" == "true" ]]; then
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe restricted multiverse";
sudo apt-get -yq update > /dev/null 2>&1 ;
sudo apt-get install -qq fglrx=2:8.960-0ubuntu1 opencl-headers;
wget https://jenkins.choderalab.org/userContent/AMD-APP-SDKInstaller-v3.0.130.135-GA-linux64.tar.bz2;
tar -xjf AMD-APP-SDK*.tar.bz2;
AMDAPPSDK=${HOME}/AMDAPPSDK;
export OPENCL_VENDOR_PATH=${AMDAPPSDK}/etc/OpenCL/vendors;
mkdir -p ${OPENCL_VENDOR_PATH};
sh AMD-APP-SDK*.sh --tar -xf -C ${AMDAPPSDK};
echo libamdocl64.so > ${OPENCL_VENDOR_PATH}/amdocl64.icd;
export LD_LIBRARY_PATH=${AMDAPPSDK}/lib/x86_64:${LD_LIBRARY_PATH};
chmod +x ${AMDAPPSDK}/bin/x86_64/clinfo;
${AMDAPPSDK}/bin/x86_64/clinfo;
fi
# Install swig for Python wrappers. However, testing CUDA and OpenCL, we
# skip the Python wrapper for speed. We're not using anaconda python,
...
...
platforms/cuda/src/kernels/customManyParticle.cu
View file @
a7ce5784
...
...
@@ -59,7 +59,7 @@ inline __device__ real4 computeCross(real4 vec1, real4 vec2) {
/**
* Determine whether a particular interaction is in the list of exclusions.
*/
inline
__device__
bool
isInteractionExcluded
(
int
atom1
,
int
atom2
,
int
*
__restrict__
exclusions
,
int
*
__restrict__
exclusionStartIndex
)
{
inline
__device__
bool
isInteractionExcluded
(
int
atom1
,
int
atom2
,
const
int
*
__restrict__
exclusions
,
const
int
*
__restrict__
exclusionStartIndex
)
{
int
first
=
exclusionStartIndex
[
atom1
];
int
last
=
exclusionStartIndex
[
atom1
+
1
];
for
(
int
i
=
last
-
1
;
i
>=
first
;
i
--
)
{
...
...
@@ -180,7 +180,7 @@ extern "C" __global__ void findNeighbors(real4 periodicBoxSize, real4 invPeriodi
const
real4
*
__restrict__
posq
,
const
real4
*
__restrict__
blockCenter
,
const
real4
*
__restrict__
blockBoundingBox
,
int2
*
__restrict__
neighborPairs
,
int
*
__restrict__
numNeighborPairs
,
int
*
__restrict__
numNeighborsForAtom
,
int
maxNeighborPairs
#ifdef USE_EXCLUSIONS
,
int
*
__restrict__
exclusions
,
int
*
__restrict__
exclusionStartIndex
,
const
int
*
__restrict__
exclusions
,
const
int
*
__restrict__
exclusionStartIndex
#endif
)
{
__shared__
real3
positionCache
[
FIND_NEIGHBORS_WORKGROUP_SIZE
];
...
...
@@ -265,7 +265,8 @@ extern "C" __global__ void findNeighbors(real4 periodicBoxSize, real4 invPeriodi
}
}
}
numNeighborsForAtom
[
atom1
]
=
totalNeighborsForAtom1
;
if
(
atom1
<
NUM_ATOMS
)
numNeighborsForAtom
[
atom1
]
=
totalNeighborsForAtom1
;
}
}
...
...
@@ -308,6 +309,7 @@ extern "C" __global__ void computeNeighborStartIndices(int* __restrict__ numNeig
numNeighborsForAtom
[
globalIndex
]
=
0
;
// Clear this so the next kernel can use it as a counter
}
globalOffset
+=
posBuffer
[
blockDim
.
x
-
1
];
__syncthreads
();
}
if
(
threadIdx
.
x
==
0
)
neighborStartIndex
[
0
]
=
0
;
...
...
platforms/opencl/src/kernels/customManyParticle.cl
View file @
a7ce5784
...
...
@@ -55,7 +55,7 @@ inline real4 computeCross(real4 vec1, real4 vec2) {
/**
*
Determine
whether
a
particular
interaction
is
in
the
list
of
exclusions.
*/
inline
bool
isInteractionExcluded
(
int
atom1,
int
atom2,
__global
int*
restrict
exclusions,
__global
int*
restrict
exclusionStartIndex
)
{
inline
bool
isInteractionExcluded
(
int
atom1,
int
atom2,
__global
const
int*
restrict
exclusions,
__global
const
int*
restrict
exclusionStartIndex
)
{
int
first
=
exclusionStartIndex[atom1]
;
int
last
=
exclusionStartIndex[atom1+1]
;
for
(
int
i
=
last-1
; i >= first; i--) {
...
...
@@ -174,7 +174,7 @@ __kernel void findNeighbors(real4 periodicBoxSize, real4 invPeriodicBoxSize, rea
__global
const
real4*
restrict
posq,
__global
const
real4*
restrict
blockCenter,
__global
const
real4*
restrict
blockBoundingBox,
__global
int2*
restrict
neighborPairs,
__global
int*
restrict
numNeighborPairs,
__global
int*
restrict
numNeighborsForAtom,
int
maxNeighborPairs
#
ifdef
USE_EXCLUSIONS
,
__global
int*
restrict
exclusions,
__global
int*
restrict
exclusionStartIndex
,
__global
const
int*
restrict
exclusions,
__global
const
int*
restrict
exclusionStartIndex
#
endif
)
{
__local
real4
positionCache[FIND_NEIGHBORS_WORKGROUP_SIZE]
;
...
...
@@ -264,7 +264,9 @@ __kernel void findNeighbors(real4 periodicBoxSize, real4 invPeriodicBoxSize, rea
}
}
}
numNeighborsForAtom[atom1]
=
totalNeighborsForAtom1
;
if
(
atom1
<
NUM_ATOMS
)
numNeighborsForAtom[atom1]
=
totalNeighborsForAtom1
;
SYNC_WARPS
;
}
}
...
...
@@ -307,6 +309,7 @@ __kernel void computeNeighborStartIndices(__global int* restrict numNeighborsFor
numNeighborsForAtom[globalIndex]
=
0
; // Clear this so the next kernel can use it as a counter
}
globalOffset
+=
posBuffer[get_local_size
(
0
)
-1]
;
barrier
(
CLK_LOCAL_MEM_FENCE
)
;
}
if
(
get_local_id
(
0
)
==
0
)
neighborStartIndex[0]
=
0
;
...
...
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