Developer Guide

Contents

Generic Interfaces

Tensors provide interfaces for data management, such as memory allocation and deallocation, and respective methods for memory access and dimension management.
Use the
getNumberOfDimensions()
and
getDimensions()
methods to determine the number of dimensions and size of all dimensions, respectively.
Use the
shuffleDimensions()
method to change logical indexing of tensor dimensions without changing the data layout. This method changes the dimensions order, visible to algorithms.
Use the
allocateDataMemory()
and
freeDataMemory()
methods to allocate and deallocate memory needed to store the data associated with a given tensor. The dimensions and data associated with them determine the amount of memory required to store the data. The
getDataMemoryStatus()
method enables you to determine whether the memory is allocated by the
allocateDataMemory()
method, a user provided a pointer to the allocated data, or no data is currently associated with the tensor.
Use the
assign
method to initialize elements of a tensor with a certain value.
Use the
resize()
service method to allocate or reallocate the memory after the construction of the tensor. This method modifies the number of dimensions and their size according to the provided parameter and operates according to the description below:
  • If a memory buffer for the tensor is not allocated, this method allocates memory of the respective size for the tensor.
  • If a memory buffer for the tensor is allocated by the library and the dimensions passed to the function require a larger memory buffer, the method deallocates it and allocates a new buffer of the respective size.
  • If a memory buffer for the tensor is provided by the user and the dimensions passed to the function require a larger memory buffer, the method internally allocates a new buffer of the respective size. The memory buffer provided by the user is not deallocated by the library in this case.
  • Otherwise, the method modifies the respective dimensions in the internal data structures.
The default data type for a homogeneous tensor is
float
.

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804