Metal FFT for powers of 2 up to 2048 (#915)

* add Metal FFT for powers of 2

* skip GPU test on linux

* fix contiguity bug

* address comments

* Update mlx/backend/metal/fft.cpp

* Update mlx/backend/metal/fft.cpp

* fix bug in synch

---------

Co-authored-by: Alex Barron <abarron22@apple.com>
Co-authored-by: Awni Hannun <awni.hannun@gmail.com>
Co-authored-by: Awni Hannun <awni@apple.com>
This commit is contained in:
Alex Barron
2024-04-12 05:40:06 +01:00
committed by GitHub
parent ae18326533
commit 2e7c02d5cd
6 changed files with 431 additions and 31 deletions

View File

@@ -130,6 +130,10 @@ inline void debug_set_primitive_buffer_label(
#endif
}
bool is_power_of_2(int n) {
return ((n & (n - 1)) == 0) && n != 0;
}
} // namespace
} // namespace mlx::core