Giuseppe,

The CUDA::Handle needs to live longer than the sparse matrix but in your
code it goes out-of-scope at the end of assemble_system(). I know the same
code works with assemble_matrix but it only works "by chance" because
nothing wrote over the memory. I don't know if that's the  only problem but
that's definitely wrong.

Best,

Bruno

Le lun. 17 juil. 2023 à 11:06, giuseppe orlando <giusor...@gmail.com> a
écrit :

> Here, you can find the two codes. 'SBR_GPU' is the one that arrives up to
> the end, whereas 'SBR_GPU_WRONG' is the one that stops with the error
> described above once I call 'output_results'. If the code is too long and
> can be helpful, I could try to reduce it avoiding ParameterHandler and
> other more 'advanced' stuff and to reduce everything to a unique file.
>
> Best,
>
> Giuseppe
>
> Il giorno lunedì 17 luglio 2023 alle 16:11:18 UTC+2 bruno.t...@gmail.com
> ha scritto:
>
>> Giuseppe,
>>
>> It's hard to tell what's wrong without seeing the code.
>>
>> Best,
>>
>> Bruno
>>
>> On Monday, July 17, 2023 at 9:04:42 AM UTC-4 gius...@gmail.com wrote:
>>
>>> Hello everyone,
>>> I'm writing this post to ask some help for a CUDA code. I have
>>> implemented a matrix-based CUDA coda for the so-called solid body rotation,
>>> namely a time dependent advection problem. In my first implementation, I
>>> encapulased the computation of the matrix and of the right-hand side of the
>>> resulting linear system in the same routine ('assemble_system'). Then, I
>>> tried to separate the assembling of the matrix ('assemble_matrix') and of
>>> the rhs ('assemble_rhs'). Since the matrix does not change (I am using an
>>> explicit time integration scheme and, therefore, the resulting matrix is a
>>> mass matrix), I compute it at the beginning and then I just update the
>>> right-hand side. Everything works until I save the results, after which I
>>> obtain this error ("On entry to cusparseSpMV() parameter number 1 (handle)
>>> had an illegal value: invalid pointer mode").
>>> I also tried to create an auxiliary vector just for saving, but nothing
>>> changes.
>>> Everything runs with 1 GPU. Have anyone ever obtained this kind of
>>> issue? If it can help, I can share the two versions of the code.
>>>
>>> Thanks in advance
>>>
>>> Best
>>>
>>> Giuseppe
>>>
>> --
> The deal.II project is located at http://www.dealii.org/
> For mailing list/forum options, see
> https://groups.google.com/d/forum/dealii?hl=en
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "deal.II User Group" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/dealii/p5eZs3NaGRk/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> dealii+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/dealii/9d079799-6b51-46f6-8564-8058877e83d7n%40googlegroups.com
> <https://groups.google.com/d/msgid/dealii/9d079799-6b51-46f6-8564-8058877e83d7n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/CAGVt9eO1N7zVGKzuKz581DBx3Axj8fJBD2vMMiq12edBkXy1Kw%40mail.gmail.com.

Reply via email to