Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICD JLL does not include USM functions #257

Open
VarLad opened this issue Oct 14, 2024 · 1 comment
Open

ICD JLL does not include USM functions #257

VarLad opened this issue Oct 14, 2024 · 1 comment

Comments

@VarLad
Copy link

VarLad commented Oct 14, 2024

could not load symbol "clHostMemAllocINTEL":

~/.julia/artifacts/c99d19d2f6dd75af3e997c4ecc4ac85e410cb7a7/lib/libOpenCL.so: undefined symbol: clHostMemAllocINTEL

To reproduce:

using OpenCL
error = Ref{Int32}()
al = cl.clHostMemAllocINTEL(cl.context(), C_NULL, 10000, 1, error)

Could this be an issue in using the function itself (wrong parameters or something)? 🤔

@maleadt maleadt changed the title Packaged JLL might not include USM functions ICD JLL does not include USM functions Oct 14, 2024
@maleadt
Copy link
Member

maleadt commented Oct 14, 2024

I think this is intended. The ICD we use only provides entry-points for functions from the spec, and for extensions one needs to use clGetExtensionFunctionAddressForPlatform to fetch the entrypoint address:

julia> using OpenCL, pocl_jll

julia> ptr = cl.clGetExtensionFunctionAddressForPlatform(cl.platform(), "clHostMemAllocINTEL")
Ptr{Nothing} @0x000000013131f000

julia> error = Ref{Int32}()
Base.RefValue{Int32}(219365504)

julia> ccall(ptr, Ptr{Cvoid}, (cl.cl_context, Ptr{cl.cl_mem_properties_intel}, Csize_t, cl.cl_uint, Ptr{cl.cl_int}), cl.context(), C_NULL, 1000, 1, error)
Ptr{Nothing} @0x0000000121016e00

julia> error[]
0

It's a bit annoying that we can't re-use the existing Clang.jl-generated headers for this, although for the handful of USM functions you need it's probably fine duplicating those ccalls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants