diff --git a/src/struct_mv/_hypre_struct_mv.hpp b/src/struct_mv/_hypre_struct_mv.hpp index aa1b7c18e..839ae0095 100644 --- a/src/struct_mv/_hypre_struct_mv.hpp +++ b/src/struct_mv/_hypre_struct_mv.hpp @@ -1546,6 +1546,7 @@ else \ } \ }, hypre__tot, shared_sum_var); \ hypre_TMemcpy(&sum_var, shared_sum_var, HYPRE_Real, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); \ + hypre_TFree(shared_sum_var, HYPRE_MEMORY_DEVICE); \ } /* Reduction BoxLoop2 */ @@ -1570,6 +1571,7 @@ else \ } \ }, hypre__tot, shared_sum_var); \ hypre_TMemcpy(&sum_var, shared_sum_var, HYPRE_Real, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); \ + hypre_TFree(shared_sum_var, HYPRE_MEMORY_DEVICE); \ } /* Plain parallel_for loop */ diff --git a/src/struct_mv/boxloop_sycl.h b/src/struct_mv/boxloop_sycl.h index 8a68431cf..fded90e70 100644 --- a/src/struct_mv/boxloop_sycl.h +++ b/src/struct_mv/boxloop_sycl.h @@ -352,6 +352,7 @@ else \ } \ }, hypre__tot, shared_sum_var); \ hypre_TMemcpy(&sum_var, shared_sum_var, HYPRE_Real, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); \ + hypre_TFree(shared_sum_var, HYPRE_MEMORY_DEVICE); \ } /* Reduction BoxLoop2 */ @@ -376,6 +377,7 @@ else \ } \ }, hypre__tot, shared_sum_var); \ hypre_TMemcpy(&sum_var, shared_sum_var, HYPRE_Real, 1, HYPRE_MEMORY_HOST, HYPRE_MEMORY_DEVICE); \ + hypre_TFree(shared_sum_var, HYPRE_MEMORY_DEVICE); \ } /* Plain parallel_for loop */