Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

CPU backend: `Base.checked_mul` in a kernel fails to build (`__spirv_SMulExtended` missing in PoCL)

Open
#916 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
52/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
julia

Research direction

Start by reproducing the provided kernel on CPU() with KernelAbstractions 0.10.1 and inspect how Base.checked_mul is lowered through GPUCompiler and SPIR-V for the PoCL backend. The report identifies no repository files or test entry points, so first locate existing CPU kernel compilation tests and add a focused regression case for Int32 and Int64. Done when the kernel builds and the checked multiplication behavior is covered by a passing test on PoCL.

Written by the indexing model from the issue text.

Description

AI agent:


On KernelAbstractions 0.10.1, a kernel on CPU() that calls Base.checked_mul fails to build: PoCL's kernel library has no __spirv_SMulExtended. It fails for Int64 and Int32 alike. Arithmetic on Rational{Int} multiplies with overflow checks, so it fails too. That is how we found it, in NNlib's upsample_bilinear, whose Rational{Int} test passes on KernelAbstractions 0.9.

using KernelAbstractions

@kernel function mul!(y, @Const(x))
    i = @index(Global)
    @inbounds y[i] = Base.checked_mul(x[i], x[i])
end

x = collect(1:4)
mul!(CPU())(similar(x), x; ndrange=4)
Failed to compile program

Build log:
Error(s) while linking:
Cannot find symbol _Z20__spirv_SMulExtendedll in kernel library
Device cpu-skylake-avx512-AMD Ryzen Threadripper PRO 9955WX 16-Cores failed to build the program

followed by CLError(-11). Presumably llvm.smul.with.overflow becomes OpSMulExtended in SPIR-V, which PoCL doesn't implement.

Julia 1.13.2, KernelAbstractions 0.10.1, GPUCompiler 2.16.0, SPIRVIntrinsics 1.5.0, SPIRV_LLVM_Backend_jll 23.1.1+8, pocl_standalone_jll 7.2.2+12.

Dominant language
Julia
Stars
533
Forks
90
Avg merge
1d 12h
Merged PRs (30d)
72

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from JuliaGPU/KernelAbstractions.jl

All issues in JuliaGPU/KernelAbstractions.jl

Similar issues

More Julia issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.