Commit 2cdb14ef authored by Christopher Bruns's avatar Christopher Bruns
Browse files

Improved capitalization in FindOpenCL.cmake, so QUIET keyword will be respected

Reorganized platform analysis in NML init method.
Failed attempt to get OPENMM_PLUGIN_DIR working for NML test.
parent ffc44a95
...@@ -16,12 +16,12 @@ else(ENV_OPENCL_DIR) ...@@ -16,12 +16,12 @@ else(ENV_OPENCL_DIR)
endif(ENV_OPENCL_DIR) endif(ENV_OPENCL_DIR)
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OPENCL DEFAULT_MSG OPENCL_LIBRARY OPENCL_INCLUDE_DIR) find_package_handle_standard_args(OpenCL DEFAULT_MSG OPENCL_LIBRARY OPENCL_INCLUDE_DIR)
if(OPENCL_FOUND) if(OpenCL_FOUND)
set(OPENCL_LIBRARIES ${OPENCL_LIBRARY}) set(OPENCL_LIBRARIES ${OPENCL_LIBRARY})
else(OPENCL_FOUND) else(OpenCL_FOUND)
set(OPENCL_LIBRARIES) set(OPENCL_LIBRARIES)
endif(OPENCL_FOUND) endif(OpenCL_FOUND)
mark_as_advanced(OPENCL_INCLUDE_DIR OPENCL_LIBRARY) mark_as_advanced(OPENCL_INCLUDE_DIR OPENCL_LIBRARY)
\ No newline at end of file
...@@ -38,12 +38,18 @@ using namespace std; ...@@ -38,12 +38,18 @@ using namespace std;
extern "C" void initOpenMMPlugin() { extern "C" void initOpenMMPlugin() {
cout << "Initializing Normal Mode Langevin OpenMM plugin..." << endl; cout << "Initializing Normal Mode Langevin OpenMM plugin..." << endl;
for (int p = 0; p < Platform::getNumPlatforms(); ++p) { // for (int p = 0; p < Platform::getNumPlatforms(); ++p) {
Platform& platform = Platform::getPlatform(p);
if (platform.getName() == "CudaPlatform") // Only register cuda kernels if cuda platform is found
// We don't have a Cuda one yet, but we will soon try {
platform.registerKernelFactory("ReferenceNMLKernelFactory", new ReferenceNMLKernelFactory()); Platform& platform = Platform::getPlatform("CudaPlatform");
else // platform.registerKernelFactory("CudaNMLKernelFactory", new CudaNMLKernelFactory());
} catch (std::exception exc) { // non fatal
}
try {
Platform& platform = Platform::getPlatform("ReferencePlatform");
platform.registerKernelFactory("ReferenceNMLKernelFactory", new ReferenceNMLKernelFactory()); platform.registerKernelFactory("ReferenceNMLKernelFactory", new ReferenceNMLKernelFactory());
} catch (std::exception exc) { // non fatal
} }
} }
...@@ -2,4 +2,6 @@ ...@@ -2,4 +2,6 @@
add_executable(TestNormalModeLangevin TestNormalModeLangevin.cpp) add_executable(TestNormalModeLangevin TestNormalModeLangevin.cpp)
target_link_libraries(TestNormalModeLangevin OpenMM) target_link_libraries(TestNormalModeLangevin OpenMM)
add_test(TestNormalModeLangevin ${EXECUTABLE_OUTPUT_PATH}/TestNormalModeLangevin) add_test(TestNormalModeLangevin ${EXECUTABLE_OUTPUT_PATH}/TestNormalModeLangevin)
set_tests_properties(TestNormalModeLangevin PROPERTIES ENVIRONMENT
"OPENMM_PLUGIN_DIR=\"${LIBRARY_OUTPUT_DIRECTORY}\""
)
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