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
{{ message }}
Repository navigation
POCL: reinterpret of a device array refers to undefined _reinterpret_exception #869
Calling reinterpret on a device array inside a kernel fails to compile on the POCL back-end (and therefore on CPU()):
using KernelAbstractions
@kernelfunctionreint!(A, B)
i =@index(Global)
C =reinterpret(Int32, B)
@inbounds A[i] = C[i]
end
B = KernelAbstractions.ones(CPU(), Float32, 4)
A = KernelAbstractions.zeros(CPU(), Int32, 4)
reint!(CPU())(A, B; ndrange=4)
ERROR: InvalidIRError: compiling MethodInstance for gpu_reint!(...) resulted in invalid LLVM IR
Reason: unsupported use of an undefined name (use of 'KernelAbstractions.POCL._reinterpret_exception')
Stacktrace:
[1] reinterpret
@ src/pocl/device/array.jl:273
src/pocl/device/array.jl was copied from OpenCL.jl in #556, where the check is GPUArrays._reinterpret_exception(T, a). KernelAbstractions doesn't depend on GPUArrays, so the call was left pointing at a function that doesn't exist. The fix is to carry the check (GPUArrays' src/host/base.jl) along with the device array code, and to test reinterpret in a kernel.
Activity
Fix `reinterpret` of device arrays on POCL
Constify `@Const` arguments when launching instead of in the kernel (J…