Created
May 5, 2020 12:21
-
-
Save Munksgaard/edc882b0d19716d9370bb11fabb80b0f 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
-- A simple test for index-function generalization across a for loop | |
-- == | |
-- input { [0, 1000, 42, 1001, 50000] } | |
-- output { 52043i32 } | |
-- structure gpu { Copy 0 } | |
let main [n] (a: [n]i32): i32 = | |
let b = loop xs = a[1:] for i < n / 2 - 2 do | |
xs[i:] -- This will result in a copy, but it needn't | |
in reduce (+) 0 b |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment