-
-
Save ooooak/e38f87f7637d58f506aa2f41d3ad7e2f to your computer and use it in GitHub Desktop.
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
(fun downsweep (xPrev Int tree String) Unit | |
(let [length 10000000) | |
input (map #(toArray (- % (- 100 50))) '(0 until length)) | |
output (array (- 1 length) :float) | |
seqtime (standardConfig measure (runningAverage input output)) | |
partime (standardConfig measure (parRunningAverage input output 10000))] | |
(case xprev | |
{:node (left right)} | |
(parallel (downsweep xPrev, left) | |
(downsweep (+ xPrev left.xPrev) right)))) | |
def downsweep (xPrev int tree string) { | |
length: 10000000 | |
input: (map #(toArray (- % (- 100 50))) '(0 until length)) | |
output: (array (- 1 length) :float) | |
seqtime: (standardConfig measure (runningAverage input output)) | |
partime: (standardConfig measure (parRunningAverage input output 10000)) | |
case xprev { | |
{:node (left right)} (parallel | |
(downsweep xPrev, left) | |
(downsweep (+ xPrev left.xPrev) right)) | |
:else | |
} | |
} | |
(def downsweep (xPrev int tree string) | |
(let | |
length 10000000 | |
input (map #(toArray (- % (- 100 50))) '(0 until length)) | |
output (array (- 1 length) :float) | |
seqtime (standardConfig measure (runningAverage input output)) | |
partime (standardConfig measure (parRunningAverage input output 10000)) | |
(case xprev | |
{:node (left right)} (parallel (downsweep xPrev, left) (downsweep (+ xPrev left.xPrev) right)) | |
:else none)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment