MCPcopy Create free account
hub / github.com/NVIDIA/cuda-samples / RandomInit

Function RandomInit

cpp/0_Introduction/vectorAddMMAP/vectorAddMMAP.cpp:256–261  ·  view source on GitHub ↗

Allocates an array with random float entries.

Source from the content-addressed store, hash-verified

254}
255// Allocates an array with random float entries.
256void RandomInit(float *data, int n)
257{
258 for (int i = 0; i < n; ++i) {
259 data[i] = rand() / (float)RAND_MAX;
260 }
261}

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected