Runner#
Currently, this API is unsupported in Python
-
class Runner#
A class for computing a circuit based on inputs.
Public Functions
-
Runner(const HeContext &h, const Circuit &c)#
Construct a Runner for computing a circuit.
- Parameters:
h – [in] The underlying context for the computation.
c – [in] The circuit to compute.
-
void addWorker(Worker *w)#
Add a worker to the runner.
- Parameters:
w – The worker to add.
-
void addWritableCache(CtxtCache *a)#
Add a random-access cache to the native worker.
The caller is responsible to delete this cache, however, the runner keeps a pointer to the cache. In this case the caller needs to delete the cache only after the runner has finished running.
- Parameters:
a – The cache to add.
-
void addReadOnlyCache(const CtxtCache *a)#
Add a read-only cache to the native worker.
The caller is responsible to delete this cache, however, the runner keeps a pointer to the cache. In this case the caller needs to delete the cache only after the runner has finished running.
- Parameters:
a – The cache to add.
-
void removeReadOnlyCache()#
Remove a pointer to a read-only cache (if any is held).
-
void removeWritableCache()#
Remove a pointer to a random-access cache (if any is held).
-
void executeGate(PNode n)#
Execute a single node.
- Parameters:
n – The node to execute.
-
void runWorker()#
Loop to execute a single step until all nodes have been executed.
-
void workerStep()#
Find the next node to execute a single node in the graph.
-
void run()#
Compute the circuit by running several workers in parallel.
-
CTile &getCTileByLabel(const CtxtLabel &l)#
Return a CTile associated to a label.
- Parameters:
l – A label.
-
void getCTileTensorByLabel(const CtxtLabel &l, CTileTensor &c)#
Return a CTileTensor associated to a label.
- Parameters:
l – A label.
-
bool isReadOnly(const CtxtId &id) const#
Returns a Boolean whether a ciphertext is read only.
- Parameters:
id – An id of a ciphertext.
-
bool done() const#
Return whether the execution is complete.
-
PNode getNextNodeToExecute()#
Get a pointer to the next node to execute.
-
void doneExecuting(PNode &n)#
Notify the runner that the execution of a node has finished.
- Parameters:
n – The node that has finished executing
-
inline void setVerbosity(Verbosity v)#
Set the verbosity level of printouts during run.
- Parameters:
v – The new verbosity level
-
int getNumberOfOutputsThatNeed(const PNode &n) const#
Returns the number of nodes that still need the output of a node, n.
The output is needed by node X if X is not done computing.
- Parameters:
n – The node whose input is checked.
-
Runner(const HeContext &h, const Circuit &c)#