Mila
Deep Neural Network Library
Loading...
Searching...
No Matches
Mila::Dnn::detail Namespace Reference

Functions

template<typename MR >
constexpr size_t get_alignment ()
 Determines the appropriate memory alignment based on the memory resource type.
 

Variables

constexpr size_t CPU_SIMD_ALIGN = 64
 AVX-512 alignment for CPU operations.
 
constexpr size_t CUDA_WARP_SIZE = 32
 CUDA warp size alignment (32 threads)
 

Function Documentation

◆ get_alignment()

template<typename MR >
constexpr size_t Mila::Dnn::detail::get_alignment ( )
constexpr

Determines the appropriate memory alignment based on the memory resource type.

For GPU memory resources, alignment is based on CUDA warp size. For CPU memory resources, alignment is based on AVX-512 requirements.

Template Parameters
MRThe memory resource type
Returns
constexpr size_t The required alignment in bytes

Variable Documentation

◆ CPU_SIMD_ALIGN

constexpr size_t Mila::Dnn::detail::CPU_SIMD_ALIGN = 64
constexpr

AVX-512 alignment for CPU operations.

This constant defines the alignment required for optimal SIMD operations using AVX-512 instructions on CPU.

◆ CUDA_WARP_SIZE

constexpr size_t Mila::Dnn::detail::CUDA_WARP_SIZE = 32
constexpr

CUDA warp size alignment (32 threads)

This constant defines the alignment required for optimal memory access patterns when using CUDA warp-level operations.