76 int index = atomicAdd(heap_counter_, 1);
81 int index = atomicSub(heap_counter_, 1);
82 heap_[index - 1] = ptr;
87 values_ + ptr * dsize_value_);
93 const int i = blockIdx.x * blockDim.x + threadIdx.x;
118 gpu_context_.
keys_ =
static_cast<uint8_t *
>(
120 gpu_context_.
values_ =
static_cast<uint8_t *
>(
123 const int blocks = (capacity + kThreadsPerBlock - 1) / kThreadsPerBlock;
124 ResetInternalKvPairManagerKernel<<<blocks, kThreadsPerBlock>>>(
129 int heap_counter = 0;
131 cudaMemset(gpu_context_.
values_, 0, capacity * dsize_value));
133 &heap_counter,
Device(
"CPU:0"),
sizeof(
int));
144 std::vector<int> ret;
int * heap_counter_
Definition: InternalKvPairManager.h:49
__global__ void ResetInternalKvPairManagerKernel(InternalKvPairManagerContext ctx)
Definition: InternalKvPairManager.h:91
__device__ void Free(addr_t ptr)
Definition: InternalKvPairManager.h:80
__device__ addr_t Allocate()
Definition: InternalKvPairManager.h:75
static void Memcpy(void *dst_ptr, const Device &dst_device, const void *src_ptr, const Device &src_device, size_t num_bytes)
Definition: MemoryManager.cpp:48
uint8_t * values_
Definition: InternalKvPairManager.h:47
__device__ iterator_t extract_iterator(addr_t ptr)
Definition: InternalKvPairManager.h:85
static void Free(void *ptr, const Device &device)
Definition: MemoryManager.cpp:44
int heap_counter()
Definition: InternalKvPairManager.h:151
#define OPEN3D_CUDA_CHECK(err)
Definition: CUDAUtils.h:57
Definition: InternalKvPairManager.h:99
static void * Malloc(size_t byte_size, const Device &device)
Definition: MemoryManager.cpp:40
int dsize_key_
Definition: InternalKvPairManager.h:52
InternalKvPairManagerContext gpu_context_
Definition: InternalKvPairManager.h:101
InternalKvPairManager(int capacity, int dsize_key, int dsize_value, const Device &device)
Definition: InternalKvPairManager.h:105
Device device_
Definition: InternalKvPairManager.h:102
std::vector< int > DownloadHeap()
Definition: InternalKvPairManager.h:143
int capacity_
Definition: InternalKvPairManager.h:54
const char const char value recording_handle imu_sample recording_handle uint8_t size_t data_size k4a_record_configuration_t config target_format k4a_capture_t capture_handle k4a_imu_sample_t imu_sample playback_handle k4a_logging_message_cb_t void min_level device_handle k4a_imu_sample_t timeout_in_ms capture_handle capture_handle capture_handle image_handle temperature_c int
Definition: K4aPlugin.cpp:476
Definition: PinholeCameraIntrinsic.cpp:35
~InternalKvPairManager()
Definition: InternalKvPairManager.h:136
uint8_t * keys_
Definition: InternalKvPairManager.h:46
int dsize_value_
Definition: InternalKvPairManager.h:53
uint32_t addr_t
Definition: Traits.h:49
addr_t * heap_
Definition: InternalKvPairManager.h:48
Definition: InternalKvPairManager.h:44