KernelAbstractions.jl icon indicating copy to clipboard operation
KernelAbstractions.jl copied to clipboard

CUDADevice not defined

Open torrance opened this issue 3 years ago • 4 comments

I am unable to port my kernels to use KernelAbstraction.jl since CUDADevice is not defined after importing. eg.

using CUDA
using KernelAbstractions

CUDA.functional()
> true

device = CUDADevice()
> ERROR: UndefVarError: CUDADevice not defined

Note that CUDA works just fine. The versions I am currently using are: CUDA: 3.8.1 and KernelAbstractions: 0.8.0

torrance avatar Mar 30 '22 09:03 torrance

You need to import CUDAKernels which contains the CUDA implementation of KernelAbstractions

vchuravy avatar Mar 30 '22 11:03 vchuravy

Ok thank you. Should the documentation be updated to reflect this?

torrance avatar Mar 30 '22 11:03 torrance

(It's not obvious in the docs that examples/utils.jl is importing this.

torrance avatar Mar 30 '22 12:03 torrance

using CUDAKernels is on line 4 of examples/utils.jl: https://github.com/JuliaGPU/KernelAbstractions.jl/blob/master/examples/utils.jl#L4

it is also mentioned in the docs: https://github.com/JuliaGPU/KernelAbstractions.jl/blob/master/docs/src/index.md?plain=1#L57

bjarthur avatar Jun 14 '22 16:06 bjarthur

Allegedly fixed according to https://github.com/JuliaGPU/KernelAbstractions.jl/pull/314#issuecomment-1182995831

stemann avatar Nov 18 '23 11:11 stemann