fix bw for elementwise ops (#2151)

* fix bw for elementwise ops

* add compile

* fix

* fix

* fix

* fix
This commit is contained in:
Awni Hannun
2025-05-05 06:15:04 -07:00
committed by GitHub
parent 9c5e7da507
commit 825124af8f
12 changed files with 232 additions and 89 deletions

View File

@@ -84,4 +84,12 @@ void concatenate(std::string& acc, T first, Args... args) {
concatenate(acc, args...);
}
inline int get_work_per_thread(Dtype dtype) {
return std::max(1, 8 / dtype.size());
}
inline size_t ceildiv(size_t n, size_t m) {
return (n + m - 1) / m;
}
} // namespace mlx::core