Commit dde7b14b authored by Peter Eastman's avatar Peter Eastman
Browse files

Removed unnecessary calls to load plugins that produced errors

parent 066c571e
......@@ -80,7 +80,6 @@ void testSerialization() {
int main() {
try {
Platform::loadPluginsFromDirectory(Platform::getDefaultPluginsDirectory());
testSerialization();
}
catch(const exception& e) {
......
......@@ -75,7 +75,6 @@ void testSerialization() {
int main() {
try {
Platform::loadPluginsFromDirectory(Platform::getDefaultPluginsDirectory());
testSerialization();
}
catch(const exception& e) {
......
......@@ -94,7 +94,6 @@ void testSerialization() {
int main() {
try {
Platform::loadPluginsFromDirectory(Platform::getDefaultPluginsDirectory());
testSerialization();
}
catch(const exception& e) {
......
......@@ -85,7 +85,6 @@ void testSerialization() {
int main() {
try {
Platform::loadPluginsFromDirectory(Platform::getDefaultPluginsDirectory());
testSerialization();
}
catch(const exception& e) {
......
......@@ -186,7 +186,6 @@ void testSerialization() {
int main() {
try {
Platform::loadPluginsFromDirectory(Platform::getDefaultPluginsDirectory());
testSerialization();
}
catch(const exception& e) {
......
......@@ -84,7 +84,6 @@ void testSerialization() {
int main() {
try {
Platform::loadPluginsFromDirectory(Platform::getDefaultPluginsDirectory());
testSerialization();
}
catch(const exception& e) {
......
......@@ -74,7 +74,6 @@ void testSerialization() {
int main() {
try {
Platform::loadPluginsFromDirectory(Platform::getDefaultPluginsDirectory());
testSerialization();
}
catch(const exception& e) {
......
......@@ -79,7 +79,6 @@ void testSerialization() {
int main() {
try {
Platform::loadPluginsFromDirectory(Platform::getDefaultPluginsDirectory());
testSerialization();
}
catch(const exception& e) {
......
......@@ -133,7 +133,6 @@ void testSerialization() {
int main() {
try {
Platform::loadPluginsFromDirectory(Platform::getDefaultPluginsDirectory());
testSerialization();
}
catch(const exception& e) {
......
......@@ -120,7 +120,6 @@ void testSerialization() {
int main() {
try {
Platform::loadPluginsFromDirectory(Platform::getDefaultPluginsDirectory());
testSerialization();
}
catch(const exception& e) {
......
......@@ -99,7 +99,6 @@ void testSerialization() {
int main() {
try {
Platform::loadPluginsFromDirectory(Platform::getDefaultPluginsDirectory());
testSerialization();
}
catch(const exception& e) {
......
......@@ -48,6 +48,16 @@ extern "C" void registerKernelFactories() {
}
}
extern "C" OPENMM_EXPORT void registerRPMDOpenCLKernelFactories() {
try {
Platform::getPlatformByName("OpenCL");
}
catch (...) {
Platform::registerPlatform(new OpenCLPlatform());
}
registerKernelFactories();
}
KernelImpl* OpenCLRpmdKernelFactory::createKernelImpl(std::string name, const Platform& platform, ContextImpl& context) const {
OpenCLContext& cl = *static_cast<OpenCLPlatform::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 registerRPMDOpenCLKernelFactories();
void testFreeParticles() {
const int numParticles = 100;
const int numCopies = 30;
......@@ -223,7 +225,7 @@ void testParaHydrogen() {
int main(int argc, char* argv[]) {
try {
Platform::loadPluginsFromDirectory(Platform::getDefaultPluginsDirectory());
registerRPMDOpenCLKernelFactories();
if (argc > 1)
Platform::getPlatformByName("OpenCL").setPropertyDefaultValue("OpenCLPrecision", string(argv[1]));
testFreeParticles();
......
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