Levels of Abstraction
- Operation descriptors (one for each supported primitive) describe an operation’s most basic properties without specifying, for example, which engine will be used to compute them. For example, convolution descriptor describes shapes of source, destination, and weights tensors, propagation kind (forward, backward with respect to data or weights), and other implementation-independent parameters.
- Primitive descriptors (dnnl_primitive_desc_t; in the C++ API there are multiple types for each supported primitive) are at an abstraction level in between operation descriptors and primitives and can be used to inspect details of a specific primitive implementation like expected memory formats via queries to implement memory format propagation (see Memory Format Propagation) without having to fully instantiate a primitive.
Creating Memory Objects and Primitives
- Create a primitive descriptor based on the operation descriptor, engine and attributes.
- Create a primitive based on the primitive descriptor obtained in step 2.