JuliaGPU / JuliaGPU/oneAPI.jl

malloc and exceptions

Open
#65 0 comments 0 reactions 0 assignees View on GitHub
enhancement kernels
Dominant language
Julia
Stars
215
Forks
37
Avg merge
10h 47m
Merged PRs (30d)
14

Description

Those are the two remaining bits that will unlock a lot of functionality:

```julia
julia> exp.(oneArray(rand(ComplexF32, 2)))
ERROR: InvalidIRError: compiling kernel broadcast_kernel(oneAPI.oneKernelContext, oneDeviceVector{ComplexF32, 1}, Base.Broadcast.Broadcasted{Nothing, Tuple{Base.OneTo{Int64}}, typeof(exp), Tuple{Base.Broadcast.Extruded{oneDeviceVector{ComplexF32, 1}, Tuple{Bool}, Tuple{Int64}}}}, Int64) resulted in invalid LLVM IR
Reason: unsupported call to an unknown function (call to gpu_malloc)
Stacktrace:
[1] malloc
@ ~/Julia/pkg/GPUCompiler/src/runtime.jl:88
[2] macro expansion
@ ~/Julia/pkg/GPUCompiler/src/runtime.jl:185
[3] box
@ ~/Julia/pkg/GPUCompiler/src/runtime.jl:174
[4] box_float32
@ ~/Julia/pkg/GPUCompiler/src/runtime.jl:214
[5] sincos_domain_error
@ special/trig.jl:164
[6] sincos
@ special/trig.jl:181
[7] exp
@ complex.jl:655
[8] _broadcast_getindex_evalf
@ broadcast.jl:648
[9] _broadcast_getindex
@ broadcast.jl:621
[10] getindex
@ broadcast.jl:575
[11] broadcast_kernel
@ ~/Julia/depot/packages/GPUArrays/WV76E/src/host/broadcast.jl:62

```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the failing ComplexF32 broadcast reproduction and read GPUCompiler/src/runtime.jl at the malloc and boxing locations shown in the stack trace. Trace how exp reaches special/trig.jl and complex.jl, then determine the required support for malloc and exceptions. Done means the example compiles and runs without the reported invalid LLVM IR error.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
hpc
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.