1
0
mirror of https://github.com/TREX-CoE/qmckl.git synced 2025-01-03 01:56:18 +01:00

Fixed type in free

This commit is contained in:
Anthony Scemama 2020-10-15 12:36:52 +02:00
parent 688411769f
commit 32d633bfb6
3 changed files with 25 additions and 8 deletions

12
TODO.org Normal file
View File

@ -0,0 +1,12 @@
* Set up CI on Travis
* Write tests
* malloc/free : Parameters for accelerators?
We should define qmckl_malloc and qmckl_free just to give the
possibility of the HPC implementations to define how they allocate the
memory (on CPU or GPU, using alternatives to malloc/free, etc).
A possibility could be to pass the id of a NUMA domain as a parameter of
qmckl_malloc, where the domain id is something obtained from the
context.

View File

@ -1,8 +1,9 @@
CC=gcc
CFLAGS=
CFLAGS=-fexceptions -Wall -Werror -Wpedantic -Wextra
FC=gfortran
FFLAGS=
FFLAGS=-fcheck=all -Waliasing -Wampersand -Wconversion -Wsurprising -Wintrinsics-std -Wno-tabs -Wintrinsic-shadow -Wline-truncation -Wreal-q-constant -Wuninitialized -fbacktrace -ffpe-trap=zero,overflow,underflow -finit-real=nan
ORG_SOURCE_FILES=qmckl_context.org
OBJECT_FILES=$(patsubst %.org,%.o,$(ORG_SOURCE_FILES))

View File

@ -97,18 +97,22 @@ qmckl_context qmckl_context_copy(const qmckl_context context) {
implying that the context has been freed.
#+BEGIN_SRC C :tangle qmckl_context.h
qmckl_context qmckl_context_destroy(qmckl_context context);
int qmckl_context_destroy(qmckl_context context);
#+END_SRC
#+BEGIN_SRC C :tangle qmckl_context.c
qmckl_context qmckl_context_destroy(qmckl_context context) {
int qmckl_context_destroy(qmckl_context context) {
if (context == NULL) {
return (qmckl_context) 0;
qmckl_context_struct* ctx;
ctx = (qmckl_context_struct*) context;
if (ctx == NULL) {
return 0;
}
free(context);
return (qmckl_context) 1;
free(ctx);
return 1;
}
#+END_SRC