1#ifndef BASE_CORE_GPU_ALLOCATOR_H_
2#define BASE_CORE_GPU_ALLOCATOR_H_
23 void *
allocate(
size_t size)
override;
33 void *
allocate(
size_t size,
size_t alignment)
override;
40 void free(
void *ptr)
override;
An abstract base class for memory allocators.
Definition allocator.h:17
An allocator that allocates memory on a GPU device.
Definition gpu_allocator.h:14
void * allocate(size_t size) override
Allocate a block of memory with the given size and default alignment on GPU.
Definition gpu_allocator.cpp:20
void free(void *ptr) override
Free a block of GPU memory that was previously allocated by this allocator.
Definition gpu_allocator.cpp:42
container::DeviceType GetDeviceType() override
Get the type of memory used by the TensorBuffer.
Definition gpu_allocator.cpp:48
DeviceType
The type of memory used by an allocator.
Definition tensor_types.h:73