mtapi_c_calc_task-snippet.h 734 Bytes
Newer Older
Michael Schmid committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
    int a = n - 1;
    int x;
    mtapi_task_hndl_t task = mtapi_task_start(
      MTAPI_TASK_ID_NONE,              /* optional task ID */
      fibonacciJob,                    /* job */
      (void*)&a,                       /* arguments passed to action
                                          functions */
      sizeof(int),                     /* size of arguments */
      (void*)&x,                       /* result buffer */
      sizeof(int),                     /* size of result buffer */
      MTAPI_DEFAULT_TASK_ATTRIBUTES,   /* task attributes */
      MTAPI_GROUP_NONE,                /* optional task group */
      &status                          /* status out - parameter */
    );
    MTAPI_CHECK_STATUS(status);