@@ -32,12 +32,21 @@ const inline int UMAMI_MAJOR_VERSION = 1;
3232const inline int UMAMI_MINOR_VERSION = 0 ;
3333
3434typedef enum {
35+ /** operation was executed successfully */
3536 UMAMI_SUCCESS ,
37+ /** an unspecified error */
3638 UMAMI_ERROR ,
39+ /** operation not implemented */
3740 UMAMI_ERROR_NOT_IMPLEMENTED ,
41+ /** the provided input key is not supported by this matrix element implementation */
3842 UMAMI_ERROR_UNSUPPORTED_INPUT ,
43+ /** the provided output key is not supported by this matrix element implementation
44+ */
3945 UMAMI_ERROR_UNSUPPORTED_OUTPUT ,
46+ /** the provided metadata key is not supported by this matrix element implementation
47+ */
4048 UMAMI_ERROR_UNSUPPORTED_META ,
49+ /** a mandatory matrix element input was not provided */
4150 UMAMI_ERROR_MISSING_INPUT ,
4251} UmamiStatus ;
4352
@@ -48,46 +57,63 @@ typedef enum {
4857} UmamiDevice ;
4958
5059typedef enum {
60+ /** `UmamiDevice` specifying the type of device */
5161 UMAMI_META_DEVICE ,
62+ /** `int` specifying the number of external particles */
5263 UMAMI_META_PARTICLE_COUNT ,
64+ /** `int` specifying the number of Feynman diagrams */
5365 UMAMI_META_DIAGRAM_COUNT ,
66+ /** `int` specifying the number of helicities */
5467 UMAMI_META_HELICITY_COUNT ,
68+ /** `int` specifying the number of colors */
5569 UMAMI_META_COLOR_COUNT ,
5670} UmamiMetaKey ;
5771
5872typedef enum {
73+ /** momenta of the external legs, type: `double`, shape: `(particle count, 4)` */
5974 UMAMI_IN_MOMENTA ,
75+ /** value for the strong coupling, type: `double`, shape: `()` */
6076 UMAMI_IN_ALPHA_S ,
77+ /** flavor index, type: `int`, shape: `()` */
6178 UMAMI_IN_FLAVOR_INDEX ,
79+ /** random number for color selection, type: `double`, shape: `()` */
6280 UMAMI_IN_RANDOM_COLOR ,
81+ /** random number for helicity selection, type: `double`, shape: `()` */
6382 UMAMI_IN_RANDOM_HELICITY ,
83+ /** random number for diagram selection, type: `double`, shape: `()` */
6484 UMAMI_IN_RANDOM_DIAGRAM ,
85+ /** externally selected helicity index, type: `int`, shape: `()` */
6586 UMAMI_IN_HELICITY_INDEX ,
87+ /** externally selected diagram index, type: `int`, shape: `()` */
6688 UMAMI_IN_DIAGRAM_INDEX ,
67- UMAMI_IN_GPU_STREAM ,
6889} UmamiInputKey ;
6990
7091typedef enum {
92+ /** value of the matrix element, type: `double`, shape: `()` */
7193 UMAMI_OUT_MATRIX_ELEMENT ,
94+ /** selected color index, type: `double`, shape: `(diagram count)` */
7295 UMAMI_OUT_DIAGRAM_AMP2 ,
96+ /** selected color index, type: `int`, shape: `()` */
7397 UMAMI_OUT_COLOR_INDEX ,
98+ /** selected helicity index, type: `int`, shape: `()` */
7499 UMAMI_OUT_HELICITY_INDEX ,
100+ /** selected diagram index, type: `int`, shape: `()` */
75101 UMAMI_OUT_DIAGRAM_INDEX ,
76- // NLO: born, virtual, poles, counterterms
77- // color: LC-ME, FC-ME
102+ /** CUDA or HIP stream for asynchronous execution. Listed as an output as it is a
103+ * mutable pointer */
104+ UMAMI_OUT_GPU_STREAM ,
78105} UmamiOutputKey ;
79106
107+ /** Implementation-defined pointer to a matrix element instance */
80108typedef void * UmamiHandle ;
81109
82110/**
83- * Creates an instance of the matrix element. Each instance is independent, so thread
84- * safety can be achieved by creating a separate one for every thread.
111+ * Retrieve metadata about the implemented matrix element
85112 *
86113 * @param meta_key
87- * path to the parameter file
88- * @param handle
89- * pointer to an instance of the subprocess. Has to be cleaned up by
90- * the caller with `free_subprocess`.
114+ * key specifying the type of metadata to be retrieved
115+ * @param result
116+ * pointer to store the result. It's type depends on the metadata key
91117 * @return
92118 * UMAMI_SUCCESS on success, error code otherwise
93119 */
@@ -97,11 +123,11 @@ UmamiStatus umami_get_meta(UmamiMetaKey meta_key, void* result);
97123 * Creates an instance of the matrix element. Each instance is independent, so thread
98124 * safety can be achieved by creating a separate one for every thread.
99125 *
100- * @param param_card_path
101- * path to the parameter file
102126 * @param handle
103127 * pointer to an instance of the subprocess. Has to be cleaned up by
104128 * the caller with `free_subprocess`.
129+ * @param param_card_path
130+ * path to the parameter file
105131 * @return
106132 * UMAMI_SUCCESS on success, error code otherwise
107133 */
@@ -146,14 +172,16 @@ UmamiStatus umami_get_parameter(
146172
147173/**
148174 * Evaluates the matrix element as a function of the given inputs, filling the
149- * requested outputs.
175+ * requested outputs. Unless otherwise specified, all inputs and outputs have a
176+ * column-major memory layout and have a batch dimension that is contiguous in memory.
150177 *
151178 * @param handle
152179 * handle of a matrix element instance
153180 * @param count
154181 * number of events to evaluate the matrix element for
155182 * @param stride
156- * stride of the batch dimension of the input and output arrays, see memory layout
183+ * stride of the batch dimension of the input and output arrays to simplify
184+ * parallel execution on CPUs, see memory layout
157185 * @param offset
158186 * offset of the event index
159187 * @param input_count
0 commit comments