@@ -16,7 +16,10 @@ use std::sync::atomic::{AtomicUsize, Ordering};
1616use thread_local:: ThreadLocal ;
1717
1818use crate :: density_map:: sequential_compute_particle_densities_filtered;
19- use crate :: kernel:: { CubicSplineKernel , KernelType , Poly6Kernel , SpikyKernel , SymmetricKernel3d , WendlandQuinticC2Kernel } ;
19+ use crate :: kernel:: {
20+ CubicSplineKernel , KernelType , Poly6Kernel , SpikyKernel , SymmetricKernel3d ,
21+ WendlandQuinticC2Kernel ,
22+ } ;
2023use crate :: marching_cubes:: marching_cubes_lut:: marching_cubes_triangulation_iter;
2124use crate :: mesh:: { HexMesh3d , TriMesh3d } ;
2225use crate :: neighborhood_search:: {
@@ -726,7 +729,7 @@ pub fn density_grid_loop_auto(
726729 squared_support_with_margin : f32 ,
727730 particle_rest_mass : f32 ,
728731 kernel_support : f32 ,
729- kernel_type : & KernelType
732+ kernel_type : & KernelType ,
730733) {
731734 #[ cfg( any( target_arch = "x86_64" , target_arch = "x86" ) ) ]
732735 {
@@ -787,7 +790,7 @@ pub fn density_grid_loop_auto(
787790 particle_rest_mass,
788791 & CubicSplineKernel :: new ( kernel_support) ,
789792 ) ;
790- } ,
793+ }
791794 KernelType :: Poly6 => {
792795 density_grid_loop_scalar :: < i64 , f32 , Poly6Kernel < f32 > > (
793796 levelset_grid,
@@ -801,7 +804,7 @@ pub fn density_grid_loop_auto(
801804 particle_rest_mass,
802805 & Poly6Kernel :: new ( kernel_support) ,
803806 ) ;
804- } ,
807+ }
805808 KernelType :: Spiky => {
806809 density_grid_loop_scalar :: < i64 , f32 , SpikyKernel < f32 > > (
807810 levelset_grid,
@@ -815,7 +818,7 @@ pub fn density_grid_loop_auto(
815818 particle_rest_mass,
816819 & SpikyKernel :: new ( kernel_support) ,
817820 ) ;
818- } ,
821+ }
819822 KernelType :: WendlandQuinticC2 => {
820823 density_grid_loop_scalar :: < i64 , f32 , WendlandQuinticC2Kernel < f32 > > (
821824 levelset_grid,
@@ -829,9 +832,8 @@ pub fn density_grid_loop_auto(
829832 particle_rest_mass,
830833 & WendlandQuinticC2Kernel :: new ( kernel_support) ,
831834 ) ;
832- } ,
835+ }
833836 }
834-
835837}
836838
837839pub fn density_grid_loop_scalar < I : Index , R : Real , K : SymmetricKernel3d < R > > (
@@ -914,8 +916,8 @@ pub fn density_grid_loop_neon(
914916 kernel_support : f32 ,
915917 kernel_type : & KernelType ,
916918) {
917- use core:: arch:: aarch64:: * ;
918919 use crate :: kernel:: NeonKernel ;
920+ use core:: arch:: aarch64:: * ;
919921 const LANES : usize = 4 ;
920922
921923 // Ensure that we can safely compute global MC vertex positions via u32 indices per dimension
@@ -1053,8 +1055,8 @@ pub fn density_grid_loop_neon(
10531055 }
10541056 }
10551057 }
1056-
1057- match kernel_type {
1058+
1059+ match kernel_type {
10581060 KernelType :: CubicSpline => {
10591061 density_grid_loop :: < kernel:: CubicSplineKernelNeonF32 > (
10601062 levelset_grid,
@@ -1068,7 +1070,7 @@ pub fn density_grid_loop_neon(
10681070 particle_rest_mass,
10691071 kernel_support,
10701072 ) ;
1071- } ,
1073+ }
10721074 KernelType :: Poly6 => {
10731075 density_grid_loop :: < kernel:: Poly6KernelNeonF32 > (
10741076 levelset_grid,
@@ -1082,7 +1084,7 @@ pub fn density_grid_loop_neon(
10821084 particle_rest_mass,
10831085 kernel_support,
10841086 ) ;
1085- } ,
1087+ }
10861088 KernelType :: Spiky => {
10871089 density_grid_loop :: < kernel:: SpikyKernelNeonF32 > (
10881090 levelset_grid,
@@ -1096,7 +1098,7 @@ pub fn density_grid_loop_neon(
10961098 particle_rest_mass,
10971099 kernel_support,
10981100 ) ;
1099- } ,
1101+ }
11001102 KernelType :: WendlandQuinticC2 => {
11011103 density_grid_loop :: < kernel:: WendlandQuinticC2KernelNeonF32 > (
11021104 levelset_grid,
@@ -1110,7 +1112,7 @@ pub fn density_grid_loop_neon(
11101112 particle_rest_mass,
11111113 kernel_support,
11121114 ) ;
1113- } ,
1115+ }
11141116 }
11151117}
11161118
@@ -1133,7 +1135,7 @@ pub fn density_grid_loop_avx(
11331135 use core:: arch:: x86:: * ;
11341136 #[ cfg( target_arch = "x86_64" ) ]
11351137 use core:: arch:: x86_64:: * ;
1136-
1138+
11371139 use crate :: kernel:: AvxKernel ;
11381140
11391141 const LANES : usize = 8 ;
@@ -1252,7 +1254,8 @@ pub fn density_grid_loop_avx(
12521254 let w_ij = evaluate_contribution ( k, grid_xs, grid_ys) ;
12531255
12541256 unsafe {
1255- let prev_val = _mm256_loadu_ps ( levelset_grid. as_ptr ( ) . add ( flat_point_idx) ) ;
1257+ let prev_val =
1258+ _mm256_loadu_ps ( levelset_grid. as_ptr ( ) . add ( flat_point_idx) ) ;
12561259 let val = _mm256_fmadd_ps ( w_ij, v_i_ps, prev_val) ;
12571260 _mm256_storeu_ps ( levelset_grid. as_mut_ptr ( ) . add ( flat_point_idx) , val) ;
12581261 }
@@ -1290,7 +1293,7 @@ pub fn density_grid_loop_avx(
12901293 particle_rest_mass,
12911294 kernel_support,
12921295 ) ;
1293- } ,
1296+ }
12941297 KernelType :: Poly6 => {
12951298 density_grid_loop :: < kernel:: Poly6KernelAvxF32 > (
12961299 levelset_grid,
@@ -1304,7 +1307,7 @@ pub fn density_grid_loop_avx(
13041307 particle_rest_mass,
13051308 kernel_support,
13061309 ) ;
1307- } ,
1310+ }
13081311 KernelType :: Spiky => {
13091312 density_grid_loop :: < kernel:: SpikyKernelAvxF32 > (
13101313 levelset_grid,
@@ -1318,7 +1321,7 @@ pub fn density_grid_loop_avx(
13181321 particle_rest_mass,
13191322 kernel_support,
13201323 ) ;
1321- } ,
1324+ }
13221325 KernelType :: WendlandQuinticC2 => {
13231326 density_grid_loop :: < kernel:: WendlandQuinticC2KernelAvxF32 > (
13241327 levelset_grid,
@@ -1332,7 +1335,7 @@ pub fn density_grid_loop_avx(
13321335 particle_rest_mass,
13331336 kernel_support,
13341337 ) ;
1335- } ,
1338+ }
13361339 }
13371340}
13381341
0 commit comments