Skip to content

Commit

Permalink
support generating loopless, strideless r2r codelets
Browse files Browse the repository at this point in the history
[empty commit message]
  • Loading branch information
stevengj committed Apr 18, 2008
1 parent 5d2811a commit c09bbbb
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions genfft/gen_r2r.ml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ type mode =
let mode = ref NONE
let normsqr = ref 1
let unitary = ref false
let noloop = ref false

let speclist = [
"-with-istride",
Expand Down Expand Up @@ -123,6 +124,10 @@ let speclist = [
"-unitary",
Arg.Unit(fun () -> unitary := true),
" unitary normalization (up overall scale factor)";

"-noloop",
Arg.Unit(fun () -> noloop := true),
" no vector loop";
]

let sqrt_half = Complex.inverse_int_sqrt 2
Expand Down Expand Up @@ -184,7 +189,7 @@ let generate n mode =
let odag = store_output n oloc output in
let annot = standard_optimizer odag in

let body = Block (
let body = if !noloop then Block([], [Asch annot]) else Block (
[Decl ("INT", i)],
[For (Expr_assign (CVar i, CVar v),
Binop (" > ", CVar i, Integer 0),
Expand All @@ -202,12 +207,17 @@ let generate n mode =
let tree =
Fcn ((if !Magic.standalone then "void" else "static void"), name,
([Decl (C.constrealtypep, iarray);
Decl (C.realtypep, oarray);
Decl (C.stridetype, istride);
Decl (C.stridetype, ostride);
Decl ("INT", v);
Decl ("INT", "ivs");
Decl ("INT", "ovs")]),
Decl (C.realtypep, oarray)]
@ (if stride_fixed !uistride then []
else [Decl (C.stridetype, istride)])
@ (if stride_fixed !uostride then []
else [Decl (C.stridetype, ostride)])
@ (if !noloop then [] else
[Decl ("INT", v)]
@ (if stride_fixed !uivstride then []
else [Decl ("INT", "ivs")])
@ (if stride_fixed !uovstride then []
else [Decl ("INT", "ovs")]))),
add_constants body)

in let desc =
Expand Down

0 comments on commit c09bbbb

Please sign in to comment.