"openmmapi/src/LCPOForce.cpp" did not exist on "ccb83f1db93e6329cdcbb72f2210875b856fdbcd"
Commit fb249907 authored by Mark Friedrichs's avatar Mark Friedrichs
Browse files

Fixes to make Windows happier

parent bdc4754a
......@@ -133,6 +133,7 @@ int GBVIForceImpl::getBondsFromForces(ContextImpl& context) {
}
}
return 0;
}
#define GBVIDebug 0
......
......@@ -3936,7 +3936,7 @@ Context* _getContext( System* system, Context* inputContext, Integrator* inputIn
if( log ){
(void) fprintf( log, "OpenMM Platform: %s\n", context->getPlatform().getName().c_str() ); (void) fflush( log );
const vector<string>& properties = gpuPlatform.getPropertyNames();
for (int i = 0; i < properties.size(); i++) {
for (unsigned int i = 0; i < properties.size(); i++) {
fprintf( log, "%s: %s\n", properties[i].c_str(), gpuPlatform.getPropertyValue(*context, properties[i]).c_str());
}
}
......@@ -4040,7 +4040,7 @@ static int getForceStrings( System& system, StringVector& forceStringArray, FILE
// print active forces and relevant parameters
for( unsigned int ii = 0; ii < system.getNumForces(); ii++ ) {
for( int ii = 0; ii < system.getNumForces(); ii++ ) {
int hit = 0;
Force& force = system.getForce(ii);
......@@ -5989,62 +5989,69 @@ int main( int numberOfArguments, char* argv[] ){
initializeForceMap( forceMap, 0 );
int logFileNameIndex = -1;
int summaryFileNameIndex = -1;
int forceEnum;
// parse arguments
#ifdef _MSC_VER
#define STRCASECMP(X,Y) stricmp(X,Y)
#define STRNCASECMP(X,Y,Z) strnicmp(X,Y,Z)
#else
#define STRCASECMP(X,Y) strcasecmp(X,Y)
#define STRNCASECMP(X,Y,Z) strncasecmp(X,Y,Z)
#endif
for( int ii = 1; ii < numberOfArguments; ii++ ){
int addToMap = 0;
if( strcasecmp( argv[ii], "-parameterFileName" ) == 0 ){
if( STRCASECMP( argv[ii], "-parameterFileName" ) == 0 ){
parameterFileName = argv[ii+1];
ii++;
} else if( strcasecmp( argv[ii], "-logFileName" ) == 0 ){
} else if( STRCASECMP( argv[ii], "-logFileName" ) == 0 ){
logFileNameIndex = ii + 1;
ii++;
} else if( strcasecmp( argv[ii], "-summaryFileName" ) == 0 ){
} else if( STRCASECMP( argv[ii], "-summaryFileName" ) == 0 ){
summaryFileNameIndex = ii + 1;
ii++;
} else if( strcasecmp( argv[ii], "-checkForces" ) == 0 ){
} else if( STRCASECMP( argv[ii], "-checkForces" ) == 0 ){
checkForces = atoi( argv[ii+1] );
ii++;
} else if( strcasecmp( argv[ii], "-checkInputForces" ) == 0 ){
} else if( STRCASECMP( argv[ii], "-checkInputForces" ) == 0 ){
checkInputForces = atoi( argv[ii+1] );
ii++;
} else if( strcasecmp( argv[ii], "-checkEnergyForceConsistent" ) == 0 ){
} else if( STRCASECMP( argv[ii], "-checkEnergyForceConsistent" ) == 0 ){
checkEnergyForceConsistent = atoi( argv[ii+1] );
ii++;
} else if( strcasecmp( argv[ii], "-checkEnergyConservation" ) == 0 ){
} else if( STRCASECMP( argv[ii], "-checkEnergyConservation" ) == 0 ){
checkEnergyConservation = atoi( argv[ii+1] );;
ii++;
} else if( strcasecmp( argv[ii], "-energyForceDelta" ) == 0 ||
strcasecmp( argv[ii], "-energyForceTolerance" ) == 0 ||
strcasecmp( argv[ii], "-cudaDeviceId" ) == 0 ||
strcasecmp( argv[ii], "-platform" ) == 0 ||
strcasecmp( argv[ii], "-applyAssertion" ) == 0 ){
} else if( STRCASECMP( argv[ii], "-energyForceDelta" ) == 0 ||
STRCASECMP( argv[ii], "-energyForceTolerance" ) == 0 ||
STRCASECMP( argv[ii], "-cudaDeviceId" ) == 0 ||
STRCASECMP( argv[ii], "-platform" ) == 0 ||
STRCASECMP( argv[ii], "-applyAssertion" ) == 0 ){
addToMap = ii;
ii++;
} else if( strcasecmp( argv[ii], "-allForces" ) == 0 ){
} else if( STRCASECMP( argv[ii], "-allForces" ) == 0 ){
int flag = atoi( argv[ii+1] );
ii++;
initializeForceMap( forceMap, flag );
} else if( strcasecmp( argv[ii], "-log" ) == 0 ){
} else if( STRCASECMP( argv[ii], "-log" ) == 0 ){
if( atoi( argv[ii+1] ) != 0 ){
log = stderr;
} else {
log = NULL;
}
ii++;
} else if( strcasecmp( argv[ii], "-help" ) == 0 ){
} else if( STRCASECMP( argv[ii], "-help" ) == 0 ){
printUsage( defaultParameterFileName );
} else if( getForceOffset( ii, numberOfArguments, argv, forceMap ) ){
ii++;
} else if( strncasecmp( argv[ii], "-equilibration", 14 ) == 0 ||
strncasecmp( argv[ii], "-simulation", 11 ) == 0 ||
strncasecmp( argv[ii], "-runId", 6 ) == 0 ||
strncasecmp( argv[ii], "-nonbonded", 10 ) == 0 ||
strncasecmp( argv[ii], "-readContext", 12 ) == 0 ){
} else if( STRNCASECMP( argv[ii], "-equilibration", 14 ) == 0 ||
STRNCASECMP( argv[ii], "-simulation", 11 ) == 0 ||
STRNCASECMP( argv[ii], "-runId", 6 ) == 0 ||
STRNCASECMP( argv[ii], "-nonbonded", 10 ) == 0 ||
STRNCASECMP( argv[ii], "-readContext", 12 ) == 0 ){
addToMap = ii;
ii++;
} else {
......
......@@ -314,6 +314,14 @@ IF(DL_LIBRARY)
TARGET_LINK_LIBRARIES(${STATIC_FREE_ENERGY_TARGET} ${DL_LIBRARY})
ENDIF(DL_LIBRARY)
SET( OpenMMLib OpenMM )
# But on Unix or Cygwin we have to add the suffix manually
IF (UNIX AND CMAKE_BUILD_TYPE MATCHES Debug)
SET(OpenMMLib ${OpenMMLib}_d)
ENDIF (UNIX AND CMAKE_BUILD_TYPE MATCHES Debug)
TARGET_LINK_LIBRARIES( ${SHARED_FREE_ENERGY_TARGET} ${SHARED_TARGET} )
TARGET_LINK_LIBRARIES( ${STATIC_FREE_ENERGY_TARGET} ${STATIC_TARGET} )
ADD_SUBDIRECTORY(platforms/reference/tests)
# Which hardware platforms to build
......
......@@ -149,6 +149,8 @@ int GBVISoftcoreForceImpl::getBondsFromForces(ContextImpl& context) {
}
}
return 0;
}
#define GBVIDebug 0
......
......@@ -24,8 +24,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* -------------------------------------------------------------------------- */
using namespace std;
#include "GpuGBVISoftcore.h"
#include "GpuFreeEnergyCudaKernels.h"
......@@ -33,8 +31,8 @@ using namespace std;
GpuGBVISoftcore::GpuGBVISoftcore( ){
_bornRadiiScalingMethod = 0;
_quinticLowerLimitFactor = 0.8;
_quinticUpperLimit = 0.008;
_quinticLowerLimitFactor = 0.8f;
_quinticUpperLimit = 0.008f;
_psSwitchDerivative = NULL;
}
......
......@@ -28,7 +28,7 @@
#include "gputypes.h"
#include "cudatypes.h"
#include "cudaKernels.h"
//#include "cudaKernels.h"
#include "openmm/OpenMMException.h"
// info related to nonbonded softcore
......
......@@ -43,7 +43,7 @@ GpuLJ14Softcore::~GpuLJ14Softcore( ){
int GpuLJ14Softcore::flipStrides( gpuContext gpu ){
int flip = gpu->sim.outputBuffers - 1;
for (int ii = 0; ii < psLJ14SoftcoreID->_stride; ii++)
for (unsigned int ii = 0; ii < psLJ14SoftcoreID->_stride; ii++)
{
(*psLJ14SoftcoreID)[ii].z = flip - (*psLJ14SoftcoreID)[ii].z;
(*psLJ14SoftcoreID)[ii].w = flip - (*psLJ14SoftcoreID)[ii].w;
......
......@@ -24,8 +24,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* -------------------------------------------------------------------------- */
using namespace std;
#include "GpuNonbondedSoftcore.h"
#include "GpuFreeEnergyCudaKernels.h"
......
......@@ -24,8 +24,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* -------------------------------------------------------------------------- */
using namespace std;
#include "GpuObcGbsaSoftcore.h"
#include "GpuFreeEnergyCudaKernels.h"
......
......@@ -24,9 +24,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* -------------------------------------------------------------------------- */
#include "gputypes.h"
#include "cudatypes.h"
#include "cudaKernels.h"
#include "kernels/gputypes.h"
#include "kernels/cudatypes.h"
#include "kernels/cudaKernels.h"
#include "GpuFreeEnergyCudaKernels.h"
#include <stdio.h>
......
......@@ -176,6 +176,20 @@ struct Atom {
float bornRadiusScaleFactor;
};
__global__ void kClearGBVISoftcoreBornSum_kernel()
{
unsigned int pos = blockIdx.x * blockDim.x + threadIdx.x;
while (pos < cSim.stride * cSim.nonbondOutputBuffers)
{
((float*)cSim.pBornSum)[pos] = 0.0f;
pos += gridDim.x * blockDim.x;
}
}
void kClearGBVISoftcoreBornSum(gpuContext gpu) {
kClearGBVISoftcoreBornSum_kernel<<<gpu->sim.blocks, 384>>>();
}
// Include versions of the kernels for N^2 calculations.
#define METHOD_NAME(a, b) a##N2##b
......@@ -384,7 +398,7 @@ void kReduceGBVIBornForcesQuinticScaling(gpuContext gpu)
void kCalculateGBVISoftcoreBornSum(gpuContext gpu)
{
//printf("kCalculateGBVIBornSum\n");
kClearGBVIBornSum( gpu );
kClearGBVISoftcoreBornSum( gpu );
LAUNCHERROR("kClearGBVIBornSum from kCalculateGBVISoftcoreBornSum");
size_t numWithInteractions;
......
......@@ -25,7 +25,7 @@
* -------------------------------------------------------------------------- */
#include "gputypes.h"
#include "cudaKernels.h"
#include "kernels/cudaKernels.h"
#include "GpuObcGbsaSoftcore.h"
#include <cuda.h>
......
......@@ -34,7 +34,6 @@
using namespace std;
#include "gputypes.h"
#include "cudaKernels.h"
struct Atom {
float x;
......
......@@ -36,6 +36,7 @@
// In case we're using some primitive version of Visual Studio this will
// make sure that erf() and erfc() are defined.
//#include "MSVC_erfc.h"
#include "openmm/internal/MSVC_erfc.h"
using std::vector;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment