Description Usage Arguments Details Value
Allocates an OpenCL buffer with the given context.
1 | cl.create.buffer(context, flags, size = NULL, vector = NULL)
|
context |
An opencl_context object. |
flags |
Character vector of OpenCL buffer flags. Refer to The OpenCL documentation. |
size |
The size in bytes of the vector. Mandatory if vector is NULL. |
vector |
The data to go into an OpenCL buffer. Mandatory if size is NULL. |
Calls clCreateBuffer with the given context, flags and buffer. The data is optional, if vector is left null an empty buffer wil be allocated. It can be filled with data at a later point with a call to cl.enqueue.write.buffer. The size must be the size in bytes of the OpenCL buffer to be allocated. Note that object.size includes R overhead. Integer and float32 vectors take up 4 bytes per element, double vectors (the R default) take up 8 bytes per element. Note that 64-bit float performance is crippled on most GPUs, so it is a good idea to cast a double vector to a float32 vector before use with OpenCL.
An opencl_buffer object
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.