1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
/*
Copyright (c) 2010-2023, Intel Corporation
SPDX-License-Identifier: BSD-3-Clause
*/
export void simple(uniform float vin[], uniform float vout[],
uniform int count) {
foreach (index = 0 ... count) {
// Load the appropriate input value for this program instance.
float v = vin[index];
// Do an arbitrary little computation, but at least make the
// computation dependent on the value being processed
if (v < 3.)
v = v * v;
else
v = sqrt(v);
// And write the result to the output array.
vout[index] = v;
}
}
|