Merge pull request #414 from HigherOrderCO/disable-check-net-size

Disable check-net-size by default
This commit is contained in:
Nicolas Abril 2024-05-20 17:33:44 +02:00 committed by GitHub
commit a58d5aae89
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 16 additions and 4 deletions

View File

@ -10,7 +10,7 @@
| `-Ofloat_combinators` `-Ono-float_combinators` | Enabled | [float-combinators](#float-combinators) |
| `-Omerge` `-Ono-merge` | Disabled | [definition-merging](#definition-merging) |
| `-Oinline` `-Ono-inline` | Disabled | [inline](#inline) |
| `-Ocheck-net-size` `-Ono-check-net-size` | Enabled | [check-net-size](#check-net-size) |
| `-Ocheck-net-size` `-Ono-check-net-size` | Disabled | [check-net-size](#check-net-size) |
| `-Oadt-scott` `-Oadt-num-scott` | adt-num-scott | [adt-encoding](#adt-encoding) | |
## Eta-reduction
@ -185,7 +185,8 @@ main = (id foo)
## Check-net-size
If enabled, checks that the size of each function after compilation is within the HVM restriction of at most 64 nodes per definition.
If enabled, checks that the size of each function after compilation has at most 64 HVM nodes.
This is a memory restriction of the CUDA runtime, if you're not using the `*-cu` you can disable it.
Example:
```py

View File

@ -316,7 +316,8 @@ impl CompileOpts {
}
impl Default for CompileOpts {
/// Enables eta, linearize_matches, float_combinators and reorder_redexes_recursive_last.
/// Enables eta, linearize_matches, float_combinators.
/// Uses num-scott ADT encoding.
fn default() -> Self {
Self {
eta: true,
@ -325,7 +326,7 @@ impl Default for CompileOpts {
float_combinators: true,
merge: false,
inline: false,
check_net_size: true,
check_net_size: false,
adt_encoding: AdtEncoding::NumScott,
}
}

View File

@ -0,0 +1,3 @@
gen-hvm
tests/golden_tests/cli/net_size_too_large.bend
-Ocheck-net-size

View File

@ -0,0 +1,7 @@
---
source: tests/golden_tests.rs
input_file: tests/golden_tests/cli/net_size_too_large.bend
---
Errors:
In definition 'Radix':
Definition is too large for hvm (size=120, max size=64). Please break it into smaller pieces.