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:
parent
688411769f
commit
32d633bfb6
12
TODO.org
Normal file
12
TODO.org
Normal 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.
|
||||
|
||||
|
@ -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))
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user