Skip to content

Instantly share code, notes, and snippets.

@nanki
Created April 1, 2012 02:09
Show Gist options
  • Save nanki/2270606 to your computer and use it in GitHub Desktop.
Save nanki/2270606 to your computer and use it in GitHub Desktop.
compute max value.
operator entry() {
Scalar array[];
for (Size i = 0; i < 1000000; i++) {
array.push(1);
array.push(0);
array.push(2);
array.push(3);
array.push(1);
array.push(5);
}
ArrayProducer<Scalar> vp = createConstArray(array);
ValueProducer<Scalar> r = createReduce(vp, max);
report r.produce();
}
operator max(
Scalar input,
io Scalar output) {
output = input > output ? input : output;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment