Skip to content

Commit

Permalink
[MadNLPGPU] Remove the warning related to CUSOLVER (#401)
Browse files Browse the repository at this point in the history
  • Loading branch information
amontoison authored Jan 20, 2025
1 parent e310cf6 commit 3e522e3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 40 deletions.
47 changes: 8 additions & 39 deletions lib/MadNLPGPU/src/LinearSolvers/lapackgpu.jl
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ for (
potrf,
potrf_buffer,
potrs,
sytrs_buffer,
sytrs,
typ,
cutyp,
) in (
Expand All @@ -105,6 +107,8 @@ for (
:cusolverDnDpotrf,
:cusolverDnDpotrf_bufferSize,
:cusolverDnDpotrs,
:cusolverDnXsytrs_bufferSize,
:cusolverDnXsytrs,
Float64,
CUDA.R_64F,
),
Expand All @@ -122,6 +126,8 @@ for (
:cusolverDnSpotrf,
:cusolverDnSpotrf_bufferSize,
:cusolverDnSpotrs,
:cusolverDnXsytrs_bufferSize,
:cusolverDnXsytrs,
Float32,
CUDA.R_32F,
),
Expand Down Expand Up @@ -158,24 +164,7 @@ for (
function solve_bunchkaufman!(M::LapackGPUSolver{$typ}, x)
copyto!(M.etc[:ipiv64], M.etc[:ipiv])
copyto!(M.rhs, x)
ccall(
(:cusolverDnXsytrs_bufferSize, libcusolver),
cusolverStatus_t,
(
cusolverDnHandle_t,
cublasFillMode_t,
Int64,
Int64,
cudaDataType,
CuPtr{Cdouble},
Int64,
CuPtr{Int64},
cudaDataType,
CuPtr{Cdouble},
Int64,
Ptr{Int64},
Ptr{Int64},
),
CUSOLVER.$sytrs_buffer(
dense_handle(),
CUBLAS_FILL_MODE_LOWER,
size(M.fact, 1),
Expand All @@ -192,27 +181,7 @@ for (
)
length(M.work) < M.lwork[] && resize!(M.work, Int(M.lwork[]))
length(M.work_host) < M.lwork_host[] && resize!(work_host, Int(M.lwork_host[]))
ccall(
(:cusolverDnXsytrs, libcusolver),
cusolverStatus_t,
(
cusolverDnHandle_t,
cublasFillMode_t,
Int64,
Int64,
cudaDataType,
CuPtr{Cdouble},
Int64,
CuPtr{Int64},
cudaDataType,
CuPtr{Cdouble},
Int64,
CuPtr{Cdouble},
Int64,
Ptr{Cdouble},
Int64,
CuPtr{Int64},
),
CUSOLVER.$sytrs(
dense_handle(),
CUBLAS_FILL_MODE_LOWER,
size(M.fact, 1),
Expand Down
2 changes: 1 addition & 1 deletion lib/MadNLPGPU/src/MadNLPGPU.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import LinearAlgebra: Symmetric
import CUDA: CUDA, CUSPARSE, CUBLAS, CUSOLVER, CuVector, CuMatrix, CuArray, R_64F,
has_cuda, @allowscalar, runtime_version, CUDABackend
import .CUSOLVER:
libcusolver, cusolverStatus_t, CuPtr, cudaDataType, cublasFillMode_t, cusolverDnHandle_t, dense_handle
cusolverStatus_t, CuPtr, cudaDataType, cublasFillMode_t, cusolverDnHandle_t, dense_handle
import .CUBLAS: handle, CUBLAS_DIAG_NON_UNIT,
CUBLAS_FILL_MODE_LOWER, CUBLAS_FILL_MODE_UPPER, CUBLAS_SIDE_LEFT, CUBLAS_OP_N, CUBLAS_OP_T
import CUSOLVERRF
Expand Down

0 comments on commit 3e522e3

Please sign in to comment.