# MethodError: Convert Ref value between GPU and CPU

**URL:** <https://discourse.julialang.org/t/methoderror-convert-ref-value-between-gpu-and-cpu/94426>\
**Category:** Performance\
**Created:** [February 10, 2023, 7:07pm UTC](https://discourse.julialang.org/t/methoderror-convert-ref-value-between-gpu-and-cpu/94426 "2023-02-10T19:07:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ahmed\_Salih](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ahmed_salih/32/206579_2.png) [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Post date:** [February 10, 2023, 7:07pm UTC](https://discourse.julialang.org/t/methoderror-convert-ref-value-between-gpu-and-cpu/94426/1 "2023-02-10T19:07:45Z")

</div>

Can anyone teach me how to overload the convert function to remove this error, using CUDA?

```julia
MethodError: Cannot `convert` an object of type CUDA.CuRefValue{Int64} to an object of type Base.RefValue{Int64}

```

Kind regards
