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

Method put

engine/src/split/src/model.cpp:268–276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

266 Store* store = nullptr; // the lab's holder: the shared memory instead of cudaMalloc / cudaHostAlloc
267 std::vector<void*>* track = nullptr; // a worker placing its experts: what it allocates (Model::free_experts)
268 template <typename T> T* put(const void* host, size_t bytes) {
269 void* d = nullptr;
270 if (store) d = store->dev(c.dev, bytes);
271 else ck(cudaMalloc(&d, bytes), "cudaMalloc");
272 if (track) track->push_back(d);
273 ck(cudaMemcpy(d, host, bytes, cudaMemcpyDefault), "upload");
274 c.bytes += bytes;
275 return (T*) d;
276 }
277 // a norm as the window reads it: exactly n floats. A tensor of another width would feed garbage rows silently;
278 // the whole tensor must match, so extra rows fail too (the window never reads them)
279 float* f32(const Tensor& t, size_t n) {

Callers

nothing calls this directly

Calls 5

push_backMethod · 0.80
ckFunction · 0.70
cudaMallocFunction · 0.50
cudaMemcpyFunction · 0.50
devMethod · 0.45

Tested by

no test coverage detected