@@ -115,18 +115,18 @@ let lower_batch_assignments ?names ?occupancy bindings asgns_l =
115115 Some (Assignments. lower ~unoptim_ll_source ~ll_source ~cd_source ~name bound asgns) )
116116 else (None , None ))
117117
118- let verify_prior_context ~unified_memory ~ctx_arrays ~from_prior_context =
118+ let verify_prior_context ~use_host_memory ~ctx_arrays ~from_prior_context =
119119 Set. iter from_prior_context ~f: (fun tn ->
120120 if
121- Tn. is_in_context_force ~unified_memory tn 342
121+ Tn. is_in_context_force ~use_host_memory tn 342
122122 && not (Option. is_some @@ Map. find ctx_arrays tn)
123123 then raise @@ Utils. User_error (" The linked context lacks node " ^ Tnode. debug_name tn))
124124
125- let from_prior_context_batch ~unified_memory comps =
125+ let from_prior_context_batch ~use_host_memory comps =
126126 Array. filter_map comps ~f: (fun comp ->
127127 Option. map comp ~f: (fun comp ->
128128 Set. diff
129- (Assignments. context_nodes ~unified_memory comp.Assignments. asgns)
129+ (Assignments. context_nodes ~use_host_memory comp.Assignments. asgns)
130130 comp.embedded_nodes))
131131 |> Array. fold ~init: (Set. empty (module Tnode )) ~f: Set. union
132132
@@ -270,7 +270,7 @@ module Raise_backend (Device : Lowered_backend) : Backend = struct
270270 let name, lowered = lower_assignments ?name bindings comp.Assignments. asgns in
271271 let code = compile ?shared ~name bindings lowered in
272272 let from_prior_context =
273- Set. diff (Assignments. context_nodes ~unified_memory comp.asgns) comp.embedded_nodes
273+ Set. diff (Assignments. context_nodes ~use_host_memory comp.asgns) comp.embedded_nodes
274274 in
275275 { from_prior_context; name; lowered; code; expected_merge_node = lowered.Low_level. merge_node }
276276
@@ -281,7 +281,7 @@ module Raise_backend (Device : Lowered_backend) : Backend = struct
281281 in
282282 let code_batch = compile_batch ?shared ~names bindings lowereds in
283283 let from_prior_context =
284- from_prior_context_batch ~unified_memory
284+ from_prior_context_batch ~use_host_memory
285285 @@ Array. mapi lowereds ~f: (fun i -> Option. map ~f: (fun _ -> comps.(i)))
286286 in
287287 {
@@ -295,7 +295,7 @@ module Raise_backend (Device : Lowered_backend) : Backend = struct
295295 }
296296
297297 let % track3_sexp alloc_if_needed (stream : stream ) ~key ~data: node ctx_arrays =
298- if Tnode. is_in_context_force ~unified_memory key 345 && not (Map. mem ctx_arrays key) then (
298+ if Tnode. is_in_context_force ~use_host_memory key 345 && not (Map. mem ctx_arrays key) then (
299299 [% log2 Tn. debug_name key];
300300 [% log3 (key : Tnode.t )];
301301 let default () =
@@ -307,7 +307,7 @@ module Raise_backend (Device : Lowered_backend) : Backend = struct
307307 if Tn. known_non_cross_stream key then add_new ()
308308 else (
309309 if Hashtbl. mem device.cross_stream_candidates key then
310- Tn. update_memory_sharing key Tn. Shared_cross_stream 40 ;
310+ Tn. update_memory_sharing key Tn. Shared_cross_stream 39 ;
311311 let data = Hashtbl. find_or_add device.cross_stream_candidates key ~default in
312312 Map. add_exn ctx_arrays ~key ~data )
313313 else if Tn. known_shared_cross_stream key then (
@@ -326,8 +326,8 @@ module Raise_backend (Device : Lowered_backend) : Backend = struct
326326 add_new () ))
327327 else ctx_arrays
328328
329- let link context (code : code ) =
330- verify_prior_context ~unified_memory ~ctx_arrays: context.ctx_arrays
329+ let % debug3_sexp link context (code : code ) =
330+ verify_prior_context ~use_host_memory ~ctx_arrays: context.ctx_arrays
331331 ~from_prior_context: code.from_prior_context;
332332 let inputs, outputs = Low_level. input_and_output_nodes code.lowered in
333333 let ctx_arrays =
@@ -344,8 +344,8 @@ module Raise_backend (Device : Lowered_backend) : Backend = struct
344344 in
345345 { context; schedule; bindings; name = code.name; inputs; outputs }
346346
347- let link_batch context code_batch =
348- verify_prior_context ~unified_memory ~ctx_arrays: context.ctx_arrays
347+ let % debug3_sexp link_batch context code_batch =
348+ verify_prior_context ~use_host_memory ~ctx_arrays: context.ctx_arrays
349349 ~from_prior_context: code_batch.from_prior_context;
350350 let ctx_arrays =
351351 Array. map code_batch.lowereds
0 commit comments