JLArrays 0.5: `erfcx`, `logerfc`, `logerfcx` fail (worked in 0.4)

未关闭
#877 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

@timholy 已经在做这个了。

开始于 2026年12月3日。

  • #645 来自 @timholy —— 未关闭

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
julia
领域
backend

调研方向

Start by reading the SPIRVIntrinsicsSpecialFunctionsExt special function overrides mentioned in the issue and the reproducer using erfcx on a JLArray. Check how erf, erfc, and gamma are handled, then investigate how to support erfcx and its logerfc and logerfcx callers without the unsupported ccall. Done when the reproducer works on JLArrays 0.5 and the related functions no longer fail.

由索引模型根据 Issue 内容生成。

描述

using JLArrays, SpecialFunctions
erfcx.(JLArray([1.0, 2.0]))
# JLArrays 0.4.2: [0.427583576155807, 0.2553956763105058]
# JLArrays 0.5.0: InvalidIRError: unsupported use of a non-constant global (OpenSpecFun_jll.libopenspecfun)

logerfc and logerfcx fail the same way (they call erfcx internally); erfc works.

Versions: JLArrays 0.5.0, GPUArrays 12.3.0, KernelAbstractions 0.10.9, SPIRVIntrinsics 1.6.1, SpecialFunctions 2.9.2, Julia 1.13.4.

Claude explanation below.

JLArrays 0.5 compiles kernels through POCL, and SPIRVIntrinsicsSpecialFunctionsExt overrides erf, erfc, gamma and loggamma but not erfcx, whose host method is a ccall into libopenspecfun. CUDA.jl covers it with __nv_erfcx. OpenCL C has no erfcx, so an override would need a Julia implementation, e.g. exp(x^2) * erfc(x) for moderate x and a continued fraction for large x.

主要语言
Julia
星标
462
派生
109
平均合并
4 天 11 小时
30 天内合并 PR
26

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

JuliaGPU/GPUArrays.jl 的其他 Issue

查看 JuliaGPU/GPUArrays.jl 的全部 Issue

相似的 Issue

更多 Julia Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。