-
Notifications
You must be signed in to change notification settings - Fork 439
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
0945efc
commit f3be26b
Showing
8 changed files
with
80 additions
and
40 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
gen-hvm | ||
tests/golden_tests/cli/gen_hvm_no_eta_by_default.bend |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Eta-reduction of some recursive functions can mess the performance | ||
# of programs targeting the CUDA runtime. | ||
|
||
# So for now we've disabled it by default when the target architecture | ||
# is not C (for which eta-reduction usually seems to not only decrease | ||
# the total amount of interactions, but actually slightly increase | ||
# performance a little bit is the tested cases). | ||
|
||
# This test checks that the compiler doesn't eta-reduce when calling | ||
# 'gen-hvm', which has an unknown target architecture. | ||
|
||
# A recursive function | ||
make_list n x = switch n { | ||
0: @l l | ||
_: @l (l x (make_list n-1 x)) | ||
} | ||
|
||
# A non-recursive function | ||
make_10 x = (make_list 10 x) | ||
|
||
main = (make_10 1) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
source: tests/golden_tests.rs | ||
input_file: tests/golden_tests/cli/gen_hvm_no_eta_by_default.bend | ||
--- | ||
@main = a | ||
& @make_10 ~ (1 a) | ||
|
||
@make_10 = (a b) | ||
& @make_list ~ (10 (a b)) | ||
|
||
@make_list = (?(((* (a a)) @make_list__C0) (b c)) (b c)) | ||
|
||
@make_list__C0 = (b ({a c} ((a (d e)) e))) | ||
& @make_list ~ (b (c d)) |
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
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