You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
\item seed: the seed for the random number generator
266
+
\item regressionOrder: the regression order to be used within regression models
267
+
\end{itemize}
257
268
\end{itemize}
258
269
The output parameter is a pair consisting of
259
270
\begin{itemize}
@@ -268,19 +279,19 @@ \subsection{Implementation of the ComputeContext interface}\label{implComputeCon
268
279
\begin{itemize}
269
280
\item\verb+dim+ the dimension (typically the number of assets in a MC simulation)
270
281
\item\verb+steps+ the number of steps (typically the number of time steps in a MC simulation)
271
-
\item\verb+seed+ the seed of the random number generation, equal seeds must generate identical variates, different
272
-
seeds might or might not generate different variates
273
282
\end{itemize}
274
283
The output parameter is a vector of a vector of ids for the generated variates. The inner vector loops of the steps,
275
284
the outer vector over the dimensions.
276
285
\item\verb+applyOperation()+: apply an operation to a list of arguments and return the id of the result. The list of
277
286
operations is described in \ref{randomVariableOpCodes}
278
287
\item\verb+freeVariable()+: indicate that the variable with the given id will no longer be referenced in subsequent
279
288
calculations. The variable id can be reused as a new variable.
280
-
\item\verb+declareOutputVariable()+: declare a variable with given id as part of the output vector
289
+
\item\verb+declareOutputVariable()+: declare a variable with given id as part of the output vector.
281
290
\item\verb+finalizeCalculation()+: execute the calculation and populate the given vector of vector of floats with the
282
291
result. The inner vector is given as a raw pointer and must have the size of the calculation. The outer vector matches
283
292
the output variables in the order they were declared before.
293
+
\item\verb+deviceInfo()+: provide key-value pairs that describes the device, only used for information purposes
294
+
\item\verb+supportsDoublePreicions()+: should return true if doule precision is supported, otherwise false
284
295
\item\verb+debugInfo()+: provide info on the number of elementary operations and timings on data copying, program build
285
296
and calculations. This info is collected if a new calculation is started with flag debug set to true
286
297
\end{itemize}
@@ -289,12 +300,17 @@ \subsection{Implementation of the ComputeContext interface}\label{implComputeCon
289
300
290
301
\begin{enumerate}
291
302
\item\verb+initiateCalculation()+: once
292
-
\item\verb+createInputVariable()+: never, once, or several times
293
-
\item\verb+createInputVariates()+: never, once, or several times
294
-
\item\verb+applyOperation()+: only called if the current calculation is not replayed from a previous calculation, then can be called never, once, or several times
295
-
\item\verb+freeVariable()+: only called if the current calculation is not replayed, then can be called never, once, or several times
296
-
\item\verb+declareOutputVariable()+: only called if the current calculation is not replayed, then can be called never, once, or several times
297
-
\item\verb+finalizeCalculation()+: never or once
303
+
\item\verb+createInputVariable()+: never, once, or several times, if a calc is replayed, the same number and type of
304
+
input variables must be created (just with possibly different values)
305
+
\item\verb+createInputVariates()+: called if the current calculation is not replayed from a previous calculation, then
306
+
can be called never, once or several times
307
+
\item\verb+applyOperation()+: only called if the current calculation is not replayed from a previous calculation, then
308
+
can be called never, once, or several times
309
+
\item\verb+freeVariable()+: only called if the current calculation is not replayed, then can be called never, once, or
310
+
several times
311
+
\item\verb+declareOutputVariable()+: only called if the current calculation is not replayed, then can be called never,
312
+
once, or several times
313
+
\item\verb+finalizeCalculation()+: once
298
314
\end{enumerate}
299
315
300
316
\subsection{Random Variable Op Codes}\label{randomVariableOpCodes}
@@ -373,7 +389,7 @@ \subsection{Initiation of a calculation}
0 commit comments