From 82661cfedb74b1c27879c40858985e9408edb70e Mon Sep 17 00:00:00 2001 From: Aaron Councilman <aaronjc4@illinois.edu> Date: Wed, 12 Feb 2025 10:51:19 -0600 Subject: [PATCH] Formatting --- hercules_cg/src/gpu.rs | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/hercules_cg/src/gpu.rs b/hercules_cg/src/gpu.rs index f3b38878..01ca4773 100644 --- a/hercules_cg/src/gpu.rs +++ b/hercules_cg/src/gpu.rs @@ -1767,23 +1767,21 @@ extern \"C\" {} {}(", Index::Field(field) => { index_ptr.push_str(&format!( " + ({})", - self.get_size(type_id, Some(*field), Some(extra_dim_collects)))); - type_id = - if let Type::Product(fields) = - &self.types[type_id.idx()] { - fields[*field] - } else { - panic!("Expected product type") - }; + self.get_size(type_id, Some(*field), Some(extra_dim_collects)) + )); + type_id = if let Type::Product(fields) = &self.types[type_id.idx()] { + fields[*field] + } else { + panic!("Expected product type") + }; } // Variants of summations have zero offset Index::Variant(index) => { - type_id = - if let Type::Summation(variants) = &self.types[type_id.idx()] { - variants[*index] - } else { - panic!("Expected summation type") - }; + type_id = if let Type::Summation(variants) = &self.types[type_id.idx()] { + variants[*index] + } else { + panic!("Expected summation type") + }; } // Convert multi-d array index to 1-d index, and optionally // convert to single-byte index by multiplying by element size @@ -1792,9 +1790,7 @@ extern \"C\" {} {}(", if has_extra_dim { continue; } - let Type::Array(element_type, extents) = - &self.types[type_id.idx()] - else { + let Type::Array(element_type, extents) = &self.types[type_id.idx()] else { panic!("Expected array type") }; let mut cumulative_offset = multiply_dcs(&extents[array_indices.len()..]); -- GitLab