From 4aca09339d402a80eabc4b78d127305c105f5bdc Mon Sep 17 00:00:00 2001 From: Angelos Katharopoulos Date: Sun, 29 Jun 2025 04:45:25 -0700 Subject: [PATCH] Change structured binding capture --- mlx/backend/cuda/binary_two.cu | 5 ++++- mlx/backend/cuda/ternary.cu | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/mlx/backend/cuda/binary_two.cu b/mlx/backend/cuda/binary_two.cu index 3cdf2a89f..0a68e5f1d 100644 --- a/mlx/backend/cuda/binary_two.cu +++ b/mlx/backend/cuda/binary_two.cu @@ -153,7 +153,10 @@ void binary_op_gpu_inplace( out_a.data_size() > INT32_MAX, [&](auto large) { using IdxT = std::conditional_t; - auto [shape, strides] = collapse_contiguous_dims(a, b, out_a); + Shape shape; + std::vector strides; + std::tie(shape, strides) = + collapse_contiguous_dims(a, b, out_a); auto& a_strides = strides[0]; auto& b_strides = strides[1]; int ndim = shape.size(); diff --git a/mlx/backend/cuda/ternary.cu b/mlx/backend/cuda/ternary.cu index 06c063192..1d6535100 100644 --- a/mlx/backend/cuda/ternary.cu +++ b/mlx/backend/cuda/ternary.cu @@ -102,7 +102,9 @@ void ternary_op_gpu_inplace( c.data_size() > INT32_MAX || out.data_size() > INT32_MAX, [&](auto large) { using IdxT = std::conditional_t; - auto [shape, strides] = collapse_contiguous_dims(a, b, c, out); + Shape shape; + std::vector strides; + std::tie(shape, strides) = collapse_contiguous_dims(a, b, c, out); auto& a_strides = strides[0]; auto& b_strides = strides[1]; auto& c_strides = strides[2];