... | ... | @@ -3,7 +3,10 @@ |
|
|
The Parabix Kernel Library has a number of useful kernels for building applications. Look for information
|
|
|
in the include/kernels directory.
|
|
|
|
|
|
## I/O Kernels: Sources and Sinks
|
|
|
## Input Kernels: Sources
|
|
|
```
|
|
|
#include <kernel/io/source_kernel.h>
|
|
|
```
|
|
|
|
|
|
Source kernels are kernels that provide the input data streams for processing
|
|
|
by other kernels. There are source kernels for obtaining input streams from
|
... | ... | @@ -26,10 +29,24 @@ a boolean scalar value identifying whether to use ```mmap``` if possible. If t |
|
|
|
|
|
```MemorySourceKernel``` is a kernel that produces a stream set from a memory buffer. Its parameters are a scalar pointer to the buffer, and a scalar length of the buffer.
|
|
|
|
|
|
## Output Kernels: Sinks
|
|
|
```
|
|
|
#include <kernel/io/stdout_kernel.h>
|
|
|
```
|
|
|
Output to stdout or to a file may be achieved using sink kernels.
|
|
|
|
|
|
```StdOutKernel``` produces the contents of a stream on stdout.
|
|
|
```
|
|
|
P->CreateKernelCall<StdOutKernel>(codeUnitStream);
|
|
|
```
|
|
|
Here ```codeUnitStream``` is typically a stream of bytes (8-bit code units), but
|
|
|
may also be a stream of 16, 32 or 64 bit units.
|
|
|
|
|
|
|
|
|
|
|
|
```FileSinkKernel``` produces output to a named file. The file name is
|
|
|
provided as a scalar pointer to a C-string (null-terminated file name).
|
|
|
```
|
|
|
P->CreateKernelCall<FileSink>(outputFileName, codeUnitStream);
|
|
|
```
|
|
|
|
|
|
## Transposition
|
|
|
|
... | ... | |