You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using KernelAbstractions
using CUDA
using Enzyme
using Adapt
@kernelfunctionstencil_kernel!(y, x)
i =@index(Global, Linear)
y[i] = x[i]
endfunctionstencil!(y, x, backend)
stencil_kernel!(backend, 64)(y, x, ndrange=64)
endfunctiondriver!(y,x, backend)
stencil!(y, x, backend)
returnnothingendfunctionprimal(backend)
x =adapt(backend, ones(64))
y =adapt(backend, zeros(64))
driver!(y, x, backend)
returnall(y .==1.0)
endfunctionadjoint(backend)
x =adapt(backend, ones(64))
y =adapt(backend, zeros(64))
dx =adapt(backend, zeros(64))
dy =adapt(backend, ones(64))
autodiff(Reverse, driver!, Const, Duplicated(y,dy), Duplicated(x,dx), Const(backend))
returnall(dx .==1.0)
endprimal(CPU())
primal(CUDABackend())
@timeadjoint(CPU())
# BoundsError: attempt to access 0-element Vector{LLVM.LLVMType} at index [1]# Enzyme.Compiler /disk/mschanen/julia_depot/dev/Enzyme/src/compiler.jl:5912# emit_error(b, term, "Enzyme: The original primal code hits this error condition, thus differentiating it does not make sense")@timeadjoint(CUDABackend())
It seems to crash at:
# Enzyme.Compiler /disk/mschanen/julia_depot/dev/Enzyme/src/compiler.jl:5912emit_error(b, term, "Enzyme: The original primal code hits this error condition, thus differentiating it does not make sense")
However both the CUDABackend() original primal as well as the CPU reverse run successfully.
The text was updated successfully, but these errors were encountered:
printall.log
Getting this error
when running
It seems to crash at:
However both the
CUDABackend()
original primal as well as the CPU reverse run successfully.The text was updated successfully, but these errors were encountered: