view src/parallel_execution/worker.c @ 175:00107b452a04

add Todo
author mir3636
date Mon, 28 Nov 2016 17:49:08 +0900
parents 8260b230dc2f
children dec50dd624c7
line wrap: on
line source

#include <libkern/OSAtomic.h>

#include "context.h"
#include "origin_cs.h"

__code getTask1(struct Context* context, struct Queue* queue) {
    queue->next = C_getTask2;
    goto meta(context, queue->take);
}

__code getTask1_stub(struct Context* context) {
    goto getTask1(context, &context->data[D_ActiveQueue]->Queue);
}

__code getTask2(struct Context* context, struct Task* task, struct Node* node) {
    node->key = task->key;

    struct Tree *t = &context->data[D_Traverse]->Traverse;
    t->next = task->code;
    context->next = C_getTask1;
    goto meta(context, C_get);
}

__code getTask2_stub(struct Context* context) {
    goto getTask2(context, &(context->data[D_ActiveQueue]->Queue.data->Task), &context->data[D_Node]->node);
}

#ifdef USE_CUDA
__code twiceGpu(struct Context* context) {
    cuMemcpyHtoDAsync(context,context,context,context->stream);
    cuLaunchkanel();
    cuMemcpyDtoHAsync();
}
#endif