Skip to content

Commit

Permalink
wip merge more from original cuda branch, compile error atm. do diff …
Browse files Browse the repository at this point in the history
…again
  • Loading branch information
galabovaa committed Nov 13, 2024
1 parent f9d400f commit 80bcf7e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/pdlp/CupdlpWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,12 @@ HighsStatus solveLpCupdlp(const HighsOptions& options, HighsTimer& timer,
CUPDLP_COPY_VEC(w->colScale, scaling->colScale, cupdlp_float, nCols);
#endif

#ifdef CUPDLP_GPU
w->timers->AllocMem_CopyMatToDeviceTime += alloc_matrix_time;
w->timers->CopyVecToDeviceTime += copy_vec_time;
w->timers->CudaPrepareTime = cuda_prepare_time;
#endif

// CUPDLP_CALL(LP_SolvePDHG(prob, cupdlp_NULL, cupdlp_NULL, cupdlp_NULL,
// cupdlp_NULL));
// CUPDLP_CALL(LP_SolvePDHG(prob, ifChangeIntParam, intParam,
Expand Down Expand Up @@ -478,6 +484,11 @@ cupdlp_retcode data_alloc(CUPDLPdata* data, cupdlp_int nRows, cupdlp_int nCols,
data->csr_matrix = cupdlp_NULL;
data->csc_matrix = cupdlp_NULL;
data->device = CPU;
#ifdef CUPDLP_CPU
data->device = CPU;
#else
data->device = SINGLE_GPU;
#endif

switch (dst_matrix_format) {
case DENSE:
Expand Down Expand Up @@ -549,10 +560,18 @@ cupdlp_retcode problem_alloc(
infNorm(((CUPDLPcsc*)matrix)->colMatElem, ((CUPDLPcsc*)matrix)->nMatElem);

begin = getTimeStamp();
#ifndef CUPDLP_GPU
cupdlp_copy_vec(prob->cost, cost, cupdlp_float, nCols);
cupdlp_copy_vec(prob->rhs, rhs, cupdlp_float, nRows);
cupdlp_copy_vec(prob->lower, lower, cupdlp_float, nCols);
cupdlp_copy_vec(prob->upper, upper, cupdlp_float, nCols);
#else
cupdlp_copy_vec_cuda(prob->cost, cost, cupdlp_float, nCols);
cupdlp_copy_vec_cuda(prob->rhs, rhs, cupdlp_float, nRows);
cupdlp_copy_vec_cuda(prob->lower, lower, cupdlp_float, nCols);
cupdlp_copy_vec_cuda(prob->upper, upper, cupdlp_float, nCols);
#endif

*copy_vec_time = getTimeStamp() - begin;

// Keep
Expand Down

0 comments on commit 80bcf7e

Please sign in to comment.