# GPU Error in Julia 1.6 but not in Julia 1.5

**URL:** <https://discourse.julialang.org/t/gpu-error-in-julia-1-6-but-not-in-julia-1-5/69440>\
**Category:** GPU\
**Created:** [October 8, 2021, 3:06pm UTC](https://discourse.julialang.org/t/gpu-error-in-julia-1-6-but-not-in-julia-1-5/69440 "2021-10-08T15:06:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![PGJulia](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pgjulia/32/29769_2.png) [@PGJulia](https://discourse.julialang.org/u/PGJulia)\
**Post date:** [October 8, 2021, 3:06pm UTC](https://discourse.julialang.org/t/gpu-error-in-julia-1-6-but-not-in-julia-1-5/69440/1 "2021-10-08T15:06:34Z")

</div>

Hi,

The following kernel works in Julia 1.5.3 but not in Julia 1.6.3. I believe it is related to CUDA.exp but I tried directly with exp() w/o success.

function vr(Nb,Ny,α,β,τ,Vr,V0,Y,B,Price0,P)

```
ib = (blockIdx().x-1)*blockDim().x + threadIdx().x
iy = (blockIdx().y-1)*blockDim().y + threadIdx().y

if (ib <= Nb && iy <= Ny)

    Max = -Inf
    for b in 1:Nb
        c = CUDA.exp(Y[iy]) + B[ib] - Price0[iy,b]*B[b]
        if c > 0 #If consumption positive, calculate value of return
            sumret = 0
            for y in 1:Ny
                sumret += V0[y,b]*P[iy,y]
            end

            vr = CUDA.pow(c,(1-α))/(1-α) + β * sumret
            Max = CUDA.max(Max, vr)
        end
    end
    Vr[iy,ib] = Max
end
return

```

end

---

<div class="post-metadata">

**Author:** ![luraess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/luraess/32/16189_2.png) [@luraess](https://discourse.julialang.org/u/luraess)\
**Post date:** [October 8, 2021, 3:21pm UTC](https://discourse.julialang.org/t/gpu-error-in-julia-1-6-but-not-in-julia-1-5/69440/2 "2021-10-08T15:21:33Z")

</div>

Hi, `CUDA.pow()` is replaced by `^` since CUDA v3.0 (thus Julia 1.6), I’d say ([ref](https://juliagpu.org/post/2021-04-09-cuda_3.0/#gpu_method_overrides) - [here](https://github.com/JuliaGPU/CUDA.jl/blob/master/src/device/intrinsics/math.jl) the full intrinsics list).

---

<div class="post-metadata">

**Author:** ![PGJulia](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pgjulia/32/29769_2.png) [@PGJulia](https://discourse.julialang.org/u/PGJulia)\
**Post date:** [October 8, 2021, 7:15pm UTC](https://discourse.julialang.org/t/gpu-error-in-julia-1-6-but-not-in-julia-1-5/69440/3 "2021-10-08T19:15:50Z")

</div>

Thanks!

---

<div class="post-metadata">

**Author:** ![maleadt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maleadt/32/10097_2.png) [@maleadt](https://discourse.julialang.org/u/maleadt)\
**Post date:** [October 8, 2021, 8:53pm UTC](https://discourse.julialang.org/t/gpu-error-in-julia-1-6-but-not-in-julia-1-5/69440/4 "2021-10-08T20:53:34Z")

</div>

Same with `max`, `exp`; you can now just use the Base function (or the one from SpecialFunctions in some other cases).
