PIP 5.6.1
Platform-Independent Primitives
Public Member Functions | Static Public Member Functions | List of all members
PIOpenCL::Context Class Reference

OpenCL context wrapper that owns created programs and buffers. More...

#include <piopencl.h>

Public Member Functions

 ~Context ()
 Destroys the context together with its programs and buffers.
 
void * handle ()
 Returns the native OpenCL context handle.
 
void * queue ()
 Returns the native command queue handle.
 
ProgramcreateProgram (const PIString &source, const PIStringList &args=PIStringList(), PIString *error=0)
 Builds a program from source and returns null on failure.
 
template<typename T >
BuffercreateBuffer (PIOpenCL::Direction dir, PIVector< T > &container)
 Creates a buffer bound to a vector container.
 
template<typename T >
BuffercreateBuffer (PIOpenCL::Direction dir, PIDeque< T > &container)
 Creates a buffer bound to a deque container.
 
template<typename T >
BuffercreateBuffer (PIOpenCL::Direction dir, PIVector2D< T > &container)
 Creates a buffer bound to a two-dimensional vector container.
 
template<typename T >
BuffercreateBuffer (PIOpenCL::Direction dir, uint elements)
 Creates an unbound buffer with the given element count and clears it to the default value.
 

Static Public Member Functions

static Contextcreate (const DeviceList &dl)
 Creates a context for the given device list.
 
static Contextcreate (const Device &d)
 Creates a context for a single device.
 
static Contextcreate (const PIString &part_name)
 Creates a context for the first device whose display name contains the given text.
 

Detailed Description

OpenCL context wrapper that owns created programs and buffers.