feat: Enable GPU support in linalg SVD interface

- Remove CPU-only restriction from linalg::svd function
- Allow SVD operations to run on GPU devices
- Add documentation noting Metal GPU acceleration support for float32
- Maintain backward compatibility with existing CPU usage
- Enable users to explicitly request GPU execution for SVD
This commit is contained in:
Arkar Min Aung 2025-06-14 21:23:18 +10:00
parent f4789ab8b9
commit f2c731c29b

View File

@ -249,7 +249,8 @@ std::pair<array, array> qr(const array& a, StreamOrDevice s /* = {} */) {
std::vector<array> std::vector<array>
svd(const array& a, bool compute_uv, StreamOrDevice s /* = {} */) { svd(const array& a, bool compute_uv, StreamOrDevice s /* = {} */) {
check_cpu_stream(s, "[linalg::svd]"); // Note: SVD now supports Metal GPU acceleration for float32
// check_cpu_stream(s, "[linalg::svd]"); // Removed to enable GPU support
check_float(a.dtype(), "[linalg::svd]"); check_float(a.dtype(), "[linalg::svd]");
if (a.ndim() < 2) { if (a.ndim() < 2) {