Skip to content

Commit

Permalink
A temporary test file and paring of scan scatter.
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamDue committed Feb 5, 2025
1 parent 0d69b20 commit d44aa57
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/Futhark/IR/Parse.hs
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,7 @@ pSOAC pr =
keyword "redomap" *> pScrema pRedomapForm,
keyword "scanomap" *> pScrema pScanomapForm,
keyword "screma" *> pScrema pScremaForm,
pScanScatter,
keyword "vjp" *> pVJP,
keyword "jvp" *> pJVP,
pScatter,
Expand Down Expand Up @@ -811,6 +812,22 @@ pSOAC pr =
<*> braces (pSubExp `sepBy` pComma)
<* pComma
<*> pLambda pr
pScanScatter =
keyword "scanscatter"
*> parens
( SOAC.ScanScatter
<$> pSubExp
<* pComma
<*> braces (pVName `sepBy` pComma)
<* pComma
<*> pLambda pr
<* pComma
<*> pScan pr
<* pComma
<*> pLambda pr
<* pComma
<*> braces (pVName `sepBy` pComma)
)

pSizeClass :: Parser GPU.SizeClass
pSizeClass =
Expand Down
31 changes: 31 additions & 0 deletions temp_test_examples/temp.fut_soacs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
types {

}



entry("main",
{xs: []i32},
{[]i32})
entry_main (n_5232 : i64,
xs_5233 : [n_5232]i32)
: {[n_5232]i32#([1], [0])} = {
let {defunc_0_scan_res_5256 : [n_5232]i32} =
scanscatter(n_5232,
{xs_5233},
\ {x_5252 : i32}
: {i32} ->
{x_5252},
\ {eta_p_5253 : i32,
eta_p_5254 : i32}
: {i32} ->
let {defunc_0_op_res_5255 : i32} =
add32(eta_p_5253, eta_p_5254)
in {defunc_0_op_res_5255},
{0i32},
\ {x_5252 : i32}
: {i32} ->
{x_5252},
{xs_5233})
in {defunc_0_scan_res_5256}
}

0 comments on commit d44aa57

Please sign in to comment.