Skip to content
Merged
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
1 change: 1 addition & 0 deletions src/solver.cu
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ static pdhg_solver_state_t *initialize_solver_state(const lp_problem_t *working_
(state->num_variables + state->num_constraints + THREADS_PER_BLOCK - 1) / THREADS_PER_BLOCK;
state->num_blocks_nnz = (state->constraint_matrix->num_nonzeros + THREADS_PER_BLOCK - 1) / THREADS_PER_BLOCK;

CUDA_CHECK(cudaFree(0));
CUSPARSE_CHECK(cusparseCreate(&state->sparse_handle));
CUBLAS_CHECK(cublasCreate(&state->blas_handle));
CUBLAS_CHECK(cublasSetPointerMode(state->blas_handle, CUBLAS_POINTER_MODE_HOST));
Expand Down
4 changes: 2 additions & 2 deletions src/utils.cu
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,8 @@ bool should_do_adaptive_restart(pdhg_solver_state_t *solver_state,
return reason != NULL;
}

// The context is created once per process; a later CUDA call on any thread
// waits for it inside the driver.
// The solver thread must initialize the runtime before creating cuSPARSE
// handles, which can otherwise race this background initialization.
void cupdlpx_gpu_init_async(void)
{
static std::once_flag once;
Expand Down
Loading