@@ -192,7 +192,11 @@ def _calc_memory_bytes_LPRec3d_tomobar(
192192 detector_pad = 0
193193
194194 min_mem_usage_filter = False
195+ if "min_mem_usage_filter" in kwargs :
196+ min_mem_usage_filter = kwargs ["min_mem_usage_filter" ]
195197 min_mem_usage_ifft2 = False
198+ if "min_mem_usage_ifft2" in kwargs :
199+ min_mem_usage_ifft2 = kwargs ["min_mem_usage_ifft2" ]
196200
197201 angles_tot = non_slice_dims_shape [0 ]
198202 DetectorsLengthH_prepad = non_slice_dims_shape [1 ]
@@ -339,21 +343,21 @@ def add_to_memory_counters(amount, per_slice: bool):
339343
340344 add_to_memory_counters (tmp_p_input_slice , True )
341345 if min_mem_usage_filter :
342- add_to_memory_counters (rfft_plan_slice_size / 4 , False )
343- add_to_memory_counters (irfft_plan_slice_size / 4 , False )
344- add_to_memory_counters (padded_tmp_p_input_slice , False )
346+ add_to_memory_counters (rfft_plan_slice_size / 4 / projection_chunk_count , False )
347+ add_to_memory_counters (irfft_plan_slice_size / 4 / projection_chunk_count , False )
348+ add_to_memory_counters (padded_tmp_p_input_slice / projection_chunk_count , False )
345349
346- add_to_memory_counters (rfft_result_size , False )
347- add_to_memory_counters (filtered_rfft_result_size , False )
348- add_to_memory_counters (- rfft_result_size , False )
349- add_to_memory_counters (- padded_tmp_p_input_slice , False )
350+ add_to_memory_counters (rfft_result_size / projection_chunk_count , False )
351+ add_to_memory_counters (filtered_rfft_result_size / projection_chunk_count , False )
352+ add_to_memory_counters (- rfft_result_size / projection_chunk_count , False )
353+ add_to_memory_counters (- padded_tmp_p_input_slice / projection_chunk_count , False )
350354
351- add_to_memory_counters (irfft_scratch_memory_size , False )
352- add_to_memory_counters (- irfft_scratch_memory_size , False )
353- add_to_memory_counters (irfft_result_size , False )
354- add_to_memory_counters (- filtered_rfft_result_size , False )
355+ add_to_memory_counters (irfft_scratch_memory_size / projection_chunk_count , False )
356+ add_to_memory_counters (- irfft_scratch_memory_size / projection_chunk_count , False )
357+ add_to_memory_counters (irfft_result_size / projection_chunk_count , False )
358+ add_to_memory_counters (- filtered_rfft_result_size / projection_chunk_count , False )
355359
356- add_to_memory_counters (- irfft_result_size , False )
360+ add_to_memory_counters (- irfft_result_size / projection_chunk_count , False )
357361 else :
358362 add_to_memory_counters (rfft_plan_slice_size / chunk_count / projection_chunk_count * 2 , True )
359363 add_to_memory_counters (irfft_plan_slice_size / chunk_count / projection_chunk_count * 2 , True )
@@ -402,8 +406,10 @@ def add_to_memory_counters(amount, per_slice: bool):
402406 add_to_memory_counters (circular_mask_size , False )
403407 add_to_memory_counters (after_recon_swapaxis_slice , True )
404408
405- if min_mem_usage_ifft2 and min_mem_usage_filter :
406- return (tot_memory_bytes * 1.1 + 30 * 1024 * 1024 , fixed_amount )
409+ if min_mem_usage_filter and min_mem_usage_ifft2 :
410+ return (tot_memory_bytes * 1.15 , fixed_amount )
411+ elif min_mem_usage_filter and not min_mem_usage_ifft2 :
412+ return (tot_memory_bytes + 60 * 1024 * 1024 , fixed_amount )
407413 else :
408414 return (tot_memory_bytes * 1.1 , fixed_amount )
409415
0 commit comments