MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / main

Function main

test/random_practrand.cpp:11–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9#include <cstdio>
10
11int main(int argc, char **argv) {
12 int backend = argc > 1 ? atoi(argv[1]) : 0;
13 setBackend(static_cast<Backend>(backend));
14 int device = argc > 2 ? atoi(argv[2]) : 0;
15 setDevice(device);
16 int rng = argc > 3 ? atoi(argv[3]) : 100;
17 setDefaultRandomEngineType(static_cast<randomEngineType>(rng));
18
19 setSeed(0xfe47fe0cc078ec30ULL);
20 int samples = 1024 * 1024;
21 while (1) {
22 array values = randu(samples, u32);
23 uint32_t *pvalues = values.host<uint32_t>();
24 fwrite((void *)pvalues, samples * sizeof(*pvalues), 1, stdout);
25 freeHost(pvalues);
26 }
27}

Callers

nothing calls this directly

Calls 6

setSeedFunction · 0.85
randuFunction · 0.85
freeHostFunction · 0.85
setBackendFunction · 0.50
setDeviceFunction · 0.50

Tested by

no test coverage detected