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

Function dev

engine/src/core/dflash2_small_bench.cpp:16–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14using namespace strata::kernels;
15
16static float* dev(size_t n, float v = 0.5f) {
17 float* p;
18 cudaMalloc((void**) &p, n * 4);
19 std::vector<float> h(n);
20 for (size_t i = 0; i < n; ++i) h[i] = v * (float) ((i * 2654435761u >> 12) % 1000) / 1000.0f + 0.01f;
21 cudaMemcpy(p, h.data(), n * 4, cudaMemcpyHostToDevice);
22 return p;
23}
24
25int main(int argc, char** argv) {
26 const int iters = argc > 1 ? std::atoi(argv[1]) : 200;

Callers 3

mainFunction · 0.70
ensure_ctx_batchMethod · 0.70
allocMethod · 0.70

Calls 3

cudaMallocFunction · 0.50
cudaMemcpyFunction · 0.50
dataMethod · 0.45

Tested by

no test coverage detected