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
832794f5
Commit
832794f5
authored
Jan 25, 2012
by
Peter Eastman
Browse files
Tony's changes to fix errors on Windows
parent
94ecc958
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
10 deletions
+16
-10
olla/src/Platform.cpp
olla/src/Platform.cpp
+3
-3
platforms/opencl/EncodeCLFiles.cmake
platforms/opencl/EncodeCLFiles.cmake
+8
-3
platforms/opencl/src/OpenCLKernelSources.h.in
platforms/opencl/src/OpenCLKernelSources.h.in
+2
-1
platforms/opencl/src/OpenCLSort.h
platforms/opencl/src/OpenCLSort.h
+1
-1
platforms/reference/src/SimTKReference/ReferenceCCMAAlgorithm.cpp
...s/reference/src/SimTKReference/ReferenceCCMAAlgorithm.cpp
+2
-2
No files found.
olla/src/Platform.cpp
View file @
832794f5
...
@@ -159,9 +159,9 @@ static HMODULE loadOneLibrary(const string& file) {
...
@@ -159,9 +159,9 @@ static HMODULE loadOneLibrary(const string& file) {
HMODULE
handle
=
LoadLibrary
(
file
.
c_str
());
HMODULE
handle
=
LoadLibrary
(
file
.
c_str
());
SetErrorMode
(
oldErrorMode
);
// Restore previous error mode.
SetErrorMode
(
oldErrorMode
);
// Restore previous error mode.
if
(
handle
==
NULL
)
{
if
(
handle
==
NULL
)
{
string
message
;
string
stream
message
;
stringstream
(
message
)
<<
"Error loading library "
<<
file
<<
": "
<<
GetLastError
();
message
<<
"Error loading library "
<<
file
<<
": "
<<
GetLastError
();
throw
OpenMMException
(
message
);
throw
OpenMMException
(
message
.
str
()
);
}
}
return
handle
;
return
handle
;
}
}
...
...
platforms/opencl/EncodeCLFiles.cmake
View file @
832794f5
...
@@ -5,9 +5,14 @@ CONFIGURE_FILE(${CL_SOURCE_DIR}/${CL_SOURCE_CLASS}.cpp.in ${CL_KERNELS_CPP})
...
@@ -5,9 +5,14 @@ CONFIGURE_FILE(${CL_SOURCE_DIR}/${CL_SOURCE_CLASS}.cpp.in ${CL_KERNELS_CPP})
FOREACH
(
file
${
OPENCL_KERNELS
}
)
FOREACH
(
file
${
OPENCL_KERNELS
}
)
# Load the file contents and process it.
# Load the file contents and process it.
FILE
(
STRINGS
${
file
}
file_content NEWLINE_CONSUME
)
FILE
(
STRINGS
${
file
}
file_content NEWLINE_CONSUME
)
STRING
(
REPLACE \\\n \\\\\n file_content
"
${
file_content
}
"
)
# Replace all backslashes by double backslashes as they are being put in a C string.
STRING
(
REPLACE \" \\\" file_content
"
${
file_content
}
"
)
# Be careful not to replace the backslash before a semicolon as that is the CMAKE
STRING
(
REPLACE \n \\n\"\n\" file_content
"
${
file_content
}
"
)
# internal escaping of a semicolon to prevent it from acting as a list seperator.
STRING
(
REGEX REPLACE
"
\\\\
([^;])"
"
\\\\\\\\\\
1"
file_content
"
${
file_content
}
"
)
# Escape double quotes as being put in a C string.
STRING
(
REPLACE
"
\"
"
"
\\\"
"
file_content
"
${
file_content
}
"
)
# Split in separate C strings for each line.
STRING
(
REPLACE
"
\n
"
"
\\
n
\"\n\"
"
file_content
"
${
file_content
}
"
)
# Determine a name for the variable that will contain this file's contents
# Determine a name for the variable that will contain this file's contents
FILE
(
RELATIVE_PATH filename
${
CL_SOURCE_DIR
}
/kernels
${
file
}
)
FILE
(
RELATIVE_PATH filename
${
CL_SOURCE_DIR
}
/kernels
${
file
}
)
...
...
platforms/opencl/src/OpenCLKernelSources.h.in
View file @
832794f5
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* -------------------------------------------------------------------------- */
* -------------------------------------------------------------------------- */
#include "openmm/internal/windowsExport.h"
#include <string>
#include <string>
namespace OpenMM {
namespace OpenMM {
...
@@ -37,7 +38,7 @@ namespace OpenMM {
...
@@ -37,7 +38,7 @@ namespace OpenMM {
* kernels subfolder.
* kernels subfolder.
*/
*/
class OpenCLKernelSources {
class
OPENMM_EXPORT
OpenCLKernelSources {
public:
public:
@CL_FILE_DECLARATIONS@
@CL_FILE_DECLARATIONS@
};
};
...
...
platforms/opencl/src/OpenCLSort.h
View file @
832794f5
...
@@ -75,7 +75,7 @@ namespace OpenMM {
...
@@ -75,7 +75,7 @@ namespace OpenMM {
*/
*/
template
<
class
TRAIT
>
template
<
class
TRAIT
>
class
OPENMM_EXPORT
OpenCLSort
{
class
OpenCLSort
{
public:
public:
/**
/**
* Create an OpenCLSort object for sorting data of a particular type.
* Create an OpenCLSort object for sorting data of a particular type.
...
...
platforms/reference/src/SimTKReference/ReferenceCCMAAlgorithm.cpp
View file @
832794f5
...
@@ -344,7 +344,7 @@ void ReferenceCCMAAlgorithm::setTolerance( RealOpenMM tolerance ){
...
@@ -344,7 +344,7 @@ void ReferenceCCMAAlgorithm::setTolerance( RealOpenMM tolerance ){
int
ReferenceCCMAAlgorithm
::
apply
(
int
numberOfAtoms
,
vector
<
RealVec
>&
atomCoordinates
,
int
ReferenceCCMAAlgorithm
::
apply
(
int
numberOfAtoms
,
vector
<
RealVec
>&
atomCoordinates
,
vector
<
RealVec
>&
atomCoordinatesP
,
vector
<
RealVec
>&
atomCoordinatesP
,
vector
<
RealOpenMM
>&
inverseMasses
){
vector
<
RealOpenMM
>&
inverseMasses
){
applyConstraints
(
numberOfAtoms
,
atomCoordinates
,
atomCoordinatesP
,
inverseMasses
,
false
);
return
applyConstraints
(
numberOfAtoms
,
atomCoordinates
,
atomCoordinatesP
,
inverseMasses
,
false
);
}
}
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
@@ -363,7 +363,7 @@ int ReferenceCCMAAlgorithm::apply( int numberOfAtoms, vector<RealVec>& atomCoord
...
@@ -363,7 +363,7 @@ int ReferenceCCMAAlgorithm::apply( int numberOfAtoms, vector<RealVec>& atomCoord
int
ReferenceCCMAAlgorithm
::
applyToVelocities
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
int
ReferenceCCMAAlgorithm
::
applyToVelocities
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
RealVec
>&
velocities
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
)
{
std
::
vector
<
OpenMM
::
RealVec
>&
velocities
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
)
{
applyConstraints
(
numberOfAtoms
,
atomCoordinates
,
velocities
,
inverseMasses
,
true
);
return
applyConstraints
(
numberOfAtoms
,
atomCoordinates
,
velocities
,
inverseMasses
,
true
);
}
}
int
ReferenceCCMAAlgorithm
::
applyConstraints
(
int
numberOfAtoms
,
vector
<
RealVec
>&
atomCoordinates
,
int
ReferenceCCMAAlgorithm
::
applyConstraints
(
int
numberOfAtoms
,
vector
<
RealVec
>&
atomCoordinates
,
...
...
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