Intel® Math Kernel Library 2018 Developer Reference - C

Handling Array Layouts

The type dnnLayout_t is a pointer to an opaque structure that describes layouts of arrays in the memory. DNN functions distinguish the following kinds of layouts:

To create a plain layout, in your application call a dnnLayoutCreate_<Data Type> function and pass to it the dimension, sizes, and strides of the array.

To create a custom layout for a resource of a DNN operation, call a dnnLayoutCreateFromPrimitive_<Data Type> function and pass to it the description of the operation and index of the resource.

In order to save and restore a layout, use dnnLayoutSerialize_<Data Type> and dnnLayoutDeserialize_<Data Type>, respectively. Use dnnLayoutSerializationBufferSize_<Data Type> to calculate the amount of memory in bytes required for serialization.

To destroy a layout, call a dnnLayoutDelete_<Data Type> function.