Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a shell script to replace the PrepareMetalHeaders plugin #163

Merged
merged 5 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 1 addition & 16 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,12 @@ let package = Package(
.library(name: "MLXFFT", targets: ["MLXFFT"]),
.library(name: "MLXLinalg", targets: ["MLXLinalg"]),
.library(name: "MLXFast", targets: ["MLXFast"]),

// build support & back end
.plugin(
name: "PrepareMetalShaders",
targets: ["PrepareMetalShaders"]
),
],
dependencies: [
// for Complex type
.package(url: "https://github.com/apple/swift-numerics", from: "1.0.0")
],
targets: [
// plugin to help build the metal shaders
.plugin(
name: "PrepareMetalShaders",
capability: .buildTool(),
path: "Plugins/PrepareMetalShaders"
),
.target(
name: "Cmlx",
exclude: [
Expand Down Expand Up @@ -133,10 +121,7 @@ let package = Package(
.linkedFramework("Foundation"),
.linkedFramework("Metal"),
.linkedFramework("Accelerate"),
],

// run the plugin to build the metal shaders
plugins: [.plugin(name: "PrepareMetalShaders")]
]
),
.testTarget(
name: "CmlxTests",
Expand Down
259 changes: 0 additions & 259 deletions Plugins/PrepareMetalShaders/main.swift

This file was deleted.

9 changes: 9 additions & 0 deletions Source/Cmlx/mlx-generated/metal/arange.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright © 2023-2024 Apple Inc.
template <typename T>
[[kernel]] void arange(
constant const T& start,
constant const T& step,
device T* out,
uint index [[thread_position_in_grid]]) {
out[index] = start + index * step;
}
Loading