starpu_init_noworker.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * StarPU
  3. * Copyright (C) INRIA 2008-2009 (see AUTHORS file)
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU Lesser General Public License as published by
  7. * the Free Software Foundation; either version 2.1 of the License, or (at
  8. * your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. *
  14. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  15. */
  16. #include <stdio.h>
  17. #include <unistd.h>
  18. #include <errno.h>
  19. #include <starpu.h>
  20. #include <stdlib.h>
  21. int main(int argc, char **argv)
  22. {
  23. int ret;
  24. /* We try to initialize StarPU without any worker */
  25. struct starpu_conf conf = {
  26. .sched_policy_name = NULL, /* default */
  27. .ncpus = 0,
  28. .ncuda = 0,
  29. .nopencl = 0,
  30. .nspus = 0,
  31. .use_explicit_workers_bindid = 0,
  32. .use_explicit_workers_cuda_gpuid = 0,
  33. .use_explicit_workers_opencl_gpuid = 0,
  34. .calibrate = 0
  35. };
  36. /* starpu_init should return -ENODEV */
  37. ret = starpu_init(&conf);
  38. if (ret != -ENODEV)
  39. return -1;
  40. return 0;
  41. }