-
Notifications
You must be signed in to change notification settings - Fork 38
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
Comments
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 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 |
@maleadt Would you have an example of how to pass the |
AFAIU it behaves like context properties, so you pass a list of properties starting with julia> using OpenCL, pocl_jll
julia> fun = cl.clGetExtensionFunctionAddressForPlatform(cl.platform(), "clHostMemAllocINTEL")
Ptr{Nothing} @0x0000000135a78178
julia> error = Ref{Int32}();
julia> flags = cl.CL_MEM_ALLOC_WRITE_COMBINED_INTEL;
julia> properties = cl.cl_mem_properties_intel[cl.CL_MEM_ALLOC_FLAGS_INTEL, flags, 0];
julia> buf = ccall(fun, Ptr{Cvoid},
(cl.cl_context, Ptr{cl.cl_mem_properties_intel}, Csize_t, cl.cl_uint, Ptr{cl.cl_int}),
cl.context(), properties, 1000, 1, error)
Ptr{Nothing} @0x00000001322cee00
julia> @assert error[] == cl.CL_SUCCESS You can also look at how PoCL implements this: |
To reproduce:
Could this be an issue in using the function itself (wrong parameters or something)? 🤔
The text was updated successfully, but these errors were encountered: