Mila 0.13.48
Deep Neural Network Library
Loading...
Searching...
No Matches
Mila::Dnn::Compute::Cpu::Detail Namespace Reference

Functions

template<TensorDataType TDataType>
void copyHostToHostImpl (const void *src_data, void *dst_data, size_t count)
 Fast raw-memory copy for host-accessible tensors of same abstract type.
template<TensorDataType TSrcDataType, TensorDataType TDstDataType>
void copyHostToHostWithConversionImpl (const void *src_data, void *dst_data, size_t count)
 Element-wise host copy with conversion between abstract data types.

Function Documentation

◆ copyHostToHostImpl()

template<TensorDataType TDataType>
void Mila::Dnn::Compute::Cpu::Detail::copyHostToHostImpl ( const void * src_data,
void * dst_data,
size_t count )
inline

Fast raw-memory copy for host-accessible tensors of same abstract type.

Copies count logical elements from src_data to dst_data using a byte-wise memcpy based on the abstract element size for TDataType.

Template Parameters
TDataTypeAbstract tensor data type for src and dst
Parameters
src_dataPointer to source memory (may be null)
dst_dataPointer to destination memory (may be null)
countNumber of logical elements to copy
Note
No operation performed if either pointer is null or count is zero.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ copyHostToHostWithConversionImpl()

template<TensorDataType TSrcDataType, TensorDataType TDstDataType>
void Mila::Dnn::Compute::Cpu::Detail::copyHostToHostWithConversionImpl ( const void * src_data,
void * dst_data,
size_t count )
inline

Element-wise host copy with conversion between abstract data types.

Copies count logical elements from src_data (type TSrcDataType) to dst_data (type TDstDataType) performing a per-element conversion via static_cast to the native CPU types.

If the source and destination abstract types are the same, this forwards to copyHostToHostImpl.

Template Parameters
TSrcDataTypeAbstract source tensor data type
TDstDataTypeAbstract destination tensor data type
Parameters
src_dataPointer to source memory (may be null)
dst_dataPointer to destination memory (may be null)
countNumber of logical elements to convert and copy
Note
No operation performed if either pointer is null or count is zero.
Loop form chosen to enable compiler auto-vectorization.
Here is the call graph for this function:
Here is the caller graph for this function: