MCPcopy Create free account
hub / github.com/RenderKit/oidn / initImage

Function initImage

apps/oidnBenchmark.cpp:96–101  ·  view source on GitHub ↗

Initializes an image with random values

Source from the content-addressed store, hash-verified

94
95// Initializes an image with random values
96void initImage(ImageBuffer& image, Random& rng, float minValue, float maxValue)
97{
98 for (size_t i = 0; i < image.getSize(); ++i)
99 image.set(i, minValue + rng.getFloat() * (maxValue - minValue));
100 image.toDevice();
101}
102
103// Runs a benchmark and returns the total runtime
104double runBenchmark(DeviceRef& device, const Benchmark& bench)

Callers 1

runBenchmarkFunction · 0.85

Calls 4

getSizeMethod · 0.80
getFloatMethod · 0.80
setMethod · 0.45
toDeviceMethod · 0.45

Tested by

no test coverage detected