JuliaGPU / CUDA.jl

CUDA programming in Julia.

Home Page:https://juliagpu.org/cuda/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot reset CuArray to zero

AhmedSalih3d opened this issue · comments

Describe the bug

I do the following code:

x = CuArray(ones(5)); fill!(x,zero(eltype(x)))

The fill! operation errors out:

ERROR: MethodError: no method matching length(::Nothing)

Closest candidates are:
  length(::Base.MethodSpecializations)
   @ Base reflection.jl:1166
  length(::LLVM.ConstantAggregateZero)
   @ LLVM C:\Users\-\.julia\packages\LLVM\HykgZ\src\core\value\constant.jl:146
  length(::Core.Compiler.InstructionStream)
   @ Base show.jl:2777

To reproduce

The Minimal Working Example (MWE) for this bug:

x = CuArray(ones(5)); fill!(x,zero(eltype(x)))

Expected behavior

Should be able to reset array to zero.

Version info

Details on Julia:

# please post the output of:
versioninfo()

Details on CUDA:

# please post the output of:
CUDA.versioninfo()
CUDA runtime 11.8, artifact installation
CUDA driver 12.4
Unknown NVIDIA driver

Libraries:
- CUBLAS: 11.11.3
- CURAND: 10.3.0
- CUFFT: 10.9.0
- CUSOLVER: 11.4.1
- CUSPARSE: 11.7.5
- CUPTI: 18.0.0
- NVML: missing

Toolchain:
- Julia: 1.10.0
- LLVM: 15.0.7
- PTX ISA support: 3.2, 4.0, 4.1, 4.2, 4.3, 5.0, 6.0, 6.1, 6.3, 6.4, 6.5, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5
- Device capability support: sm_35, sm_37, sm_50, sm_52, sm_53, sm_60, sm_61, sm_62, sm_70, sm_72, sm_75, sm_80, sm_86
versioninfo()
Julia Version 1.10.0
Commit 3120989f39 (2023-12-25 18:01 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel CPU
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, skylake)
  Threads: 5 on 8 virtual cores
Environment:
  JULIA_EDITOR = code
  JULIA_NUM_THREADS = 4

You're using outdated packages.

Thanks for clarifying!