Handbook
Glossary
<cl-buffer> ( buffer-access-mode size initial-data -- buffer )
OpenCL
Prev:
with-cl-state ( context/f device/f queue/f quot -- )
Next:
cl-queue-copy-buffer ( src-buffer-ptr dst-buffer-ptr size dependent-events -- event )
Vocabulary
opencl
Inputs
buffer-access-mode
an
object
size
an
object
initial-data
an
object
Outputs
buffer
an
object
Definition
USING:
accessors
alien.c-types
alien.data
destructors
kernel
math
opencl.ffi
opencl.private
;
IN:
opencl
:
<cl-buffer>
( buffer-access-mode size initial-data -- buffer )
[
(current-cl-context)
]
3dip
tuck
[
[
handle>>
]
[
buffer-access-constant
]
[
[
CL_MEM_COPY_HOST_PTR
]
[
CL_MEM_ALLOC_HOST_PTR
]
if
]
tri*
bitor
]
2dip
0
int
<ref>
[
clCreateBuffer
]
keep
int
deref
cl-success
cl-buffer
new-disposable
swap
>>handle
;