@@ -150,7 +150,7 @@ HighsStatus solveLpCupdlp(const HighsOptions& options, HighsTimer& timer,
150150 memcpy (csc_cpu->colMatElem , csc_val, nnz * sizeof (double ));
151151
152152 cupdlp_float scaling_time = getTimeStamp ();
153- H_PDHG_Scale_Data_cuda (local_log_level, csc_cpu, ifScaling, scaling, cost,
153+ PDHG_Scale_Data (local_log_level, csc_cpu, ifScaling, scaling, cost,
154154 lower, upper, rhs);
155155 scaling_time = getTimeStamp () - scaling_time;
156156
@@ -239,24 +239,20 @@ HighsStatus solveLpCupdlp(const HighsOptions& options, HighsTimer& timer,
239239 // free(csc_idx);
240240 // free(csc_val);
241241 // free(rhs);
242-
243242 // free(constraint_new_idx);
244243
245244 // Scaling
246- #ifdef CUPDLP_CPU
245+ // #ifdef CUPDLP_CPU
247246
248- if (scaling->rowScale != nullptr ) free (scaling->rowScale );
249- if (scaling->colScale != nullptr ) free (scaling->colScale );
250- free (scaling);
247+ // if (scaling->rowScale != nullptr) free(scaling->rowScale);
248+ // if (scaling->colScale != nullptr) free(scaling->colScale);
249+ // free(scaling);
251250
252- #else
253- // free problem
254- if (scaling) {
255- scaling_clear (scaling);
256- }
257- #endif
251+ // #else
258252
259- #ifdef CUPDLP_CPU
253+ // #endif
254+
255+ // #ifdef CUPDLP_CPU
260256 // free(prob->cost);
261257 // free(prob->lower);
262258 // free(prob->upper);
@@ -284,7 +280,12 @@ HighsStatus solveLpCupdlp(const HighsOptions& options, HighsTimer& timer,
284280 // free(csc_cpu->colMatElem);
285281
286282 // free(csc_cpu);
287- #endif
283+ // #endif
284+
285+ // free problem
286+ if (scaling) {
287+ scaling_clear (scaling);
288+ }
288289
289290 if (cost != NULL ) cupdlp_free (cost);
290291 if (csc_beg != NULL ) cupdlp_free (csc_beg);
@@ -294,13 +295,14 @@ HighsStatus solveLpCupdlp(const HighsOptions& options, HighsTimer& timer,
294295 if (lower != NULL ) cupdlp_free (lower);
295296 if (upper != NULL ) cupdlp_free (upper);
296297 if (constraint_new_idx != NULL ) cupdlp_free (constraint_new_idx);
297-
298- // constraint type is std::vector
299- // if (constraint_type != NULL) cupdlp_free(constraint_type);
298+ if (constraint_type != NULL ) cupdlp_free (constraint_type);
300299
301300 // free memory
302- csc_clear (csc_cpu);
301+ csc_clear_host (csc_cpu);
303302 problem_clear (prob);
303+ #if !(CUPDLP_CPU)
304+ CHECK_CUDA (cudaDeviceReset ())
305+ #endif
304306
305307 return HighsStatus::kOk ;
306308}
0 commit comments