Created
April 1, 2012 02:09
-
-
Save nanki/2270606 to your computer and use it in GitHub Desktop.
compute max value.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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