@@ -724,10 +724,9 @@ class Cells(xo.Struct):
724724
725725 if (j >= MAX_PARTICLES) {
726726 *success = 0;
727- continue;
727+ } else {
728+ out_vals[i * MAX_PARTICLES + j] = val;
728729 }
729-
730- out_vals[i * MAX_PARTICLES + j] = val;
731730 END_VECTORIZE;
732731 }
733732 }
@@ -750,7 +749,7 @@ class Cells(xo.Struct):
750749 xo .Arg (xo .UInt64 , pointer = True , name = "out_vals" ),
751750 xo .Arg (xo .UInt8 , pointer = True , name = "success" ),
752751 ],
753- n_threads = 3 ,
752+ n_threads = 4 ,
754753 ),
755754 "kernel_Cells_get_particles" : xo .Kernel (
756755 args = [
@@ -759,7 +758,6 @@ class Cells(xo.Struct):
759758 xo .Arg (xo .Int64 , name = "i1" ),
760759 xo .Arg (xo .Int64 , pointer = True , name = "out" ),
761760 ],
762- n_threads = 3 ,
763761 ),
764762 }
765763
@@ -778,7 +776,7 @@ class Cells(xo.Struct):
778776 test_context .kernels .kernel_Cells_get_particles (
779777 obj = cells , i0 = i , i1 = j , out = result
780778 )
781- assert result == expected
779+ assert result [ 0 ] == expected
782780
783781 test_context .kernels .loop_over (
784782 cells = cells ,
@@ -789,6 +787,6 @@ class Cells(xo.Struct):
789787 counts = test_context .nparray_from_context_array (counts )
790788 vals = test_context .nparray_from_context_array (vals )
791789
792- assert success == 1
790+ assert success [ 0 ] == 1
793791 assert np .all (counts == [2 , 3 , 4 ])
794792 assert np .all (vals == [1 , 8 , 0 , 0 , 9 , 3 , 2 , 0 , 4 , 5 , 6 , 7 ])
0 commit comments