Skip to content

Commit bfe0c80

Browse files
committed
Cleanup of the AI-generated Metal backend
1 parent e586db2 commit bfe0c80

File tree

4 files changed

+397
-426
lines changed

4 files changed

+397
-426
lines changed

arrayjit/lib/backend_intf.ml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,6 @@ module type Device = sig
206206
val get_name : stream -> string
207207
end
208208

209-
210209
(** Parts shared by assignments-level backend interfaces. *)
211210
module type Backend_common = sig
212211
include Buffer
@@ -290,12 +289,18 @@ module type With_buffer_retrieval_and_syncing = sig
290289
type event
291290

292291
val from_host : context -> Tnode.t -> bool
293-
(** If the tensor node is both hosted and in-context, schedules a copy from host to context and
294-
returns true, otherwise returns false. *)
292+
(** If the tensor node is both hosted and in-context, schedules a copy(^) from host to context and
293+
returns true, otherwise returns false.
294+
295+
[^] On unified memory devices, the copy is not scheduled if the source and destination are the
296+
same buffer (note that this depends on the memory mode of the tensor node). *)
295297

296298
val to_host : context -> Tnode.t -> bool
297-
(** If the tensor node is both hosted and in-context, schedules a copy from context to host and
298-
returns true, otherwise returns false. *)
299+
(** If the tensor node is both hosted and in-context, schedules a copy(^) from context to host and
300+
returns true, otherwise returns false.
301+
302+
[^] On unified memory devices, the copy is not scheduled if the source and destination are the
303+
same buffer (note that this depends on the memory mode of the tensor node). *)
299304

300305
val device_to_device :
301306
Tnode.t -> into_merge_buffer:merge_buffer_use -> dst:context -> src:context -> bool

arrayjit/lib/dune

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@
7272

7373
(library
7474
(name metal_backend)
75-
; Temporary disabled until we have a working Metal backend
76-
(enabled_if false)
7775
(optional)
7876
(modules metal_backend)
7977
(libraries base metal utils ir)

0 commit comments

Comments
 (0)