From ae73536d7623c12c6a17d6848cec5872901ffe6e Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi <256895@studenti.unimore.it> Date: Thu, 1 Dec 2022 16:22:43 +0100 Subject: [PATCH] Add cudaFree instructions --- atax/atax.cu | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/atax/atax.cu b/atax/atax.cu index 3374573..933431e 100644 --- a/atax/atax.cu +++ b/atax/atax.cu @@ -351,6 +351,27 @@ __host__ int main(int argc, char** argv) // Y = cudaMemcpy(); + debug("[CUDA] Freeing A..."); + if(cudaFree(A)) { + debug("[CUDA] Could not free A!"); + return 1; + } + debug("[CUDA] Freed A!"); + + debug("[CUDA] Freeing X..."); + if(cudaFree(X)) { + debug("[CUDA] Could not free X!"); + return 1; + } + debug("[CUDA] Freed X!"); + + debug("[CUDA] Freeing Y..."); + if(cudaFree(Y)) { + debug("[CUDA] Could not free Y!"); + return 1; + } + debug("[CUDA] Freed Y!"); + /* polybench_prevent_dce( print_array(Y)