@@ -69,7 +69,7 @@ function set_arg!(k::Kernel, idx::Integer, arg::CLPtr{T}) where {T}
6969end
7070
7171# raw memory
72- function set_arg! (k:: Kernel , idx:: Integer , arg:: AbstractMemory )
72+ function set_arg! (k:: Kernel , idx:: Integer , arg:: AbstractPointerMemory )
7373 # XXX : this assumes that the receiving argument is pointer-typed, which is not the case
7474 # with Julia's `Ptr` ABI. Instead, one should reinterpret the pointer as a
7575 # `Core.LLVMPtr`, which _is_ pointer-valued. We retain this handling for `Ptr` for
@@ -79,6 +79,8 @@ function set_arg!(k::Kernel, idx::Integer, arg::AbstractMemory)
7979 clSetKernelArgSVMPointer (k, idx - 1 , pointer (arg))
8080 elseif arg isa UnifiedMemory
8181 clSetKernelArgMemPointerINTEL (k, idx - 1 , pointer (arg))
82+ elseif arg isa Buffer
83+ clSetKernelArgDevicePointerEXT (k, idx - 1 , pointer (arg))
8284 else
8385 error (" Unknown memory type" )
8486 end
@@ -191,6 +193,7 @@ function call(
191193 if ! isempty (indirect_memory)
192194 svm_pointers = CLPtr{Cvoid}[]
193195 usm_pointers = CLPtr{Cvoid}[]
196+ bda_pointers = CLPtr{Cvoid}[]
194197 device_access = host_access = shared_access = false
195198 for memory in indirect_memory
196199 ptr = pointer (memory)
@@ -200,6 +203,8 @@ function call(
200203
201204 if memory isa SharedVirtualMemory
202205 push! (svm_pointers, ptr)
206+ elseif memory isa Buffer
207+ push! (bda_pointers, ptr)
203208 elseif memory isa UnifiedDeviceMemory
204209 device_access = true
205210 push! (usm_pointers, ptr)
@@ -229,6 +234,9 @@ function call(
229234 if ! isempty (svm_pointers)
230235 clSetKernelExecInfo (k, CL_KERNEL_EXEC_INFO_SVM_PTRS, sizeof (svm_pointers), svm_pointers)
231236 end
237+ if ! isempty (bda_pointers)
238+ clSetKernelExecInfo (k, CL_KERNEL_EXEC_INFO_DEVICE_PTRS_EXT, sizeof (bda_pointers), bda_pointers)
239+ end
232240 if ! isempty (usm_pointers)
233241 clSetKernelExecInfo (k, CL_KERNEL_EXEC_INFO_USM_PTRS_INTEL, sizeof (usm_pointers), usm_pointers)
234242 end
0 commit comments