Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ if(NOT DEFINED QOCO_ALGEBRA_BACKEND)
set(QOCO_ALGEBRA_BACKEND "builtin" CACHE STRING "The Algebra to use")
endif()
message(STATUS "Using ${QOCO_ALGEBRA_BACKEND} algebra")
# Propagate backend choice to all targets
if(${QOCO_ALGEBRA_BACKEND} STREQUAL "cuda")
add_compile_definitions(QOCO_ALGEBRA_BACKEND_CUDA)
else()
add_compile_definitions(QOCO_ALGEBRA_BACKEND_BUILTIN)
endif()

# Enable CUDA if using CUDA backend
if(${QOCO_ALGEBRA_BACKEND} STREQUAL "cuda")
Expand Down
5 changes: 5 additions & 0 deletions algebra/builtin/builtin_linalg.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,15 @@ QOCOInt get_length_vectorf(const QOCOVectorf* x) { return x->len; }

// No-op for builtin backend
void sync_vector_to_host(QOCOVectorf* v) {}
// No-op for builtin backend
void sync_vector_to_device(const QOCOVectorf* v) {}

// No-op for builtin backend
void set_solve_phase(int active) {}

// No-op for builtin backend
void set_scaling_statistics_mode(int active) {}

QOCOCscMatrix* get_csc_matrix(const QOCOMatrix* M) { return M->csc; }

void col_inf_norm_USymm_matrix(const QOCOMatrix* M, QOCOFloat* norm)
Expand Down
2 changes: 1 addition & 1 deletion algebra/builtin/qdldl_backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ static void qdldl_solve(LinSysData* linsys_data, QOCOWorkspace* work,
x[linsys_data->p[k]] = linsys_data->xyzbuff1[k];
}

kkt_multiply(x, linsys_data->xyzbuff2, work->data, work->Wfull, work->xbuff,
kkt_multiply(x, linsys_data->xyzbuff2, work->data, work->Wfull, get_data_vectorf(work->xbuff),
work->ubuff1, work->ubuff2);
for (QOCOInt k = 0; k < linsys_data->K->n; ++k) {
x[k] = linsys_data->xyzbuff2[linsys_data->p[k]];
Expand Down
Loading
Loading