|
@@ -73,11 +73,16 @@ pub fn load_db_from_slice_mt(
|
|
|
s.spawn(move |_| {
|
|
|
let vptr = unsafe { v.as_mut_ptr() };
|
|
|
for i in item_thread_start..item_thread_end {
|
|
|
- let ii = i % num_per;
|
|
|
- let j = i / num_per;
|
|
|
+ // Swap the halves of the item index so that
|
|
|
+ // the polynomials based on the items are
|
|
|
+ // written to the AlignedMemoryMT64 more
|
|
|
+ // sequentially
|
|
|
+ let ii = i / dim0;
|
|
|
+ let j = i % dim0;
|
|
|
+ let db_idx = j * num_per + ii;
|
|
|
|
|
|
let mut db_item =
|
|
|
- load_item_from_slice(¶ms, slice, instance, trial, i);
|
|
|
+ load_item_from_slice(¶ms, slice, instance, trial, db_idx);
|
|
|
// db_item.reduce_mod(params.pt_modulus);
|
|
|
|
|
|
for z in 0..params.poly_len {
|