1#ifndef BASE_CORE_CPU_ALLOCATOR_H_
2#define BASE_CORE_CPU_ALLOCATOR_H_
26 void *
allocate(
size_t size)
override;
36 void *
allocate(
size_t size,
size_t alignment)
override;
43 void free(
void *ptr)
override;
An abstract base class for memory allocators.
Definition allocator.h:17
An Allocator subclass for CPU memory.
Definition cpu_allocator.h:16
container::DeviceType GetDeviceType() override
Get the type of device used by the TensorBuffer.
Definition cpu_allocator.cpp:49
void free(void *ptr) override
Free a block of CPU memory that was previously allocated by this allocator.
Definition cpu_allocator.cpp:39
void * allocate(size_t size) override
Allocate a block of CPU memory with the given size and default alignment.
Definition cpu_allocator.cpp:15
DeviceType
Definition tensor_enums.h:28