modes.cocci 686 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. @find_cl@
  2. identifier c;
  3. @@
  4. struct starpu_codelet c =
  5. {
  6. };
  7. @find_task depends on find_cl@
  8. identifier t;
  9. identifier find_cl.c;
  10. @@
  11. t->cl = &c;
  12. /*
  13. * Remove task->buffers[id].mode = STARPU_{R,W,RW}
  14. * Replace task->buffers[id].handle = handle; by
  15. * task->handles[id] = handle;
  16. */
  17. @remove_task_mode depends on find_task@
  18. identifier find_task.t;
  19. expression E;
  20. identifier h;
  21. expression id;
  22. identifier find_cl.c;
  23. @@
  24. (
  25. - t->buffers[id].handle = h;
  26. ++ t->handles[id] = h;
  27. |
  28. - t->buffers[id].mode = E;
  29. )
  30. @has_modes depends on remove_task_mode@
  31. identifier find_cl.c;
  32. expression remove_task_mode.id;
  33. expression remove_task_mode.E;
  34. @@
  35. struct starpu_codelet c =
  36. {
  37. ++ .modes[id] = E,
  38. };