1
0
mirror of https://github.com/TREX-CoE/qmckl.git synced 2024-08-17 19:01:43 +02:00
qmckl/org/qmckl_mykernel.org
2021-09-16 13:44:12 +02:00

3.8 KiB

My Kernel

Headers

#include "qmckl.h"
#include "assert.h"
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>

int main() {
qmckl_context context;
context = qmckl_context_create();
qmckl_exit_code rc;

My Kernel

qmckl_mykernel

qmckl_context context in Global state
int64_t myarg1 in The only input argument

Requirements

  • context is not QMCKL_NULL_CONTEXT

C header

qmckl_exit_code qmckl_mykernel(const qmckl_context context,
                        const int64_t* myarg1);

C source

#include <stdbool.h>
#include <stdio.h>
#include "qmckl.h"

qmckl_exit_code qmckl_mykernel_c_(const qmckl_context context, 
                                  const int64_t* myarg1) {

  printf("Hello from qmckl_mykernel_c_\n");
  printf("Value of argument 'myarg1' from within 'qmckl_mykernel_c_' is: %i\n", *myarg1);
  return QMCKL_SUCCESS;
}

End of files

  assert (qmckl_context_destroy(context) == QMCKL_SUCCESS);
  return 0;
}