Module Metal.Library

Represents a compiled Metal library containing one or more functions. See MTLLibrary.

type t
val sexp_of_t : t -> Sexplib0.Sexp.t
val set_label : t -> string -> unit
val get_label : t -> string
val get_device : t -> Device.t
val on_device : Device.t -> source:string -> CompileOptions.t -> t

Creates a library by compiling Metal Shading Language source code. See newLibraryWithSource:options:error:.

val on_device_with_data : Device.t -> unit Ctypes.ptr -> t

Creates a library from pre-compiled data (e.g., a .metallib file loaded into memory). Defensively, the returned value holds on to the data pointer. See newLibraryWithData:error:.

val new_function_with_name : t -> string -> Function.t

Retrieves a specific function from the library by name. See newFunctionWithName:.

val get_function_names : t -> string array
val get_library_type : t -> CompileOptions.LibraryType.t

Gets the type of the library (Executable or Dynamic).

val get_install_name : t -> string option

Gets the install name if it's a dynamic library.