54 return static_cast<T*
>(ptr);
64 return device_id_ == other.device_id_;
77 template <
typename T2>
static void * Malloc(size_t byte_size, const Device &device)
Definition MemoryManager.cpp:22
static void Free(void *ptr, const Device &device)
Frees previously allocated memory at address ptr on device device.
Definition MemoryManager.cpp:28
Definition StdAllocator.h:23
int GetDeviceID() const
Returns the device on which memory is allocated.
Definition StdAllocator.h:73
void deallocate(T *p, std::size_t n)
Deallocates memory from pointer p of size n .
Definition StdAllocator.h:58
StdAllocator & operator=(const StdAllocator &)=default
Default copy assignment operator.
T * allocate(std::size_t n)
Allocates memory of size n.
Definition StdAllocator.h:51
StdAllocator(const StdAllocator &)=default
Default copy constructor.
StdAllocator & operator=(StdAllocator &&)=default
Default move assignment operator.
bool operator==(const StdAllocator &other) const
Returns true if the instances are equal, false otherwise.
Definition StdAllocator.h:63
T value_type
T.
Definition StdAllocator.h:26
bool operator!=(const StdAllocator &other) const
Returns true if the instances are not equal, false otherwise.
Definition StdAllocator.h:68
StdAllocator(const StdAllocator< U > &other)
Rebind copy constructor.
Definition StdAllocator.h:48
StdAllocator(int device_id)
Constructor from device.
Definition StdAllocator.h:32
StdAllocator()=default
Default constructor.
StdAllocator(StdAllocator &&)=default
Default move constructor.
Definition PinholeCameraIntrinsic.cpp:16