@@ -8,84 +8,86 @@ typedef struct RAI_ExecutionCtx RAI_ExecutionCtx;
8
8
typedef void (* RAI_ExecutionCtx_Free_fn )(RAI_ExecutionCtx * ctx );
9
9
10
10
/**
11
- * @brief Generic struct to hold execution contexts for DAG ops. This struct holds the input and output tensors of the op, as well as inheriting classes specific functionality.
12
- *
11
+ * @brief Generic struct to hold execution contexts for DAG ops. This struct holds the input and
12
+ * output tensors of the op, as well as inheriting classes specific functionality.
13
+ *
13
14
*/
14
15
typedef struct RAI_ExecutionCtx {
15
- RAI_Tensor * * inputs ; // DAG op input tensors.
16
- RAI_Tensor * * outputs ; // DAG op output tensors.
17
- RAI_ExecutionCtx_Free_fn freeFn ; // Inheriting execution context free function.
16
+ RAI_Tensor * * inputs ; // DAG op input tensors.
17
+ RAI_Tensor * * outputs ; // DAG op output tensors.
18
+ RAI_ExecutionCtx_Free_fn freeFn ; // Inheriting execution context free function.
18
19
} RAI_ExecutionCtx ;
19
20
20
21
/**
21
22
* @brief Initializes an allocated RAI_ExecutionCtx.
22
- *
23
+ *
23
24
* @param ctx - Execution context to initialize.
24
25
* @param freeFn - Specific free function for inheriting execution contexts (script or model)
25
26
*/
26
27
void RAI_ExecutionCtx_Init (RAI_ExecutionCtx * ctx , RAI_ExecutionCtx_Free_fn freeFn );
27
28
28
29
/**
29
- * @brief Frees the execution context internal structures. To be used from an inhereting execution contxt.
30
- *
30
+ * @brief Frees the execution context internal structures. To be used from an inhereting execution
31
+ * contxt.
32
+ *
31
33
* @param ctx - Execution context to Free.
32
34
*/
33
35
void RAI_ExecutionCtx_Free (RAI_ExecutionCtx * ctx );
34
36
35
37
/**
36
38
* @brief Returns the number of input tensors of the execution context.
37
- *
39
+ *
38
40
* @param ctx - Execution context.
39
41
* @return size_t - Number of input tensors.
40
42
*/
41
43
size_t RAI_ExecutionCtx_NumInputs (RAI_ExecutionCtx * ctx );
42
44
43
45
/**
44
46
* @brief Adds an input tensor to the execution context.
45
- *
47
+ *
46
48
* @param ctx - Execution context.
47
49
* @param t - Input tensor.
48
50
*/
49
51
void RAI_ExecutionCtx_AddInput (RAI_ExecutionCtx * ctx , RAI_Tensor * t );
50
52
51
53
/**
52
54
* @brief Returns an input tensor from the execution context, for a given index.
53
- *
55
+ *
54
56
* @param ctx - Execution context.
55
- * @param index
57
+ * @param index
56
58
* @return RAI_Tensor* - Input tensor.
57
59
*/
58
60
RAI_Tensor * RAI_ExecutionCtx_GetInput (RAI_ExecutionCtx * ctx , size_t index );
59
61
60
62
/**
61
63
* @brief Returns the number of output tensors/placeholders of the execution context.
62
- *
64
+ *
63
65
* @param ctx - Execution context.
64
66
* @return size_t - Number of output tensors/placeholders.
65
67
*/
66
68
size_t RAI_ExecutionCtx_NumOutputs (RAI_ExecutionCtx * ctx );
67
69
68
70
/**
69
71
* @brief Sets (appends) an output tensor placeholder to the execution context.
70
- *
72
+ *
71
73
* @param ctx - Execution context.
72
74
*/
73
75
void RAI_ExecutionCtx_AddOuputPlaceholder (RAI_ExecutionCtx * ctx );
74
76
75
77
/**
76
78
* @brief Sets an output tensor in a specfic index, populated before by a placeholder.
77
- *
79
+ *
78
80
* @param ctx - Execution context.
79
81
* @param t - Output tensor.
80
- * @param index
82
+ * @param index
81
83
*/
82
84
void RAI_ExecutionCtx_SetOutput (RAI_ExecutionCtx * ctx , RAI_Tensor * t , size_t index );
83
85
84
86
/**
85
87
* @brief Returns an output tensor from the execution context, for a given index.
86
- *
88
+ *
87
89
* @param ctx - Execution context.
88
- * @param index
90
+ * @param index
89
91
* @return RAI_Tensor* - Output tensor.
90
92
*/
91
93
RAI_Tensor * RAI_ExecutionCtx_GetOutput (RAI_ExecutionCtx * ctx , size_t index );
0 commit comments