File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -2208,6 +2208,8 @@ def EMGPUFreqDomain(
2208
2208
"""
2209
2209
# ctx = cuda.current_context()
2210
2210
# ctx.reset()
2211
+ #clear GPU memory
2212
+ cuda .current_context ().memory_manager .deallocations .clear ()
2211
2213
free_mem , total_mem = cuda .current_context ().get_memory_info ()
2212
2214
max_mem = np .ceil (free_mem ).astype (np .int64 )
2213
2215
ray_num = full_index .shape [0 ]
Original file line number Diff line number Diff line change @@ -2746,6 +2746,8 @@ def workchunkingv2(
2746
2746
sources .shape [0 ] * (scattering_points .shape [0 ] * sinks .shape [0 ] * (max_scatter ))
2747
2747
)
2748
2748
# print("Total of {:3.1f} rays required".format(ray_estimate))
2749
+ # Clear GPU memory for simulation
2750
+ cuda .current_context ().memory_manager .deallocations .clear ()
2749
2751
# establish memory limits
2750
2752
free_mem , total_mem = cuda .current_context ().get_memory_info ()
2751
2753
max_mem = np .ceil (free_mem * 0.8 ).astype (np .int64 )
@@ -2770,6 +2772,7 @@ def workchunkingv2(
2770
2772
)
2771
2773
if io_indexing .shape [0 ] >= ray_limit :
2772
2774
# need to split the array and process seperatly
2775
+
2773
2776
sub_io = np .array_split (
2774
2777
io_indexing , np .ceil (io_indexing .shape [0 ] / ray_limit ).astype (int )
2775
2778
)
You can’t perform that action at this time.
0 commit comments