JASPL  0.2
Just Another Signal Processing Library
Public Member Functions | Protected Member Functions | Static Protected Attributes | List of all members
jaspl::ocl::OpenCLBase Class Referenceabstract

Base class for every class that needs access to OpenCL Platforms, Contexts or Devices. More...

#include <openclbase.h>

Inheritance diagram for jaspl::ocl::OpenCLBase:
Inheritance graph
[legend]

Public Member Functions

 OpenCLBase (uint platform_number=0, uint device_number=0)
 Initialize OpenCL Objects Note that the Platform and Context are selected automatically: Platform is set to cl::Platform( 0 ) Context is set to cl::Context( device[ device_number ] ) More...
 

Protected Member Functions

void SetUp (uint platform_number, uint device_number)
 

Static Protected Attributes

static bool initalized = false
 
static std::vector< cl::Platform > all_platforms
 
static cl::Platform default_platform
 
static std::vector< cl::Device > all_devices
 
static cl::Device current_device
 
static cl::Context context
 
static cl::CommandQueue command_queue
 

Detailed Description

Base class for every class that needs access to OpenCL Platforms, Contexts or Devices.

This class a common OpenCL Platform, Context, CommandQueue and Device for derived classes to share.

Definition at line 31 of file openclbase.h.

Constructor & Destructor Documentation

jaspl::ocl::OpenCLBase::OpenCLBase ( uint  platform_number = 0,
uint  device_number = 0 
)

Initialize OpenCL Objects Note that the Platform and Context are selected automatically: Platform is set to cl::Platform( 0 ) Context is set to cl::Context( device[ device_number ] )

The underlying assumption is that the host machine has only one OpenCL Platform ( e.g. one of AMD-APP, Nvidia CUDA, Intel )

Parameters
device_numberNumber of the OpenCL device to use as described by cl::Platform::getDevices(CL_DEVICE_TYPE_ALL)

Definition at line 78 of file openclbase.cpp.