Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sshin23 committed Mar 6, 2024
1 parent ffad56f commit 2058da4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/MadNLPGPU/src/interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function MadNLP.coo_to_csc(coo::MadNLP.SparseMatrixCOO{T,I,VT,VI}) where {T,I, V
sort!(coord, lt = (((i, j), k), ((n, m), l)) -> (j,i) < (m,n))
end

mapptr = MadNLP.getptr(coord)
mapptr = MadNLP.getptr(coord; by = ((x1,x2),(y1,y2))->x1 != y1)

colptr = similar(coo.I, size(coo,2)+1)

Expand Down Expand Up @@ -225,7 +225,7 @@ end
function MadNLP._set_con_scale_sparse!(con_scale::VT, jac_I, jac_buffer) where {T, VT <: CuVector{T}}
if length(jac_I) > 0
inds = sort!(map((i,j)->(i,j), jac_I, 1:length(jac_I)))
ptr = MadNLP.getptr(inds)
ptr = MadNLP.getptr(inds; by = ((x1,x2),(y1,y2))->x1 != y1)
_set_con_scale_sparse_kernel!(CUDABackend())(con_scale, ptr, inds, jac_I, jac_buffer; ndrange=length(ptr)-1)
synchronize(CUDABackend())
end
Expand Down

0 comments on commit 2058da4

Please sign in to comment.