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
562283df
Commit
562283df
authored
May 23, 2013
by
Yutong Zhao
Browse files
minor bug fixes
parent
f4591cad
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
13 deletions
+8
-13
platforms/cuda/src/CudaContext.cpp
platforms/cuda/src/CudaContext.cpp
+7
-7
platforms/cuda/src/CudaNonbondedUtilities.cpp
platforms/cuda/src/CudaNonbondedUtilities.cpp
+1
-6
No files found.
platforms/cuda/src/CudaContext.cpp
View file @
562283df
...
...
@@ -394,7 +394,7 @@ CUmodule CudaContext::createModule(const string source, const map<string, string
// Write out the source to a temporary file.
stringstream
tempFileName
;
tempFileName
<<
"openmmTempKernel"
<<
this
;
// Include a pointer to this context as part of the filename to avoid collisions.
tempFileName
<<
"openmmTempKernel"
<<
rand
();
//<<
this; // Include a pointer to this context as part of the filename to avoid collisions.
string
inputFile
=
(
tempDir
+
tempFileName
.
str
()
+
".cu"
);
string
outputFile
=
(
tempDir
+
tempFileName
.
str
()
+
".ptx"
);
string
logFile
=
(
tempDir
+
tempFileName
.
str
()
+
".log"
);
...
...
@@ -438,15 +438,15 @@ CUmodule CudaContext::createModule(const string source, const map<string, string
m
<<
"Error loading CUDA module: "
<<
getErrorString
(
result
)
<<
" ("
<<
result
<<
")"
;
throw
OpenMMException
(
m
.
str
());
}
remove
(
inputFile
.
c_str
());
remove
(
outputFile
.
c_str
());
remove
(
logFile
.
c_str
());
//
remove(inputFile.c_str());
//
remove(outputFile.c_str());
//
remove(logFile.c_str());
return
module
;
}
catch
(...)
{
remove
(
inputFile
.
c_str
());
remove
(
outputFile
.
c_str
());
remove
(
logFile
.
c_str
());
//
remove(inputFile.c_str());
//
remove(outputFile.c_str());
//
remove(logFile.c_str());
throw
;
}
}
...
...
platforms/cuda/src/CudaNonbondedUtilities.cpp
View file @
562283df
...
...
@@ -415,8 +415,6 @@ void CudaNonbondedUtilities::setAtomBlockRange(double startFraction, double endF
numTiles
=
(
int
)
(
endFraction
*
totalTiles
)
-
startTileIndex
;
}
#include <map>
CUfunction
CudaNonbondedUtilities
::
createInteractionKernel
(
const
string
&
source
,
vector
<
ParameterInfo
>&
params
,
vector
<
ParameterInfo
>&
arguments
,
bool
useExclusions
,
bool
isSymmetric
)
{
map
<
string
,
string
>
defines
;
...
...
@@ -475,8 +473,7 @@ CUfunction CudaNonbondedUtilities::createInteractionKernel(const string& source,
// Part 1. Defines for on diagonal exclusion tiles
stringstream
loadLocal1
;
if
(
useShuffle
)
{
// not needed if using shuffles as we can directly fetch from
// LOAD_ATOM1_PARAMETERS
// not needed if using shuffles as we can directly fetch from register
}
else
{
for
(
int
i
=
0
;
i
<
(
int
)
params
.
size
();
i
++
)
{
if
(
params
[
i
].
getNumComponents
()
==
1
)
{
...
...
@@ -616,8 +613,6 @@ CUfunction CudaNonbondedUtilities::createInteractionKernel(const string& source,
defines
[
"LAST_EXCLUSION_TILE"
]
=
context
.
intToString
(
endExclusionIndex
);
if
((
localDataSize
/
4
)
%
2
==
0
&&
!
context
.
getUseDoublePrecision
())
defines
[
"PARAMETER_SIZE_IS_EVEN"
]
=
"1"
;
//if (context.getComputeCapability() >= 3.0 && !context.getUseDoublePrecision())
// defines["ENABLE_SHUFFLE"] = "1";
CUmodule
program
=
context
.
createModule
(
CudaKernelSources
::
vectorOps
+
context
.
replaceStrings
(
CudaKernelSources
::
nonbonded
,
replacements
),
defines
);
CUfunction
kernel
=
context
.
getKernel
(
program
,
"computeNonbonded"
);
...
...
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