67 std::cout <<
"size in bytes of uploading to DFE: " << input.
size()*2*
sizeof(float) << std::endl;
80 const std::lock_guard<std::recursive_mutex> lock(
libmutex);
103 const std::lock_guard<std::recursive_mutex> lock(
libmutex);
105 initialize_id = initialize_id_in;
112 std::string lib_name = getenv(
"SLIC_CONF") ?
DFE_LIB_SIM : lib_name_DFE;
115 handle = dlopen(lib_name.c_str(), RTLD_NOW);
116 if (
handle == NULL && qbit_num == 10 && !getenv(
"SLIC_CONF")) {
121 std::string err(
"init_dfe_lib: failed to load library " + lib_name +
" - " + std::string(dlerror()));
int get_chained_gates_num()
Call to retrieve the number of gates that should be chained up during the execution of the DFE librar...
int(* load2LMEM_dll)(QGD_Complex16 *data, size_t rows, size_t cols)
void lock_lib()
Call to lock the access to the execution of the DFE library.
void(* releive_DFE_dll)()
void uploadMatrix2DFE(Matrix &input)
Call to upload the input matrix to the DFE engine.
data
load the unitary from file
int(* initialize_DFE_dll)(int accelerator_num)
scalar * get_data() const
Call to get the pointer to the stored data.
void unlock_lib()
Call to unlock the access to the execution of the DFE library.
int init_dfe_lib(const int accelerator_num, int qbit_num, int initialize_id_in)
Call to initialize the DFE library support and allocate the requested devices.
int rows
The number of rows.
int cols
The number of columns.
size_t(* get_accelerator_avail_num_dll)()
int(* calcqgdKernelDFE_dll)(size_t rows, size_t cols, DFEgate_kernel_type *gates, int gatesNum, int gateSetNum, int traceOffset, double *trace)
Structure type representing complex numbers in the SQUANDER package.
Class to store data of complex arrays and its properties.
int size() const
Call to get the number of the allocated elements.
int get_initialize_id()
Call to get the identification number of the inititalization of the library.
Fixed point data related to a gate operation.
std::atomic_size_t read_count(0)
reference counting of locking-unlocking the DFE accelerators
void unload_dfe_lib()
Call to unload the DFE libarary and release the allocated devices.
std::recursive_mutex libmutex
mutex to guard DFE lib locking and unlocking
int calcqgdKernelDFE(size_t rows, size_t cols, DFEgate_kernel_type *gates, int gatesNum, int gateSetNum, int traceOffset, double *trace)
Call to execute the calculation on the reserved DFE engines.
size_t get_accelerator_avail_num()
Call to get the available number of accelerators.
Header file for DFE support in unitary simulation.
size_t get_accelerator_free_num()
Call to get the number of free accelerators.
size_t(* get_accelerator_free_num_dll)()
int(* get_chained_gates_num_dll)()