Grok 12.0.1
Classes | Namespaces | Macros | Typedefs | Functions
aligned_allocator.h File Reference
#include <algorithm>
#include <array>
#include <cassert>
#include <cstdint>
#include <cstring>
#include <initializer_list>
#include <memory>
#include <type_traits>
#include <utility>
#include <vector>
#include "hwy/base.h"
#include "hwy/per_target.h"

Go to the source code of this file.

Classes

class  hwy::AlignedDeleter
 
struct  hwy::AlignedAllocator< T >
 
class  hwy::AlignedFreer
 
class  hwy::Span< T >
 
class  hwy::AlignedNDArray< T, axes >
 

Namespaces

namespace  hwy
 
namespace  hwy::detail
 

Macros

#define HWY_ALIGNMENT   128
 

Typedefs

using hwy::AllocPtr = void* (*)(void* opaque, size_t bytes)
 
using hwy::FreePtr = void (*)(void* opaque, void* memory)
 
template<typename T >
using hwy::AlignedUniquePtr = std::unique_ptr<T, AlignedDeleter>
 
template<class T >
using hwy::AlignedVector = std::vector<T, AlignedAllocator<T>>
 
template<typename T >
using hwy::AlignedFreeUniquePtr = std::unique_ptr<T, AlignedFreer>
 

Functions

template<typename T >
HWY_API constexpr bool hwy::IsAligned (T *ptr, size_t align=HWY_ALIGNMENT)
 
HWY_DLLEXPORT void * hwy::AllocateAlignedBytes (size_t payload_size, AllocPtr alloc_ptr=nullptr, void *opaque_ptr=nullptr)
 
HWY_DLLEXPORT void hwy::FreeAlignedBytes (const void *aligned_pointer, FreePtr free_ptr, void *opaque_ptr)
 
template<typename T , typename... Args>
AlignedUniquePtr< T > hwy::MakeUniqueAlignedWithAlloc (AllocPtr alloc, FreePtr free, void *opaque, Args &&... args)
 
template<typename T , typename... Args>
AlignedUniquePtr< T > hwy::MakeUniqueAligned (Args &&... args)
 
template<class T , class V >
constexpr bool hwy::operator== (const AlignedAllocator< T > &, const AlignedAllocator< V > &) noexcept
 
template<class T , class V >
constexpr bool hwy::operator!= (const AlignedAllocator< T > &, const AlignedAllocator< V > &) noexcept
 
static constexpr size_t hwy::detail::ShiftCount (size_t n)
 
template<typename T >
T * hwy::detail::AllocateAlignedItems (size_t items, AllocPtr alloc_ptr, void *opaque_ptr)
 
template<typename T , typename... Args>
AlignedUniquePtr< T[]> hwy::MakeUniqueAlignedArrayWithAlloc (size_t items, AllocPtr alloc, FreePtr free, void *opaque, Args &&... args)
 
template<typename T , typename... Args>
AlignedUniquePtr< T[]> hwy::MakeUniqueAlignedArray (size_t items, Args &&... args)
 
template<typename T >
AlignedFreeUniquePtr< T[]> hwy::AllocateAligned (const size_t items, AllocPtr alloc, FreePtr free, void *opaque)
 
template<typename T >
AlignedFreeUniquePtr< T[]> hwy::AllocateAligned (const size_t items)
 

Macro Definition Documentation

◆ HWY_ALIGNMENT

#define HWY_ALIGNMENT   128