Caffe2 - C++ API
A deep learning, cross platform ML framework
Public Member Functions
caffe2::mkl::MKLMemory< T > Class Template Reference

A wrapper around an opaque MKL internal resource that has certain layouts and convertion primitives set up. More...

#include <mkl_memory.h>

Public Member Functions

 MKLMemory (const size_t dimension, const size_t size[], const size_t strides[], const dnnPrimitive_t primitive=nullptr, const dnnResourceType_t type=dnnResourceNumber, bool share_mem_if_possible=false)
 
template<typename IndexType >
 MKLMemory (const vector< IndexType > &dims, const dnnPrimitive_t primitive=nullptr, const dnnResourceType_t type=dnnResourceNumber, bool share_mem_if_possible=false)
 
void Reset (const size_t dimension, const size_t size[], const size_t strides[], const dnnPrimitive_t primitive=nullptr, const dnnResourceType_t type=dnnResourceNumber, bool share_mem_if_possible=false)
 
template<typename IndexType >
void Reset (const vector< IndexType > &dims, const dnnPrimitive_t primitive=nullptr, const dnnResourceType_t type=dnnResourceNumber, bool share_mem_if_possible=false)
 
void CopyFrom (const void *ptr)
 
void CopyFrom (const TensorCPU &tensor)
 
void CopyFrom (const MKLMemory< T > &other)
 
bool ShareFromRaw (const void *ptr)
 
bool ShareFromTensor (const TensorCPU &tensor)
 
bool ShareFrom (const MKLMemory< T > &other)
 
void CopyTo (void *ptr) const
 
void CopyTo (TensorCPU *tensor) const
 
void CopyTo (MKLMemory< T > *other, const dnnPrimitive_t primitive=nullptr, const dnnResourceType_t type=dnnResourceNumber)
 
void * buffer ()
 
void * buffer () const
 
const vector< TIndex > & dims () const
 
const int ndim () const
 
int dim32 (const int i) const
 
TIndex dim (const int i) const
 Returns the i-th dimension of the tensor. More...
 
const LayoutWrapper< T > & layout () const
 
std::shared_ptr< void > View (dnnLayout_t layout_wanted, dnnPrimitive_t primitive, dnnResourceType_t type) const
 

Detailed Description

template<typename T>
class caffe2::mkl::MKLMemory< T >

A wrapper around an opaque MKL internal resource that has certain layouts and convertion primitives set up.

Most of the MKLMemory functions are not thread safe.

Definition at line 137 of file mkl_memory.h.

Member Function Documentation

◆ dim()

template<typename T>
TIndex caffe2::mkl::MKLMemory< T >::dim ( const int  i) const
inline

Returns the i-th dimension of the tensor.

Note that the passed in index must be between 0 (inclusive) and the number of dimensions, otherwise this function will produce a fatal message.

Definition at line 397 of file mkl_memory.h.


The documentation for this class was generated from the following file: