oclSimpleKernel | R Documentation |
Creates a kernel object by compiling the supplied code.
The kernel can then be used in oclRun
.
oclSimpleKernel(context, name, code,
output.mode = c("numeric", "single", "double", "integer"))
context |
Context (as created by |
name |
Name of the kernel function - must match the name used in the supplied code. |
code |
Character vector containing the code. The code will be concatenated (as-is, no newlines are added!) by the engine. |
output.mode |
Mode of the output argument of the kernel, as in
The kernel code may use a type |
oclSimpleKernel
builds the program specified by code
and
creates a kernel from the program.
The kernel built by this function is simple in that it can have
exactly one vector output and arbitrarily many inputs. The first
argument of the kernel must be __global double*
or
__global float*
for the output and the second argument must be
const unsigned int
for the length of the output vector.
Additional numeric scalar arguments are assumed to have the same mode as the
output, i.e. if the output shall have "double" precision, then numeric scalar
arguments are assumed to be double values, similarly for single-precision.
All additional arguments are optional. See oclRun
for an
example of a simple kernel.
Note that building a kernel can take substantial amount of time (depending on the OpenCL implementation) so it is generally a good idea to compile a kernel once and re-use it many times.
Kernel object that can be used by oclRun
.
Simon Urbanek, Aaron Puchert
oclContext
, oclRun
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.