Function Pennylane::Util::alignedAlloc

Function Documentation

inline auto Pennylane::Util::alignedAlloc(uint32_t alignment, size_t bytes, bool zero_init = false) -> void*

Custom aligned allocate function.

Note that alignment must be larger than max_align_t. Otherwise, the behavior is undefined.

Parameters
  • alignment – Alignment value we want for the data pointer

  • bytes – Number of bytes to allocate

Returns

Pointer to the allocated memory