MCPcopy Create free account
hub / github.com/Niko1221/Strata / alloc_state

Function alloc_state

engine/tests/hip/prefill_native_batch.cpp:37–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35};
36
37bool alloc_state(IndexState& s, int64_t max_cells) {
38 CHECK(cudaMalloc((void**) &s.tail, (BLOCK - 1) * IDX * sizeof(float)));
39 CHECK(cudaMalloc((void**) &s.dead, IDX * sizeof(float)));
40 CHECK(cudaMalloc((void**) &s.pooled, (size_t) (max_cells / BLOCK + 1) * IDX * sizeof(float)));
41 CHECK(cudaMalloc((void**) &s.block_pos, sizeof(int32_t)));
42 return true;
43}
44void free_state(IndexState& s) {
45 if (s.tail) cudaFree(s.tail);
46 if (s.dead) cudaFree(s.dead);

Callers 2

qsa_caseFunction · 0.85
qsa_chunks_caseFunction · 0.85

Calls 1

cudaMallocFunction · 0.50

Tested by

no test coverage detected