Class cudaq_sim_pool

Class Documentation

class cudaq_sim_pool

Singleton util class holding/caching references to CUDAQ backend simulator instances.

Public Functions

std::vector<std::string> available_simulators() const

Returns the names of the available CUDAQ simulators.

void set_simulator(const std::string &name)

Sets the ‘active’ CUDAQ simulator backend. This will throw if this is not a valid name (i.e., one of available_simulators)

void init_cudaq_runtime()

Manual init the CUDAQ runtime by loading its core libs with RTLD_GLOBAL.

Public Static Functions

static cudaq_sim_pool &get_instance()

Getter for the instance; makes this class a threadsafe singleton.

Private Functions

cudaq_sim_pool()

Constructor.

~cudaq_sim_pool()

Destructor.

Private Members

std::unordered_map<std::string, std::string> sim_name_to_lib

Simulator name to lib path.

std::unordered_map<std::string, nvqir::CircuitSimulator*> sim_name_to_sim_ptr

Simulator instance pool (lazily populated)

std::string active_sim

Name of the active simulator in the CUDAQ runtime.

std::string nvqir_lib_path

Path to the nvqir (i.e., libnvqir.so) lib (core CUDAQ QIR runtime implementation)

std::string platform_lib_path

Path to the CUDAQ platform lib (i.e., libcudaq-platform-default.so)

std::string cudaq_rt_lib_path

Path to the CUDAQ lib (libcudaq.so)