CuMcCormick is a CUDA library for McCormick relaxations.
neg
add
sub
mul
div
sqr
sqrt
abs
fabs
exp
log
pown
pow
cos
asin
acos
atan
sinh
cosh
tanh
asinh
acosh
atanh
erf
erfc
max
min
mid
width
hull
+
-
*
/
==
!=
inf
sup
Please make sure that you have installed everything mentioned in the section Build Requirements.
git clone https://github.com/neilkichler/cumccormick.git
cd cumccormick
cmake --preset release
cmake --build build
cmake --install buildCPMAddPackage("gh:neilkichler/cumccormick@0.1.0")include(FetchContent)
FetchContent_Declare(
cumccormick
GIT_REPOSITORY https://github.com/neilkichler/cumccormick.git
GIT_TAG v0.1.0
)
FetchContent_MakeAvailable(cumccormick)In either case, you can link to the library using:
target_link_libraries(${PROJECT_NAME} PUBLIC cumccormick)Important
When using CUDA in a CMake project, make sure that it configures the CUDA_ARCHITECTURES property using
set_target_properties(${PROJECT_NAME} PROPERTIES CUDA_ARCHITECTURES native)where native could be replaced by specific versions, see the CMake docs for more information.
Have a look at the examples folder.
The documentation is available here.
We require C++20, CMake v3.25.2+, Ninja, and recent C++ and CUDA compilers.
apt install cmake gcc ninja-buildmodule load CMake CUDA GCC Ninjacmake --workflow --preset devcmake --preset debug
cmake --build --preset debug
ctest --preset debugcmake -S . -B build -GNinja
cmake --build build
./build/tests/tests