Skip to content

Commit

Permalink
update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorTaelin committed Oct 16, 2023
1 parent 5f689d7 commit 5fff0b6
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
8 changes: 4 additions & 4 deletions examples/sort/bitonic/main.hvm
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Atomic Swapper (HVM builtin)
//(U60.swap 0 a b) = (Both a b)
//(U60.swap n a b) = (Both b a)
//(Data.U60.swap 0 a b) = (Both a b)
//(Data.U60.swap n a b) = (Both b a)

// Swaps distant values in parallel; corresponds to a Red Box
(Warp s (Leaf a) (Leaf b)) = (U60.swap (^ (> a b) s) (Leaf a) (Leaf b))
(Warp s (Leaf a) (Leaf b)) = (Data.U60.swap (^ (> a b) s) (Leaf a) (Leaf b))
(Warp s (Both a b) (Both c d)) = (Join (Warp s a c) (Warp s b d))

// Rebuilds the warped tree in the original order
Expand Down Expand Up @@ -33,4 +33,4 @@
(Sum (Leaf x)) = x
(Sum (Both a b)) = (+ (Sum a) (Sum b))

(Main n) = (Sum (Sort 0 (Rev (Gen n 0))))
(Main n) = (Sum (Sort 0 (Rev (Gen 0 0))))
48 changes: 24 additions & 24 deletions examples/sort/radix/main.hvm
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,30 @@
// Radix : U60 -> Map
(Radix n) =
let r = Used
let r = (U60.swap (& n 1) r Free)
let r = (U60.swap (& n 2) r Free)
let r = (U60.swap (& n 4) r Free)
let r = (U60.swap (& n 8) r Free)
let r = (U60.swap (& n 16) r Free)
let r = (U60.swap (& n 32) r Free)
let r = (U60.swap (& n 64) r Free)
let r = (U60.swap (& n 128) r Free)
let r = (U60.swap (& n 256) r Free)
let r = (U60.swap (& n 512) r Free)
let r = (U60.swap (& n 1024) r Free)
let r = (U60.swap (& n 2048) r Free)
let r = (U60.swap (& n 4096) r Free)
let r = (U60.swap (& n 8192) r Free)
let r = (U60.swap (& n 16384) r Free)
let r = (U60.swap (& n 32768) r Free)
let r = (U60.swap (& n 65536) r Free)
let r = (U60.swap (& n 131072) r Free)
let r = (U60.swap (& n 262144) r Free)
let r = (U60.swap (& n 524288) r Free)
let r = (U60.swap (& n 1048576) r Free)
let r = (U60.swap (& n 2097152) r Free)
let r = (U60.swap (& n 4194304) r Free)
let r = (U60.swap (& n 8388608) r Free)
let r = (Data.U60.swap (& n 1) r Free)
let r = (Data.U60.swap (& n 2) r Free)
let r = (Data.U60.swap (& n 4) r Free)
let r = (Data.U60.swap (& n 8) r Free)
let r = (Data.U60.swap (& n 16) r Free)
let r = (Data.U60.swap (& n 32) r Free)
let r = (Data.U60.swap (& n 64) r Free)
let r = (Data.U60.swap (& n 128) r Free)
let r = (Data.U60.swap (& n 256) r Free)
let r = (Data.U60.swap (& n 512) r Free)
let r = (Data.U60.swap (& n 1024) r Free)
let r = (Data.U60.swap (& n 2048) r Free)
let r = (Data.U60.swap (& n 4096) r Free)
let r = (Data.U60.swap (& n 8192) r Free)
let r = (Data.U60.swap (& n 16384) r Free)
let r = (Data.U60.swap (& n 32768) r Free)
let r = (Data.U60.swap (& n 65536) r Free)
let r = (Data.U60.swap (& n 131072) r Free)
let r = (Data.U60.swap (& n 262144) r Free)
let r = (Data.U60.swap (& n 524288) r Free)
let r = (Data.U60.swap (& n 1048576) r Free)
let r = (Data.U60.swap (& n 2097152) r Free)
let r = (Data.U60.swap (& n 4194304) r Free)
let r = (Data.U60.swap (& n 8388608) r Free)
r

// Reverse : Arr -> Arr
Expand Down

0 comments on commit 5fff0b6

Please sign in to comment.