Skip to content

CUDA.ones() and CUDA.fill() return incorrect values when working with VSCode #2139

@AssafLS

Description

@AssafLS

When working with CUDA.jl using VSCode with Julia 1.6 or 1.6.1
We get incorrect values when calling CUDA.ones() and CUDA.fill()

Looks like a problem with the Julia VSCode extension when working specifically with Julia 1.6 / 1.6.1.

  • This does not reproduce when working with VSCode on earlier versions of Julia (we tried 1.5.2)
  • This also does not reproduce when working with Julia 1.6 from the command line or with the Atom editor.

Reproduction:
Make sure you have a valid NVidia GPU card and the CUDA toolkit installed.
We used the latest CUDA Toolkit downloaded from:
https://developer.nvidia.com/cuda-downloads?target_os=Windows&target_arch=x86_64&target_version=10&target_type=exe_local

  • For CUDA.ones():
pkg> add CUDA
using CUDA
a = CUDA.ones(2,2)

Expected result:
2×2 CuArray{Float32, 2}:
1.0 1.0
1.0 1.0

Actual result:
2×2 CuArray{Float32, 2}:
0.0 0.0
0.0 0.0

  • - For CUDA.fill():
pkg> add CUDA
using CUDA
a = CUDA.fill(1.0,(2,2))

Expected result:
2×2 CuArray{Float32, 2}:
1.0 1.0
1.0 1.0

Actual result:
2×2 CuArray{Float64, 2}:
0.0078125 0.0
0.0078125 0.0

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions