Skip to content

Commit b659e36

Browse files
authored
Created HIP platform (#157)
* Converted OpenCL to common platform * Fixed cmake error * Fixed cmake error * Created HIP platform * Update macOS target version
1 parent 681adc2 commit b659e36

18 files changed

+527
-12387
lines changed

CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,21 @@ IF(NN_BUILD_CUDA_LIB)
141141
ADD_SUBDIRECTORY(platforms/cuda)
142142
ENDIF(NN_BUILD_CUDA_LIB)
143143

144+
LIST(APPEND CMAKE_PREFIX_PATH $ENV{ROCM_PATH} /opt/rocm)
145+
FIND_PACKAGE(HIP CONFIG QUIET)
146+
IF(HIP_FOUND)
147+
SET(NN_BUILD_HIP_LIB ON CACHE BOOL "Build implementation for HIP")
148+
ELSE(HIP_FOUND)
149+
SET(NN_BUILD_HIP_LIB OFF CACHE BOOL "Build implementation for HIP")
150+
ENDIF(HIP_FOUND)
151+
IF(NN_BUILD_HIP_LIB)
152+
ADD_SUBDIRECTORY(platforms/hip)
153+
ENDIF(NN_BUILD_HIP_LIB)
154+
155+
IF(NN_BUILD_OPENCL_LIB OR NN_BUILD_CUDA_LIB OR NN_BUILD_HIP_LIB)
156+
ADD_SUBDIRECTORY(platforms/common)
157+
ENDIF()
158+
144159
# Build the Python API
145160

146161
FIND_PROGRAM(PYTHON_EXECUTABLE python)

devtools/scripts/install_macos_sdk.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
# depending on the version provided by the CI
99

1010
OSX_SDK_DIR="$(xcode-select -p)/Platforms/MacOSX.platform/Developer/SDKs"
11-
export MACOSX_DEPLOYMENT_TARGET=10.9
12-
export MACOSX_SDK_VERSION=10.9
11+
export MACOSX_DEPLOYMENT_TARGET=10.13
12+
export MACOSX_SDK_VERSION=10.13
1313

1414
export CMAKE_OSX_SYSROOT="${OSX_SDK_DIR}/MacOSX${MACOSX_SDK_VERSION}.sdk"
1515

platforms/common/CMakeLists.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Encode the kernel sources into a C++ class.
2+
3+
SET(KERNEL_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
4+
SET(KERNEL_SOURCE_CLASS CommonTorchKernelSources)
5+
SET(KERNELS_CPP ${CMAKE_CURRENT_BINARY_DIR}/src/${KERNEL_SOURCE_CLASS}.cpp)
6+
SET(KERNELS_H ${CMAKE_CURRENT_BINARY_DIR}/src/${KERNEL_SOURCE_CLASS}.h)
7+
SET(SOURCE_FILES ${SOURCE_FILES} ${KERNELS_CPP} ${KERNELS_H})
8+
INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/src)
9+
FILE(GLOB COMMON_KERNELS ${KERNEL_SOURCE_DIR}/kernels/*.cc)
10+
ADD_CUSTOM_COMMAND(OUTPUT ${KERNELS_CPP} ${KERNELS_H}
11+
COMMAND ${CMAKE_COMMAND}
12+
ARGS -D KERNEL_SOURCE_DIR=${KERNEL_SOURCE_DIR} -D KERNELS_CPP=${KERNELS_CPP} -D KERNELS_H=${KERNELS_H} -D KERNEL_SOURCE_CLASS=${KERNEL_SOURCE_CLASS} -P ${CMAKE_SOURCE_DIR}/platforms/common/EncodeKernelFiles.cmake
13+
DEPENDS ${COMMON_KERNELS}
14+
)
15+
SET_SOURCE_FILES_PROPERTIES(${KERNELS_CPP} ${KERNELS_H} ${COMMON_KERNELS_CPP} PROPERTIES GENERATED TRUE)
16+
ADD_CUSTOM_TARGET(CommonKernels DEPENDS ${KERNELS_CPP} ${KERNELS_H})
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
FILE(GLOB OPENCL_KERNELS ${CL_SOURCE_DIR}/kernels/*.cl)
2-
SET(CL_FILE_DECLARATIONS)
3-
SET(CL_FILE_DEFINITIONS)
4-
CONFIGURE_FILE(${CL_SOURCE_DIR}/${CL_SOURCE_CLASS}.cpp.in ${CL_KERNELS_CPP})
5-
FOREACH(file ${OPENCL_KERNELS})
1+
FILE(GLOB COMMON_KERNELS ${KERNEL_SOURCE_DIR}/kernels/*.cc)
2+
SET(FILE_DECLARATIONS)
3+
SET(FILE_DEFINITIONS)
4+
CONFIGURE_FILE(${KERNEL_SOURCE_DIR}/${KERNEL_SOURCE_CLASS}.cpp.in ${KERNELS_CPP})
5+
FOREACH(file ${COMMON_KERNELS})
66
# Load the file contents and process it.
77
FILE(STRINGS ${file} file_content NEWLINE_CONSUME)
88
# Replace all backslashes by double backslashes as they are being put in a C string.
@@ -15,13 +15,13 @@ FOREACH(file ${OPENCL_KERNELS})
1515
STRING(REPLACE "\n" "\\n\"\n\"" file_content "${file_content}")
1616

1717
# Determine a name for the variable that will contain this file's contents
18-
FILE(RELATIVE_PATH filename ${CL_SOURCE_DIR}/kernels ${file})
18+
FILE(RELATIVE_PATH filename ${KERNEL_SOURCE_DIR}/kernels ${file})
1919
STRING(LENGTH ${filename} filename_length)
2020
MATH(EXPR filename_length ${filename_length}-3)
2121
STRING(SUBSTRING ${filename} 0 ${filename_length} variable_name)
2222

2323
# Record the variable declaration and definition.
24-
SET(CL_FILE_DECLARATIONS ${CL_FILE_DECLARATIONS}static\ const\ std::string\ ${variable_name};\n)
25-
FILE(APPEND ${CL_KERNELS_CPP} const\ string\ ${CL_SOURCE_CLASS}::${variable_name}\ =\ \"${file_content}\"\;\n)
24+
SET(FILE_DECLARATIONS ${FILE_DECLARATIONS}static\ const\ std::string\ ${variable_name};\n)
25+
FILE(APPEND ${KERNELS_CPP} const\ string\ ${KERNEL_SOURCE_CLASS}::${variable_name}\ =\ \"${file_content}\"\;\n)
2626
ENDFOREACH(file)
27-
CONFIGURE_FILE(${CL_SOURCE_DIR}/${CL_SOURCE_CLASS}.h.in ${CL_KERNELS_H})
27+
CONFIGURE_FILE(${KERNEL_SOURCE_DIR}/${KERNEL_SOURCE_CLASS}.h.in ${KERNELS_H})

platforms/opencl/src/OpenCLTorchKernelSources.cpp.in renamed to platforms/common/src/CommonTorchKernelSources.cpp.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Biological Structures at Stanford, funded under the NIH Roadmap for *
77
* Medical Research, grant U54 GM072970. See https://simtk.org. *
88
* *
9-
* Portions copyright (c) 2018 Stanford University and the Authors. *
9+
* Portions copyright (c) 2024 Stanford University and the Authors. *
1010
* Authors: Peter Eastman *
1111
* Contributors: *
1212
* *
@@ -29,7 +29,7 @@
2929
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
3030
* -------------------------------------------------------------------------- */
3131

32-
#include "OpenCLTorchKernelSources.h"
32+
#include "CommonTorchKernelSources.h"
3333

3434
using namespace TorchPlugin;
3535
using namespace std;

platforms/opencl/src/OpenCLTorchKernelSources.h.in renamed to platforms/common/src/CommonTorchKernelSources.h.in

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef OPENMM_OPENCL_TORCH_KERNEL_SOURCES_H_
2-
#define OPENMM_OPENCL_TORCH_KERNEL_SOURCES_H_
1+
#ifndef OPENMM_COMMON_TORCH_KERNEL_SOURCES_H_
2+
#define OPENMM_COMMON_TORCH_KERNEL_SOURCES_H_
33

44
/* -------------------------------------------------------------------------- *
55
* OpenMM *
@@ -9,7 +9,7 @@
99
* Biological Structures at Stanford, funded under the NIH Roadmap for *
1010
* Medical Research, grant U54 GM072970. See https://simtk.org. *
1111
* *
12-
* Portions copyright (c) 2018 Stanford University and the Authors. *
12+
* Portions copyright (c) 2024 Stanford University and the Authors. *
1313
* Authors: Peter Eastman *
1414
* Contributors: *
1515
* *
@@ -37,16 +37,16 @@
3737
namespace TorchPlugin {
3838

3939
/**
40-
* This class is a central holding place for the source code of OpenCL kernels.
41-
* The CMake build script inserts declarations into it based on the .cl files in the
40+
* This class is a central holding place for the source code of Common kernels.
41+
* The CMake build script inserts declarations into it based on the .cc files in the
4242
* kernels subfolder.
4343
*/
4444

45-
class OpenCLTorchKernelSources {
45+
class CommonTorchKernelSources {
4646
public:
47-
@CL_FILE_DECLARATIONS@
47+
@FILE_DECLARATIONS@
4848
};
4949

5050
} // namespace NNePlugin
5151

52-
#endif /*OPENMM_OPENCL_TORCH_KERNEL_SOURCES_H_*/
52+
#endif /*OPENMM_COMMON_TORCH_KERNEL_SOURCES_H_*/

platforms/opencl/src/OpenCLTorchKernels.cpp renamed to platforms/common/src/CommonTorchKernels.cpp

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -29,61 +29,71 @@
2929
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
3030
* -------------------------------------------------------------------------- */
3131

32-
#include "OpenCLTorchKernels.h"
33-
#include "OpenCLTorchKernelSources.h"
32+
#include "CommonTorchKernels.h"
33+
#include "CommonTorchKernelSources.h"
3434
#include "openmm/internal/ContextImpl.h"
3535
#include <map>
3636

3737
using namespace TorchPlugin;
3838
using namespace OpenMM;
3939
using namespace std;
4040

41-
OpenCLCalcTorchForceKernel::~OpenCLCalcTorchForceKernel() {
41+
CommonCalcTorchForceKernel::~CommonCalcTorchForceKernel() {
4242
}
4343

44-
void OpenCLCalcTorchForceKernel::initialize(const System& system, const TorchForce& force, torch::jit::script::Module& module) {
44+
void CommonCalcTorchForceKernel::initialize(const System& system, const TorchForce& force, torch::jit::script::Module& module) {
4545
this->module = module;
4646
usePeriodic = force.usesPeriodicBoundaryConditions();
4747
outputsForces = force.getOutputsForces();
4848
for (int i = 0; i < force.getNumGlobalParameters(); i++)
4949
globalNames.push_back(force.getGlobalParameterName(i));
5050
for (int i = 0; i < force.getNumEnergyParameterDerivatives(); i++) {
5151
paramDerivs.insert(force.getEnergyParameterDerivativeName(i));
52-
cl.addEnergyParameterDerivative(force.getEnergyParameterDerivativeName(i));
52+
cc.addEnergyParameterDerivative(force.getEnergyParameterDerivativeName(i));
5353
}
5454
int numParticles = system.getNumParticles();
5555

56-
// Inititalize OpenCL objects.
56+
// Inititalize Common objects.
5757

58+
if (torch::cuda::is_available()) {
59+
const torch::Device device(torch::kCUDA, 0); // This implicitly initializes PyTorch
60+
this->module.to(device);
61+
}
5862
this->module.eval();
5963
this->module = torch::jit::freeze(this->module);
6064
map<string, string> defines;
61-
if (cl.getUseDoublePrecision()) {
62-
networkForces.initialize<double>(cl, 3*numParticles, "networkForces");
65+
if (cc.getUseDoublePrecision()) {
66+
networkForces.initialize<double>(cc, 3*numParticles, "networkForces");
6367
defines["FORCES_TYPE"] = "double";
6468
}
6569
else {
66-
networkForces.initialize<float>(cl, 3*numParticles, "networkForces");
70+
networkForces.initialize<float>(cc, 3*numParticles, "networkForces");
6771
defines["FORCES_TYPE"] = "float";
6872
}
69-
cl::Program program = cl.createProgram(OpenCLTorchKernelSources::torchForce, defines);
70-
addForcesKernel = cl::Kernel(program, "addForces");
73+
ComputeProgram program = cc.compileProgram(CommonTorchKernelSources::torchForce, defines);
74+
addForcesKernel = program->createKernel("addForces");
75+
addForcesKernel->addArg(networkForces);
76+
addForcesKernel->addArg(cc.getLongForceBuffer());
77+
addForcesKernel->addArg(cc.getAtomIndexArray());
78+
addForcesKernel->addArg(numParticles);
79+
addForcesKernel->addArg();
80+
addForcesKernel->addArg();
7181
}
7282

73-
double OpenCLCalcTorchForceKernel::execute(ContextImpl& context, bool includeForces, bool includeEnergy) {
83+
double CommonCalcTorchForceKernel::execute(ContextImpl& context, bool includeForces, bool includeEnergy) {
7484
vector<Vec3> pos;
7585
context.getPositions(pos);
76-
int numParticles = cl.getNumAtoms();
86+
int numParticles = cc.getNumAtoms();
7787
torch::Tensor posTensor = torch::from_blob(pos.data(), {numParticles, 3}, torch::kFloat64);
78-
if (!cl.getUseDoublePrecision())
88+
if (!cc.getUseDoublePrecision())
7989
posTensor = posTensor.to(torch::kFloat32);
8090
posTensor.set_requires_grad(true);
8191
vector<torch::jit::IValue> inputs = {posTensor};
8292
if (usePeriodic) {
8393
Vec3 box[3];
84-
cl.getPeriodicBoxVectors(box[0], box[1], box[2]);
94+
cc.getPeriodicBoxVectors(box[0], box[1], box[2]);
8595
torch::Tensor boxTensor = torch::from_blob(box, {3, 3}, torch::kFloat64);
86-
if (!cl.getUseDoublePrecision())
96+
if (!cc.getUseDoublePrecision())
8797
boxTensor = boxTensor.to(torch::kFloat32);
8898
inputs.push_back(boxTensor);
8999
}
@@ -110,7 +120,7 @@ double OpenCLCalcTorchForceKernel::execute(ContextImpl& context, bool includeFor
110120
forceTensor = posTensor.grad();
111121
hasComputedBackward = true;
112122
}
113-
if (cl.getUseDoublePrecision()) {
123+
if (cc.getUseDoublePrecision()) {
114124
if (!(forceTensor.dtype() == torch::kFloat64))
115125
forceTensor = forceTensor.to(torch::kFloat64);
116126
double* data = forceTensor.data_ptr<double>();
@@ -122,14 +132,11 @@ double OpenCLCalcTorchForceKernel::execute(ContextImpl& context, bool includeFor
122132
float* data = forceTensor.data_ptr<float>();
123133
networkForces.upload(data);
124134
}
125-
addForcesKernel.setArg<cl::Buffer>(0, networkForces.getDeviceBuffer());
126-
addForcesKernel.setArg<cl::Buffer>(1, cl.getForceBuffers().getDeviceBuffer());
127-
addForcesKernel.setArg<cl::Buffer>(2, cl.getAtomIndexArray().getDeviceBuffer());
128-
addForcesKernel.setArg<cl_int>(3, numParticles);
129-
addForcesKernel.setArg<cl_int>(4, outputsForces ? 1 : -1);
130-
cl.executeKernel(addForcesKernel, numParticles);
135+
addForcesKernel->setArg(4, cc.getPaddedNumAtoms());
136+
addForcesKernel->setArg(5, outputsForces ? 1 : -1);
137+
addForcesKernel->execute(numParticles);
131138
}
132-
map<string, double>& energyParamDerivs = cl.getEnergyParamDerivWorkspace();
139+
map<string, double>& energyParamDerivs = cc.getEnergyParamDerivWorkspace();
133140
for (const string& name : paramDerivs) {
134141
if (!hasComputedBackward) {
135142
energyTensor.backward();

platforms/opencl/src/OpenCLTorchKernels.h renamed to platforms/common/src/CommonTorchKernels.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef OPENCL_TORCH_KERNELS_H_
2-
#define OPENCL_TORCH_KERNELS_H_
1+
#ifndef COMMON_TORCH_KERNELS_H_
2+
#define COMMON_TORCH_KERNELS_H_
33

44
/* -------------------------------------------------------------------------- *
55
* OpenMM *
@@ -33,21 +33,21 @@
3333
* -------------------------------------------------------------------------- */
3434

3535
#include "TorchKernels.h"
36-
#include "openmm/opencl/OpenCLContext.h"
37-
#include "openmm/opencl/OpenCLArray.h"
36+
#include "openmm/common/ComputeContext.h"
37+
#include "openmm/common/ComputeArray.h"
3838
#include <set>
3939

4040
namespace TorchPlugin {
4141

4242
/**
4343
* This kernel is invoked by TorchForce to calculate the forces acting on the system and the energy of the system.
4444
*/
45-
class OpenCLCalcTorchForceKernel : public CalcTorchForceKernel {
45+
class CommonCalcTorchForceKernel : public CalcTorchForceKernel {
4646
public:
47-
OpenCLCalcTorchForceKernel(std::string name, const OpenMM::Platform& platform, OpenMM::OpenCLContext& cl) :
48-
CalcTorchForceKernel(name, platform), hasInitializedKernel(false), cl(cl) {
47+
CommonCalcTorchForceKernel(std::string name, const OpenMM::Platform& platform, OpenMM::ComputeContext& cc) :
48+
CalcTorchForceKernel(name, platform), hasInitializedKernel(false), cc(cc) {
4949
}
50-
~OpenCLCalcTorchForceKernel();
50+
~CommonCalcTorchForceKernel();
5151
/**
5252
* Initialize the kernel.
5353
*
@@ -67,15 +67,15 @@ class OpenCLCalcTorchForceKernel : public CalcTorchForceKernel {
6767
double execute(OpenMM::ContextImpl& context, bool includeForces, bool includeEnergy);
6868
private:
6969
bool hasInitializedKernel;
70-
OpenMM::OpenCLContext& cl;
70+
OpenMM::ComputeContext& cc;
7171
torch::jit::script::Module module;
7272
std::vector<std::string> globalNames;
7373
std::set<std::string> paramDerivs;
7474
bool usePeriodic, outputsForces;
75-
OpenMM::OpenCLArray networkForces;
76-
cl::Kernel addForcesKernel;
75+
OpenMM::ComputeArray networkForces;
76+
OpenMM::ComputeKernel addForcesKernel;
7777
};
7878

7979
} // namespace TorchPlugin
8080

81-
#endif /*OPENCL_TORCH_KERNELS_H_*/
81+
#endif /*COMMON_TORCH_KERNELS_H_*/
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
KERNEL void addForces(GLOBAL const FORCES_TYPE* RESTRICT grads, GLOBAL mm_long* RESTRICT forceBuffers, GLOBAL int* RESTRICT atomIndex, int numAtoms, int paddedNumAtoms, int forceSign) {
2+
for (int atom = GLOBAL_ID; atom < numAtoms; atom += GLOBAL_SIZE) {
3+
int index = atomIndex[atom];
4+
forceBuffers[atom] += realToFixedPoint(forceSign*grads[3*index]);
5+
forceBuffers[atom+paddedNumAtoms] += realToFixedPoint(forceSign*grads[3*index+1]);
6+
forceBuffers[atom+2*paddedNumAtoms] += realToFixedPoint(forceSign*grads[3*index+2]);
7+
}
8+
}

platforms/hip/CMakeLists.txt

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#---------------------------------------------------
2+
# OpenMM Torch Plugin HIP Platform
3+
#----------------------------------------------------
4+
5+
# Collect up information about the version of the OpenMM library we're building
6+
# and make it available to the code so it can be built into the binaries.
7+
8+
SET(NN_HIP_LIBRARY_NAME OpenMMTorchHIP)
9+
10+
SET(SHARED_TARGET ${NN_HIP_LIBRARY_NAME})
11+
12+
13+
# These are all the places to search for header files which are
14+
# to be part of the API.
15+
SET(API_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/include" "${CMAKE_CURRENT_SOURCE_DIR}/include/internal")
16+
17+
# Locate header files.
18+
SET(API_INCLUDE_FILES)
19+
FOREACH(dir ${API_INCLUDE_DIRS})
20+
FILE(GLOB fullpaths ${dir}/*.h)
21+
SET(API_INCLUDE_FILES ${API_INCLUDE_FILES} ${fullpaths})
22+
ENDFOREACH(dir)
23+
24+
# collect up source files
25+
SET(SOURCE_FILES) # empty
26+
SET(SOURCE_INCLUDE_FILES)
27+
28+
FILE(GLOB_RECURSE src_files ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/${subdir}/src/*.c ${CMAKE_CURRENT_SOURCE_DIR}/../common/src/*.cpp)
29+
FILE(GLOB incl_files ${CMAKE_CURRENT_SOURCE_DIR}/src/*.h)
30+
SET(SOURCE_FILES ${SOURCE_FILES} ${src_files}) #append
31+
SET(SOURCE_INCLUDE_FILES ${SOURCE_INCLUDE_FILES} ${incl_files})
32+
INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include)
33+
34+
INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/src)
35+
INCLUDE_DIRECTORIES(BEFORE ${CMAKE_SOURCE_DIR}/platforms/hip/include)
36+
INCLUDE_DIRECTORIES(BEFORE ${CMAKE_SOURCE_DIR}/platforms/hip/src)
37+
INCLUDE_DIRECTORIES(BEFORE ${CMAKE_BINARY_DIR}/platforms/hip/src)
38+
INCLUDE_DIRECTORIES(BEFORE ${CMAKE_SOURCE_DIR}/platforms/common/src)
39+
INCLUDE_DIRECTORIES(BEFORE ${CMAKE_BINARY_DIR}/platforms/common/src)
40+
41+
# Set variables needed for encoding kernel sources into a C++ class
42+
43+
SET(CL_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
44+
SET(COMMON_KERNELS_CPP ${CMAKE_CURRENT_BINARY_DIR}/../common/src/CommonTorchKernelSources.cpp)
45+
SET(SOURCE_FILES ${SOURCE_FILES} ${COMMON_KERNELS_CPP})
46+
INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/src)
47+
SET_SOURCE_FILES_PROPERTIES(${COMMON_KERNELS_CPP} PROPERTIES GENERATED TRUE)
48+
49+
# Create the library
50+
51+
INCLUDE_DIRECTORIES(${HIP_INCLUDE_DIR})
52+
ADD_LIBRARY(${SHARED_TARGET} SHARED ${SOURCE_FILES} ${SOURCE_INCLUDE_FILES} ${API_INCLUDE_FILES})
53+
ADD_DEPENDENCIES(${SHARED_TARGET} CommonKernels)
54+
55+
TARGET_LINK_LIBRARIES(${SHARED_TARGET} ${HIP_LIBRARIES})
56+
TARGET_LINK_LIBRARIES(${SHARED_TARGET} OpenMM)
57+
TARGET_LINK_LIBRARIES(${SHARED_TARGET} OpenMMHIP)
58+
TARGET_LINK_LIBRARIES(${SHARED_TARGET} ${SHARED_NN_TARGET})
59+
SET_TARGET_PROPERTIES(${SHARED_TARGET} PROPERTIES
60+
COMPILE_FLAGS "-DOPENMM_BUILDING_SHARED_LIBRARY ${EXTRA_COMPILE_FLAGS}"
61+
LINK_FLAGS "${EXTRA_COMPILE_FLAGS}")
62+
63+
INSTALL(TARGETS ${SHARED_TARGET} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/plugins)
64+
65+
SUBDIRS (tests)
66+

0 commit comments

Comments
 (0)