Commit 26a34a73 authored by Peter Eastman's avatar Peter Eastman
Browse files

Fixed test failures caused by linking to the same library twice, once...

Fixed test failures caused by linking to the same library twice, once statically and once dynamically
parent 4b0fc0a1
......@@ -315,7 +315,6 @@ int main( int numberOfArguments, char* argv[] ) {
try {
std::cout << "TestCudaAmoebaAngleForce running test..." << std::endl;
Platform::loadPluginsFromDirectory( Platform::getDefaultPluginsDirectory() );
//FILE* log = fopen( "AmoebaAngleForce.log", "w" );;
FILE* log = NULL;
//FILE* log = stderr;
......
......@@ -222,7 +222,6 @@ int main( int numberOfArguments, char* argv[] ) {
try {
std::cout << "TestReferenceAmoebaBondForce running test..." << std::endl;
Platform::loadPluginsFromDirectory( Platform::getDefaultPluginsDirectory() );
FILE* log = NULL;
//FILE* log = stderr;
......
......@@ -391,7 +391,6 @@ int main( int numberOfArguments, char* argv[] ) {
try {
std::cout << "TestReferenceAmoebaInPlaneAngleForce running test..." << std::endl;
Platform::loadPluginsFromDirectory( Platform::getDefaultPluginsDirectory() );
FILE* log = NULL;
//FILE* log = stderr;
//FILE* log = fopen( "AmoebaInPlaneAngleForce.log", "w" );;
......
......@@ -521,7 +521,6 @@ int main( int numberOfArguments, char* argv[] ) {
try {
std::cout << "TestReferenceAmoebaOutOfPlaneBendForce running test..." << std::endl;
Platform::loadPluginsFromDirectory( Platform::getDefaultPluginsDirectory() );
//FILE* log = stderr;
FILE* log = NULL;
......
......@@ -318,7 +318,6 @@ int main( int numberOfArguments, char* argv[] ) {
try {
std::cout << "TestReferenceAmoebaPiTorsionForce running test..." << std::endl;
Platform::loadPluginsFromDirectory( Platform::getDefaultPluginsDirectory() );
FILE* log = NULL;
//FILE* log = stderr;
//FILE* log = fopen( "AmoebaPiTorsionForce1.log", "w" );;
......
......@@ -304,7 +304,6 @@ int main( int numberOfArguments, char* argv[] ) {
try {
std::cout << "TestReferenceAmoebaStretchBendForce running test..." << std::endl;
Platform::loadPluginsFromDirectory( Platform::getDefaultPluginsDirectory() );
FILE* log = NULL;
//FILE* log = stderr;
......
......@@ -48,6 +48,16 @@ extern "C" void registerKernelFactories() {
}
}
extern "C" OPENMM_EXPORT void registerRPMDCudaKernelFactories() {
try {
Platform::getPlatformByName("CUDA");
}
catch (...) {
Platform::registerPlatform(new CudaPlatform());
}
registerKernelFactories();
}
KernelImpl* CudaRpmdKernelFactory::createKernelImpl(std::string name, const Platform& platform, ContextImpl& context) const {
CudaContext& cl = *static_cast<CudaPlatform::PlatformData*>(context.getPlatformData())->contexts[0];
if (name == IntegrateRPMDStepKernel::Name())
......
......@@ -13,7 +13,7 @@ FOREACH(TEST_PROG ${TEST_PROGS})
# Link with shared library
ADD_EXECUTABLE(${TEST_ROOT} ${TEST_PROG})
TARGET_LINK_LIBRARIES(${TEST_ROOT} ${SHARED_RPMD_TARGET})
TARGET_LINK_LIBRARIES(${TEST_ROOT} ${SHARED_RPMD_TARGET} ${SHARED_TARGET})
ADD_TEST(${TEST_ROOT}Single ${EXECUTABLE_OUTPUT_PATH}/${TEST_ROOT} single)
IF (OPENMM_BUILD_CUDA_DOUBLE_PRECISION_TESTS)
ADD_TEST(${TEST_ROOT}Mixed ${EXECUTABLE_OUTPUT_PATH}/${TEST_ROOT} mixed)
......
......@@ -48,6 +48,8 @@
using namespace OpenMM;
using namespace std;
extern "C" OPENMM_EXPORT void registerRPMDCudaKernelFactories();
void testFreeParticles() {
const int numParticles = 100;
const int numCopies = 30;
......@@ -222,7 +224,7 @@ void testParaHydrogen() {
int main(int argc, char* argv[]) {
try {
Platform::loadPluginsFromDirectory(Platform::getDefaultPluginsDirectory());
registerRPMDCudaKernelFactories();
if (argc > 1)
Platform::getPlatformByName("CUDA").setPropertyDefaultValue("CudaPrecision", string(argv[1]));
testFreeParticles();
......
......@@ -106,7 +106,6 @@ void testFreeParticles() {
int main() {
try {
Platform::loadPluginsFromDirectory(Platform::getDefaultPluginsDirectory());
testFreeParticles();
}
catch(const std::exception& e) {
......
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