Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
OpenClFramework Class Reference

#include <qle/math/openclenvironment.hpp>

+ Inheritance diagram for OpenClFramework:
+ Collaboration diagram for OpenClFramework:

Public Member Functions

 OpenClFramework ()
 
 ~OpenClFramework () override final
 
std::set< std::string > getAvailableDevices () const override final
 
ComputeContextgetContext (const std::string &deviceName) override final
 
- Public Member Functions inherited from ComputeFramework
virtual ~ComputeFramework ()
 
virtual std::set< std::string > getAvailableDevices () const =0
 
virtual ComputeContextgetContext (const std::string &deviceName)=0
 

Static Private Member Functions

static void init ()
 

Private Attributes

std::map< std::string, ComputeContext * > contexts_
 

Static Private Attributes

static boost::shared_mutex mutex_
 
static bool initialized_
 
static std::string platformName_ [4U]
 
static std::string deviceName_ [4U][8U]
 
static std::vector< std::pair< std::string, std::string > > deviceInfo_ [4U][8U]
 
static bool supportsDoublePrecision_ [4U][8U]
 

Detailed Description

Definition at line 45 of file openclenvironment.hpp.

Constructor & Destructor Documentation

◆ OpenClFramework()

Definition at line 1634 of file openclenvironment.cpp.

1634{}

◆ ~OpenClFramework()

~OpenClFramework ( )
finaloverride

Definition at line 1635 of file openclenvironment.cpp.

1635{}

Member Function Documentation

◆ getAvailableDevices()

std::set< std::string > getAvailableDevices ( ) const
finaloverridevirtual

Implements ComputeFramework.

Definition at line 1638 of file openclenvironment.cpp.

1638 {
1639 std::set<std::string> tmp;
1640 for (auto const& [name, _] : contexts_)
1641 tmp.insert(name);
1642 return tmp;
1643}
std::map< std::string, ComputeContext * > contexts_
+ Here is the caller graph for this function:

◆ getContext()

ComputeContext * getContext ( const std::string &  deviceName)
finaloverridevirtual

Implements ComputeFramework.

Definition at line 1645 of file openclenvironment.cpp.

1645 {
1646 auto c = contexts_.find(deviceName);
1647 if (c != contexts_.end()) {
1648 return c->second;
1649 }
1650 QL_FAIL("OpenClFrameWork::getContext(): device '"
1651 << deviceName << "' not found. Available devices: " << boost::join(getAvailableDevices(), ","));
1652}
std::set< std::string > getAvailableDevices() const override final
+ Here is the call graph for this function:

◆ init()

static void init ( )
staticprivate

Member Data Documentation

◆ contexts_

std::map<std::string, ComputeContext*> contexts_
private

Definition at line 55 of file openclenvironment.hpp.

◆ mutex_

boost::shared_mutex mutex_
staticprivate

Definition at line 57 of file openclenvironment.hpp.

◆ initialized_

bool initialized_
staticprivate

Definition at line 58 of file openclenvironment.hpp.

◆ platformName_

std::string platformName_[4U]
staticprivate

Definition at line 65 of file openclenvironment.hpp.

◆ deviceName_

std::string deviceName_[4U][8U]
staticprivate

Definition at line 66 of file openclenvironment.hpp.

◆ deviceInfo_

std::vector<std::pair<std::string, std::string> > deviceInfo_[4U][8U]
staticprivate

Definition at line 67 of file openclenvironment.hpp.

◆ supportsDoublePrecision_

bool supportsDoublePrecision_[4U][8U]
staticprivate

Definition at line 69 of file openclenvironment.hpp.