Function spdl::core::cpu_buffer

Function Documentation

CPUBufferPtr spdl::core::cpu_buffer(const std::vector<size_t> &shape, ElemClass elem_class = ElemClass::UInt, size_t depth = sizeof(uint8_t), std::shared_ptr<CPUStorage> storage = nullptr)

Create a CPU buffer with specified shape and data type.

Parameters:
  • shape – Dimensions of the buffer.

  • elem_class – Element class (Int, UInt, or Float).

  • depth – Size of each element in bytes.

  • storage – Optional pre-allocated storage. If not provided, allocates new storage.

Returns:

CPUBuffer instance.