@@ -69,7 +69,7 @@ function set_arg!(k::Kernel, idx::Integer, arg::CLPtr{T}) where {T}
69
69
end
70
70
71
71
# raw memory
72
- function set_arg! (k:: Kernel , idx:: Integer , arg:: AbstractMemory )
72
+ function set_arg! (k:: Kernel , idx:: Integer , arg:: AbstractPointerMemory )
73
73
# XXX : this assumes that the receiving argument is pointer-typed, which is not the case
74
74
# with Julia's `Ptr` ABI. Instead, one should reinterpret the pointer as a
75
75
# `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)
79
79
clSetKernelArgSVMPointer (k, idx - 1 , pointer (arg))
80
80
elseif arg isa UnifiedMemory
81
81
clSetKernelArgMemPointerINTEL (k, idx - 1 , pointer (arg))
82
+ elseif arg isa Buffer
83
+ clSetKernelArgDevicePointerEXT (k, idx - 1 , pointer (arg))
82
84
else
83
85
error (" Unknown memory type" )
84
86
end
@@ -191,6 +193,7 @@ function call(
191
193
if ! isempty (indirect_memory)
192
194
svm_pointers = CLPtr{Cvoid}[]
193
195
usm_pointers = CLPtr{Cvoid}[]
196
+ bda_pointers = CLPtr{Cvoid}[]
194
197
device_access = host_access = shared_access = false
195
198
for memory in indirect_memory
196
199
ptr = pointer (memory)
@@ -200,6 +203,8 @@ function call(
200
203
201
204
if memory isa SharedVirtualMemory
202
205
push! (svm_pointers, ptr)
206
+ elseif memory isa Buffer
207
+ push! (bda_pointers, ptr)
203
208
elseif memory isa UnifiedDeviceMemory
204
209
device_access = true
205
210
push! (usm_pointers, ptr)
@@ -229,6 +234,9 @@ function call(
229
234
if ! isempty (svm_pointers)
230
235
clSetKernelExecInfo (k, CL_KERNEL_EXEC_INFO_SVM_PTRS, sizeof (svm_pointers), svm_pointers)
231
236
end
237
+ if ! isempty (bda_pointers)
238
+ clSetKernelExecInfo (k, CL_KERNEL_EXEC_INFO_DEVICE_PTRS_EXT, sizeof (bda_pointers), bda_pointers)
239
+ end
232
240
if ! isempty (usm_pointers)
233
241
clSetKernelExecInfo (k, CL_KERNEL_EXEC_INFO_USM_PTRS_INTEL, sizeof (usm_pointers), usm_pointers)
234
242
end
0 commit comments