Skip to content

ones function is not type-stable for CUDA #634

@bgctw

Description

@bgctw

On a machine with CUDA GPU, the following minimal example returns error
return type CUDA.CuArray{Float32, 1, CUDA.DeviceMemory} does not match inferred return type CUDA.CuArray{Float32, 1}

#Pkg.activate(;temp=true)
#Pkg.add(["CUDA","cuDNN","MLDataDevices","Test","KernelAbstractions"])
import CUDA, cuDNN
using MLDataDevices
using Test
using KernelAbstractions

gdev = gpu_device()
x = rand(2,3)
xd = gdev(x)
backend = @inferred get_backend(xd)
onevec = @inferred KernelAbstractions.ones(backend, eltype(xd), 2)

With Julia 1.11.4 and installed packages

  [052768ef] CUDA v5.8.3
  [63c18a36] KernelAbstractions v0.9.38
  [7e8f7934] MLDataDevices v1.11.2
  [02a925ec] cuDNN v1.4.5
  [8dfed614] Test v1.11.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions