diff options
author | Birte Kristina Friesel <birte.friesel@uos.de> | 2024-07-05 11:33:51 +0200 |
---|---|---|
committer | Birte Kristina Friesel <birte.friesel@uos.de> | 2024-07-05 11:33:51 +0200 |
commit | 48978a7ed71b7c537015214f3ac08fb5b9d182f2 (patch) | |
tree | b8b651c9791c7f737040651d51098b1c9a45566a /GEMV | |
parent | 24ec32ca18b47d5e2e9f5f4d5c3bc32f41fe4cbf (diff) |
GEMV: free() allocated memory at the end
Diffstat (limited to 'GEMV')
-rw-r--r-- | GEMV/baselines/cpu/Makefile | 2 | ||||
-rw-r--r-- | GEMV/baselines/cpu/gemv_openmp.c | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/GEMV/baselines/cpu/Makefile b/GEMV/baselines/cpu/Makefile index 4f91f97..5ddbb35 100644 --- a/GEMV/baselines/cpu/Makefile +++ b/GEMV/baselines/cpu/Makefile @@ -9,7 +9,7 @@ endif all: gemv gemv: gemv_openmp.c - gcc -O2 -Wall -Wextra -pedantic -o gemv -fopenmp -DNUMA=${NUMA} gemv_openmp.c ${FLAGS} + gcc -Wall -Wextra -pedantic -march=native -O2 -o gemv -fopenmp -DNUMA=${NUMA} gemv_openmp.c ${FLAGS} gemv_O0: gemv_openmp.c gcc -o gemv_O0 -fopenmp gemv_openmp.c diff --git a/GEMV/baselines/cpu/gemv_openmp.c b/GEMV/baselines/cpu/gemv_openmp.c index 3af84e5..38de1d4 100644 --- a/GEMV/baselines/cpu/gemv_openmp.c +++ b/GEMV/baselines/cpu/gemv_openmp.c @@ -142,6 +142,19 @@ int main(int argc, char *argv[]) #endif printf("sum(x) = %f, sum(Ax) = %f\n", sum_vec(x,cols), sum_vec(b,rows)); + +#if NUMA + numa_free(b, sizeof(double)*rows); + numa_free(x, sizeof(double)*cols); + numa_free(*A, sizeof(double)*rows*cols); + numa_free(A, sizeof(double)*rows); +#else + free(b); + free(x); + free(*A); + free(A); +#endif + return 0; } |