ImFusion SDK 4.3
ClEnvironment Class Reference

#include <ImFusion/CL/ClEnvironment.h>

Encapsulates OpenCL environment. More...

Detailed Description

Encapsulates OpenCL environment.

Creates an OpenCL context with the first available platform and the default device as well as a command queue. Provides a singleton method for accessing an application default OpenCL environment.

Public Member Functions

 ClEnvironment (ClContext::DeviceType type=ClContext::DEFAULT, bool openGlSupport=false, bool profilingSupport=false, ClContext *sharedContext=0, void(*notifyCb)(const char *errinfo, const void *private_info, size_t cb, void *userData)=0, void *userData=0, const std::vector< std::string > &requiredExtensions=std::vector< std::string >())
 Construct ClEnvironment object.
 
 ClEnvironment (ClPlatform *platform, ClDevice *device, bool openGlSupport=false, bool profilingSupport=false, ClContext *sharedContext=0, void(*notifyCb)(const char *errinfo, const void *private_info, size_t cb, void *userData)=0, void *userData=0)
 
 ClEnvironment (const std::vector< std::string > &requiredExtensions, bool openGlSupport=false, bool profilingSupport=false, ClContext *sharedContext=0, void(*notifyCb)(const char *errinfo, const void *private_info, size_t cb, void *userData)=0, void *userData=0)
 
const ClContextcontext () const
 
const ClDevicedevice () const
 
const ClCommandQueuecommandQueue () const
 
int finish () const
 Convenience functions.
 
int waitForEvents (const ClEvent &event) const
 
int waitForEvents (const std::vector< ClEvent * > &events) const
 

Static Public Member Functions

static ClEnvironmentdefaultEnvironment ()
 Singleton access function.
 
static std::string getErrorString (int error)
 
static void clCheck (ClEnvironment &environment, const std::string &file="", int line=-1)
 
static bool hasOpenCL ()
 
static float maxFloat ()
 
static void setDefaultDevice (ClPlatform *platform, ClDevice *device)
 

Protected Member Functions

bool createContext (ClPlatform *platform, ClDevice *device, ClContext::DeviceType type, bool openGlSupport, bool profilingSupport, ClContext *sharedContext, void(*notifyCb)(const char *errinfo, const void *private_info, size_t cb, void *userData)=0, void *userData=0)
 

Constructor & Destructor Documentation

◆ ClEnvironment()

ClEnvironment ( ClContext::DeviceType type = ClContext::DEFAULT,
bool openGlSupport = false,
bool profilingSupport = false,
ClContext * sharedContext = 0,
void(* notifyCb )(const char *errinfo, const void *private_info, size_t cb, void *userData) = 0,
void * userData = 0,
const std::vector< std::string > & requiredExtensions = std::vectorstd::string >() )

Construct ClEnvironment object.

Optionally takes existing context for context sharing. Throws a std::runtime_error if the OpenCL environment cannot be initialized.


The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close