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

#include <qle/math/basiccpuenvironment.hpp>

+ Inheritance diagram for BasicCpuFramework:
+ Collaboration diagram for BasicCpuFramework:

Public Member Functions

 BasicCpuFramework ()
 
 ~BasicCpuFramework () 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
 

Private Attributes

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

Detailed Description

Definition at line 31 of file basiccpuenvironment.hpp.

Constructor & Destructor Documentation

◆ BasicCpuFramework()

Definition at line 120 of file basiccpuenvironment.cpp.

120{ contexts_["BasicCpu/Default/Default"] = new BasicCpuContext(); }
std::map< std::string, ComputeContext * > contexts_

◆ ~BasicCpuFramework()

~BasicCpuFramework ( )
finaloverride

Definition at line 122 of file basiccpuenvironment.cpp.

122 {
123 for (auto& [_, c] : contexts_) {
124 delete c;
125 }
126}

Member Function Documentation

◆ getAvailableDevices()

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

Implements ComputeFramework.

Definition at line 395 of file basiccpuenvironment.cpp.

395{ return {"BasicCpu/Default/Default"}; }

◆ getContext()

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

Implements ComputeFramework.

Definition at line 397 of file basiccpuenvironment.cpp.

397 {
398 QL_REQUIRE(deviceName == "BasicCpu/Default/Default",
399 "BasicCpuFramework::getContext(): device '"
400 << deviceName << "' not supported. Available device is 'BasicCpu/Default/Default'.");
401 return contexts_[deviceName];
402}

Member Data Documentation

◆ contexts_

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

Definition at line 39 of file basiccpuenvironment.hpp.