# How to call ssyevd

**URL:** <https://discourse.julialang.org/t/how-to-call-ssyevd/133496>\
**Category:** GPU\
**Tags:** amdgpu\
**Created:** [October 29, 2025, 4:32am UTC](https://discourse.julialang.org/t/how-to-call-ssyevd/133496 "2025-10-29T04:32:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![billmclean](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/billmclean/32/3790_2.png) [@billmclean](https://discourse.julialang.org/u/billmclean)\
**Post date:** [October 29, 2025, 4:32am UTC](https://discourse.julialang.org/t/how-to-call-ssyevd/133496/1 "2025-10-29T04:32:26Z")

</div>

I am trying to figure out how to call `rocsolver_ssyevd` to compute the eigenvalues of a symmetric matrix. If I run the code

```julia-auto
using AMDGPU
import AMDGPU.rocBLAS: rocblas_int, handle
import AMDGPU.rocSOLVER: rocsolver_ssyevd, rocblas_evect_original

n = rocblas_int(5)
A = randn(Float32, n, n)
rA = ROCArray(copy(A))

evect = rocblas_evect_original
uplo = 'U'
lda = n
D = ROCVector{Float32}(undef, n)
E = ROCArray{Float32}(undef, n, n)
info = Ptr{rocblas_int}(0)

status = rocsolver_ssyevd(handle(), evect, uplo, n, rA, lda, D, E, info)

```

then I get an error from the final line:

```julia-auto
ROCBLASError(code rocblas_status_invalid_pointer, invalid pointer parameter)

```

Looking at the source in `src/solver/librocsolver.jl:8250` I see

```julia-auto
function rocsolver_ssyevd(handle, evect, uplo, n, A, lda, D, E, info)
    AMDGPU.prepare_state()
    @check @ccall librocsolver.rocsolver_ssyevd(handle::rocblas_handle,
                                                evect::rocblas_evect,
                                                uplo::rocblas_fill, n::rocblas_int,
                                                A::Ptr{Cfloat},
                                                lda::rocblas_int, D::Ptr{Cfloat},
                                                E::Ptr{Cfloat},
                                                info::Ptr{rocblas_int})::rocblas_status
end

```

What am I doing wrong here?

---

<div class="post-metadata">

**Author:** ![amontoison](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/amontoison/32/218741_2.png) [@amontoison](https://discourse.julialang.org/u/amontoison)\
**Post date:** [November 8, 2025, 4:54pm UTC](https://discourse.julialang.org/t/how-to-call-ssyevd/133496/2 "2025-11-08T16:54:49Z")

</div>

@billmclean The issue in the size of `E`, it should be a vector of length `n`.  
Note that we have a more uer-friendly to call it with directly `syevd`:

> <https://github.com/JuliaGPU/AMDGPU.jl/blob/master/src/solver/highlevel.jl#L339-L374>

---

<div class="post-metadata">

**Author:** ![billmclean](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/billmclean/32/3790_2.png) [@billmclean](https://discourse.julialang.org/u/billmclean)\
**Post date:** [November 9, 2025, 10:21pm UTC](https://discourse.julialang.org/t/how-to-call-ssyevd/133496/3 "2025-11-09T22:21:54Z")

</div>

@amontoison Thanks for your response. I missed the high level function.
