remove_where_field_test.c 465 B

123456789101112131415161718192021222324252627
  1. struct dummy_struct
  2. {
  3. int where;
  4. };
  5. /* Simple example : remove the where field */
  6. struct starpu_codelet cl = {
  7. .cuda_func = bar,
  8. .where = STARPU_CPU | STARPU_OPENCL,
  9. .cpu_func = foo
  10. };
  11. void
  12. dummy(void)
  13. {
  14. cl.where = STARPU_CUDA;
  15. starpu_codelet_t *clp = &cl;
  16. clp->where = STARPU_CPU; /* Must be removed */
  17. struct dummy_struct ds;
  18. struct dummy_struct *dsp = &ds;
  19. ds.where = 12; /* Must not be removed */
  20. dsp->where = 12; /* Must not be removed */
  21. }