Skip to content

Commit 3cb9936

Browse files
committed
Rename optimize_proc -> optimize, lower_proc -> lower
1 parent 1f2a22b commit 3cb9936

File tree

6 files changed

+8
-10
lines changed

6 files changed

+8
-10
lines changed

CHANGES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
### Added
44

55
- Interface files for `Backends` and `Low_level`.
6-
- TODO: stream-to-stream synchronization functionality, with lazy per-tensor-node synchronization.
76
- Fixed #245: tracking of used memory.
7+
- TODO: stream-to-stream synchronization functionality, with lazy per-tensor-node synchronization.
88

99
### Changed
1010

arrayjit/lib/assignments.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ let fprint_hum ?name ?static_indices () ppf c =
378378
loop c;
379379
fprintf ppf "@]"
380380

381-
let lower_proc ~unoptim_ll_source ~ll_source ~cd_source ~name static_indices (proc : t) :
381+
let lower ~unoptim_ll_source ~ll_source ~cd_source ~name static_indices (proc : t) :
382382
Low_level.optimized =
383383
let llc = to_low_level proc in
384384
(* Generate the low-level code before outputting the assignments, to force projections. *)
@@ -387,4 +387,4 @@ let lower_proc ~unoptim_ll_source ~ll_source ~cd_source ~name static_indices (pr
387387
| Some ppf ->
388388
fprint_hum ~name ~static_indices () ppf proc;
389389
Stdlib.Format.pp_print_flush ppf ());
390-
Low_level.optimize_proc ~unoptim_ll_source ~ll_source ~name static_indices llc
390+
Low_level.optimize ~unoptim_ll_source ~ll_source ~name static_indices llc

arrayjit/lib/backends.ml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ let lower_assignments ?name bindings asgns =
507507
let ll_source = Utils.get_debug_formatter ~fname:(name ^ ".ll") in
508508
let cd_source = Utils.get_debug_formatter ~fname:(name ^ ".cd") in
509509
( name,
510-
Assignments.lower_proc ~unoptim_ll_source ~ll_source ~cd_source ~name
510+
Assignments.lower ~unoptim_ll_source ~ll_source ~cd_source ~name
511511
(Indexing.bound_symbols bindings) asgns )
512512

513513
let lower_batch_assignments ?names ?occupancy bindings asgns_l =
@@ -526,9 +526,7 @@ let lower_batch_assignments ?names ?occupancy bindings asgns_l =
526526
let asgns = asgns_l.(src_n) in
527527
if occupancy ~name ~src_n then
528528
( Some name,
529-
Some
530-
(Assignments.lower_proc ~unoptim_ll_source ~ll_source ~cd_source ~name bound asgns)
531-
)
529+
Some (Assignments.lower ~unoptim_ll_source ~ll_source ~cd_source ~name bound asgns) )
532530
else (None, None))
533531

534532
let verify_prior_context ~get_array ~ctx_arrays ~is_in_context ~prior_context ~from_prior_context

arrayjit/lib/low_level.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ let fprint_hum ?name ?static_indices () ppf llc =
886886
pp_ll ppf llc;
887887
fprintf ppf "@]"
888888

889-
let%diagn2_sexp optimize_proc ~unoptim_ll_source ~ll_source ~(name : string)
889+
let%diagn2_sexp optimize ~unoptim_ll_source ~ll_source ~(name : string)
890890
(static_indices : Indexing.static_symbol list) (llc : t) : optimized =
891891
Option.iter unoptim_ll_source ~f:(fun ppf ->
892892
Stdlib.Format.fprintf ppf "%a%!" (fprint_hum ~name ~static_indices ()) llc);

arrayjit/lib/low_level.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ type traced_store = (Tnode.t, traced_array) Base.Hashtbl.t [@@deriving sexp_of]
9191
type optimized = { traced_store : traced_store; llc : t; merge_node : Tnode.t option }
9292
[@@deriving sexp_of]
9393

94-
val optimize_proc :
94+
val optimize :
9595
unoptim_ll_source:Stdlib.Format.formatter option ->
9696
ll_source:Stdlib.Format.formatter option ->
9797
name:string ->

arrayjit/lib/writing_a_backend.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
## Design around compiling and running code, backend interfaces
1919

20-
Currently, OCANNL integrates new backends via code in [Backends](backends.ml), so it's the "sink" of backend module dependencies; [Backend_types](backend_types.ml) is the "source". `Backend_types.Types` introduces the context-specific `routine` type, for code executable on a backend. The interface `Backends.No_device_backend` has `compile` functions that take `Assignments.comp` as input, to allow full flexibility in backend implementations. There is a helper `Backends.lower_assignments` that wraps `Assignments.lower` and `Low_level.optimize_proc`, since currently all backends use the optimized C-like representation `Low_level.t`. `Backends.Backend` is the user-facing interface.
20+
Currently, OCANNL integrates new backends via code in [Backends](backends.ml), so it's the "sink" of backend module dependencies; [Backend_types](backend_types.ml) is the "source". `Backend_types.Types` introduces the context-specific `routine` type, for code executable on a backend. The interface `Backends.No_device_backend` has `compile` functions that take `Assignments.comp` as input, to allow full flexibility in backend implementations. There is a helper `Backends.lower_assignments` that wraps `Assignments.lower` and `Low_level.optimize`, since currently all backends use the optimized C-like representation `Low_level.t`. `Backends.Backend` is the user-facing interface.
2121

2222
The functor `Multicore_backend` converts a `No_device_backend` typically targetting the CPU into a `Backend` whose devices are parallel threads (and ultimately the CPU cores).
2323

0 commit comments

Comments
 (0)