Skip to content

Commit

Permalink
Handle backend_info for C_syntax-based backends
Browse files Browse the repository at this point in the history
  • Loading branch information
lukstafi committed Jul 30, 2024
1 parent ef61326 commit a7cfd5c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions arrayjit/lib/backend_utils.ml
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,15 @@ struct
(* Preserve the order in the hashtable, so it's the same as e.g. in compile_globals. *)
List.rev
@@ Hashtbl.fold traced_store ~init:[] ~f:(fun ~key:tn ~data:node params ->
if Utils.settings.with_debug_level > 0 then
[%log "array-used:", (tn : Tn.t), get_ident tn];
(* A rough approximation to the type Gccjit_backend.mem_properties. *)
let backend_info =
Sexp.Atom
(if B.is_in_context node then "From_context"
else if Hash_set.mem is_global tn then "Constant_from_host"
else "Local_only")
in
if not @@ Utils.sexp_mem ~elem:backend_info tn.backend_info then
tn.backend_info <- Utils.sexp_append ~elem:backend_info tn.backend_info;
if B.is_in_context node && not (Hash_set.mem is_global tn) then
(Ops.cuda_typ_of_prec tn.Tn.prec ^ " *" ^ get_ident tn, Param_ptr tn) :: params
else params)
Expand Down

0 comments on commit a7cfd5c

Please sign in to comment.