Skip to content

Commit a680727

Browse files
committed
Build cuda solver
1 parent 2937b8e commit a680727

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,21 @@ include(FetchContent)
2323
FetchContent_Declare(
2424
qoco
2525
GIT_REPOSITORY https://github.com/qoco-org/qoco.git
26-
GIT_TAG bbab0db3899f19331c5c8e9d31d68bbbb68704ae
26+
GIT_TAG b38e6dd0755508fae98a1fd1ed5cbdb283c5f157
2727
)
2828

2929
list(POP_BACK CMAKE_MESSAGE_INDENT)
3030
FetchContent_MakeAvailable(qoco)
3131

3232
pybind11_add_module(qoco_ext src/bindings.cpp)
3333
target_include_directories(qoco_ext INTERFACE ${qoco_SOURCE_DIR}/include)
34+
35+
if(${QOCO_ALGEBRA_BACKEND} STREQUAL "builtin")
3436
target_link_libraries(qoco_ext PUBLIC pybind11::module qocostatic)
37+
elseif(${QOCO_ALGEBRA_BACKEND} STREQUAL "cuda")
38+
enable_language(CUDA)
39+
find_package(CUDA)
40+
target_link_libraries(qoco_ext PUBLIC pybind11::module qocostatic cudart)
41+
endif()
42+
3543
install(TARGETS qoco_ext DESTINATION . COMPONENT python)

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "scikit_build_core.build"
44

55
[project]
66
name = "qoco"
7-
version = "0.1.7"
7+
version = "0.2.0"
88
description = "QOCO: Quadratic Objective Conic Optimizer"
99
readme = "README.md"
1010
requires-python = ">=3.8"
@@ -15,6 +15,9 @@ dependencies = ["jinja2", "numpy>=1.7", "qdldl", "scipy>=0.13.2", "setuptools"]
1515
install.components = ["python"]
1616
wheel.install-dir = "qoco"
1717

18+
[tool.scikit-build.cmake.define]
19+
QOCO_ALGEBRA_BACKEND = "cuda"
20+
1821
[project.urls]
1922
Homepage = "https://github.com/qoco-org/qoco"
2023
Issues = "https://github.com/qoco-org/qoco/issues"

0 commit comments

Comments
 (0)