Skip to content

Commit

Permalink
metal: unwrap lib write
Browse files Browse the repository at this point in the history
  • Loading branch information
geohot committed Nov 6, 2023
1 parent 2f7aab3 commit fbe7f0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tinygrad/runtime/ops_metal.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def compile_metal(prg, use_xcode=bool(getenv("METAL_XCODE"))) -> bytes:
library = unwrap(METAL.device.newLibraryWithSource_options_error_(prg, options, None))
# TODO: avoid file write here?
with tempfile.NamedTemporaryFile(delete=True) as output_file:
library.serializeToURL_error_(Cocoa.NSURL.URLWithString_(f"file:https://{output_file.name}"), None)
unwrap(library.serializeToURL_error_(Cocoa.NSURL.URLWithString_(f"file:https://{output_file.name}"), None))
return pathlib.Path(output_file.name).read_bytes()

class MetalProgram:
Expand Down

0 comments on commit fbe7f0c

Please sign in to comment.