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

Function up

engine/src/kernels/batch_rows_parity.cpp:32–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30 if (e != cudaSuccess) { std::fprintf(stderr, "%s: %s\n", w, cudaGetErrorString(e)); std::exit(2); }
31}
32template <typename T> T* up(const std::vector<T>& h) {
33 T* d = nullptr;
34 ck(cudaMalloc(&d, h.size() * sizeof(T) + 64), "malloc");
35 ck(cudaMemcpy(d, h.data(), h.size() * sizeof(T), cudaMemcpyHostToDevice), "upload");
36 return d;
37}
38template <typename T> std::vector<T> down(const T* d, size_t n) {
39 std::vector<T> h(n);
40 ck(cudaMemcpy(h.data(), d, n * sizeof(T), cudaMemcpyDeviceToHost), "download");

Callers 3

scores_caseFunction · 0.70
attn_caseFunction · 0.70
gdn_caseFunction · 0.70

Calls 5

ckFunction · 0.70
cudaMallocFunction · 0.50
cudaMemcpyFunction · 0.50
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected