65 #include "cyber/common/log.h" 69 namespace perception {
73 #ifndef PERCEPTION_CPU_ONLY 80 CHECK(*ptr) <<
"host allocation of size " << size <<
" failed";
84 #ifndef PERCEPTION_CPU_ONLY 120 size_t size() {
return size_; }
122 #ifndef PERCEPTION_CPU_ONLY 137 bool cpu_malloc_use_cuda_;
void set_cpu_data(void *data)
Definition: syncedmem.h:101
SyncedHead
Definition: syncedmem.h:101
SyncedHead head() const
Definition: syncedmem.h:116
#define BASE_CUDA_CHECK(condition)
Definition: common.h:36
void operator=(const SyncedMemory &)=delete
void set_head_cpu()
Definition: syncedmem.h:119
void PerceptionMallocHost(void **ptr, size_t size, bool use_cuda)
Definition: syncedmem.h:72
void set_head_gpu()
Definition: syncedmem.h:118
void * mutable_cpu_data()
void async_gpu_push(const cudaStream_t &stream)
Definition: syncedmem.h:101
Definition: syncedmem.h:101
SyncedMemory(bool use_cuda)
void set_gpu_data(void *data)
void set_head(SyncedHead head)
Definition: syncedmem.h:117
void * mutable_gpu_data()
Manages memory allocation and synchronization between the host (CPU) and device (GPU).
Definition: syncedmem.h:99
size_t size()
Definition: syncedmem.h:120
void PerceptionFreeHost(void *ptr, bool use_cuda)
Definition: syncedmem.h:83
Definition: syncedmem.h:101