Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/NVIDIA/cuda-samples
/ RandomInit
Function
RandomInit
cpp/0_Introduction/vectorAddDrv/vectorAddDrv.cpp:220–225 ·
view source on GitHub ↗
Allocates an array with random float entries.
Source
from the content-addressed store, hash-verified
218
}
219
// Allocates an array with random float entries.
220
void RandomInit(float *data, int n)
221
{
222
for (int i = 0; i < n; ++i) {
223
data[i] = rand() / (float)RAND_MAX;
224
}
225
}
Callers
1
main
Function · 0.70
Calls
no outgoing calls
Tested by
no test coverage detected