Sequential Quantum Gate Decomposer  v1.9.3
Powerful decomposition of general unitarias into one- and two-qubit gates gates
Functions | Variables
common_DFE.cpp File Reference

Provides functions to link and manage data-flow accelerator libarries. More...

#include "common_DFE.h"
#include "matrix_base.hpp"
#include <atomic>
#include <dlfcn.h>
#include <unistd.h>
#include <mutex>
Include dependency graph for common_DFE.cpp:

Go to the source code of this file.

Functions

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. More...
 
size_t get_accelerator_avail_num ()
 Call to get the available number of accelerators. More...
 
size_t get_accelerator_free_num ()
 Call to get the number of free accelerators. More...
 
int get_chained_gates_num ()
 Call to retrieve the number of gates that should be chained up during the execution of the DFE library. More...
 
int get_initialize_id ()
 Call to get the identification number of the inititalization of the library. More...
 
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. More...
 
void lock_lib ()
 Call to lock the access to the execution of the DFE library. More...
 
std::atomic_size_t read_count (0)
 reference counting of locking-unlocking the DFE accelerators More...
 
void unload_dfe_lib ()
 Call to unload the DFE libarary and release the allocated devices. More...
 
void unlock_lib ()
 Call to unlock the access to the execution of the DFE library. More...
 
void uploadMatrix2DFE (Matrix &input)
 Call to upload the input matrix to the DFE engine. More...
 

Variables

int(* calcqgdKernelDFE_dll )(size_t rows, size_t cols, DFEgate_kernel_type *gates, int gatesNum, int gateSetNum, int traceOffset, double *trace) = NULL
 
size_t(* get_accelerator_avail_num_dll )() = NULL
 
size_t(* get_accelerator_free_num_dll )() = NULL
 
int(* get_chained_gates_num_dll )() = NULL
 
void * handle = NULL
 
int(* initialize_DFE_dll )(int accelerator_num) = NULL
 
int initialize_id = -1
 
std::recursive_mutex libmutex
 mutex to guard DFE lib locking and unlocking More...
 
std::mutex libreadmutex
 
int(* load2LMEM_dll )(QGD_Complex16 *data, size_t rows, size_t cols) = NULL
 
void(* releive_DFE_dll )() = NULL
 

Detailed Description

Provides functions to link and manage data-flow accelerator libarries.

Definition in file common_DFE.cpp.

Function Documentation

◆ calcqgdKernelDFE()

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.

Parameters
rowsThe number of rows in the input matrix
colsthe number of columns in the input matrix
gatesThe metadata describing the gates to be applied on the input
gatesNumThe number of the chained up gates.
gateSetNumInteger descibing how many individual gate chains are encoded in the gates input.
traceOffsetIn integer describing an offset in the trace calculation
traceThe trace of the transformed unitaries are returned through this pointer
Returns
Return with 0 on success

Definition at line 207 of file common_DFE.cpp.

Here is the caller graph for this function:

◆ get_accelerator_avail_num()

size_t get_accelerator_avail_num ( )

Call to get the available number of accelerators.

Returns
Retirns with the number of the available accelerators

Definition at line 169 of file common_DFE.cpp.

◆ get_accelerator_free_num()

size_t get_accelerator_free_num ( )

Call to get the number of free accelerators.

Returns
Retirns with the number of the free accelerators

Definition at line 180 of file common_DFE.cpp.

◆ get_chained_gates_num()

int get_chained_gates_num ( )

Call to retrieve the number of gates that should be chained up during the execution of the DFE library.

Returns
Returns with the number of the chained gates.

Definition at line 220 of file common_DFE.cpp.

Here is the caller graph for this function:

◆ get_initialize_id()

int get_initialize_id ( )

Call to get the identification number of the inititalization of the library.

Returns
Returns with the identification number of the inititalization of the library

Definition at line 190 of file common_DFE.cpp.

Here is the caller graph for this function:

◆ init_dfe_lib()

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.

Parameters
accelerator_numThe number of requested devices
qbit_numThe number of the supported qubits
initialize_id_inIdentification number of the inititalization of the library
Returns
Returns with the identification number of the inititalization of the library.

Definition at line 101 of file common_DFE.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lock_lib()

void lock_lib ( )

Call to lock the access to the execution of the DFE library.

Definition at line 145 of file common_DFE.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_count()

std::atomic_size_t read_count ( )

reference counting of locking-unlocking the DFE accelerators

Here is the caller graph for this function:

◆ unload_dfe_lib()

void unload_dfe_lib ( )

Call to unload the DFE libarary and release the allocated devices.

Definition at line 78 of file common_DFE.cpp.

Here is the caller graph for this function:

◆ unlock_lib()

void unlock_lib ( )

Call to unlock the access to the execution of the DFE library.

Definition at line 155 of file common_DFE.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uploadMatrix2DFE()

void uploadMatrix2DFE ( Matrix input)

Call to upload the input matrix to the DFE engine.

Parameters
inputThe input matrix

Definition at line 65 of file common_DFE.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ calcqgdKernelDFE_dll

int(* calcqgdKernelDFE_dll) (size_t rows, size_t cols, DFEgate_kernel_type *gates, int gatesNum, int gateSetNum, int traceOffset, double *trace) = NULL

Definition at line 48 of file common_DFE.cpp.

◆ get_accelerator_avail_num_dll

size_t(* get_accelerator_avail_num_dll) () = NULL

Definition at line 46 of file common_DFE.cpp.

◆ get_accelerator_free_num_dll

size_t(* get_accelerator_free_num_dll) () = NULL

Definition at line 47 of file common_DFE.cpp.

◆ get_chained_gates_num_dll

int(* get_chained_gates_num_dll) () = NULL

Definition at line 52 of file common_DFE.cpp.

◆ handle

void* handle = NULL

Definition at line 34 of file common_DFE.cpp.

◆ initialize_DFE_dll

int(* initialize_DFE_dll) (int accelerator_num) = NULL

Definition at line 51 of file common_DFE.cpp.

◆ initialize_id

int initialize_id = -1

Definition at line 57 of file common_DFE.cpp.

◆ libmutex

std::recursive_mutex libmutex

mutex to guard DFE lib locking and unlocking

Definition at line 40 of file common_DFE.cpp.

◆ libreadmutex

std::mutex libreadmutex

Definition at line 41 of file common_DFE.cpp.

◆ load2LMEM_dll

int(* load2LMEM_dll) (QGD_Complex16 *data, size_t rows, size_t cols) = NULL

Definition at line 49 of file common_DFE.cpp.

◆ releive_DFE_dll

void(* releive_DFE_dll) () = NULL

Definition at line 50 of file common_DFE.cpp.