modes_test.c 577 B

123456789101112131415161718192021222324252627
  1. /* Dont change anything ! */
  2. struct starpu_codelet cummy_cl =
  3. {
  4. .cpu_funcs = { foo, NULL },
  5. .nbuffers = 42
  6. }
  7. /* Now, there is some work to do */
  8. struct starpu_codelet cl1 =
  9. {
  10. .cpu_funcs = { foo, bar, NULL },
  11. .nbuffers = 2,
  12. };
  13. int
  14. foo(void)
  15. {
  16. struct starpu_task *task;
  17. task = starpu_task_create();
  18. task->cl = &cl1;
  19. task->buffers[0].handle = handle1;
  20. task->buffers[0].mode = STARPU_R;
  21. task->synchronous = 1;
  22. task->buffers[1].handle = handle2;
  23. task->buffers[1].mode = STARPU_W;
  24. }