![]() |
ImFusion SDK 4.3
|
#include <ImFusion/CL/ClEnvironment.h>
Encapsulates OpenCL environment. More...
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 ClContext * | context () const |
| const ClDevice * | device () const |
| const ClCommandQueue * | commandQueue () 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 ClEnvironment & | defaultEnvironment () |
| 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) |
| 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.
Optionally takes existing context for context sharing. Throws a std::runtime_error if the OpenCL environment cannot be initialized.