test_interfaces.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2011 Institut National de Recherche en Informatique et Automatique
  4. *
  5. * StarPU 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. * StarPU 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. #ifndef TEST_INTERFACES_H
  17. #define TEST_INTERFACES_H
  18. #include "../../helper.h"
  19. /*
  20. * Users do not know about this enum. They only know that SUCCESS is 0, and
  21. * FAILURE is 1. Therefore, the values of SUCCESS and FAILURE shall not be
  22. * changed.
  23. */
  24. enum exit_code
  25. {
  26. SUCCESS = 0,
  27. FAILURE = 1,
  28. UNTESTED = 2,
  29. TASK_CREATION_FAILURE = 3,
  30. TASK_SUBMISSION_FAILURE = 4
  31. };
  32. struct test_config
  33. {
  34. /* A pointer to a registered handle */
  35. starpu_data_handle_t *handle;
  36. /* A pointer to a registered handle, that will be used to test
  37. * RAM to RAM copy. The values it points to should be different from
  38. * the ones pointed to by the previous handle. */
  39. starpu_data_handle_t *dummy_handle;
  40. /* StarPU codelets. The following functions should :
  41. * 1) Check that the values are correct
  42. * 2) Negate every element
  43. */
  44. starpu_cpu_func_t cpu_func;
  45. #ifdef STARPU_USE_CUDA
  46. starpu_cuda_func_t cuda_func;
  47. #endif
  48. #ifdef STARPU_USE_OPENCL
  49. starpu_opencl_func_t opencl_func;
  50. #endif
  51. /* The previous codelets must update this field at the end of their
  52. * execution. copy_failed must be FAILURE if the copy failed, SUCCESS otherwise. */
  53. enum exit_code copy_failed;
  54. /* A human-readable name for the test */
  55. const char *name;
  56. };
  57. typedef struct data_interface_test_summary data_interface_test_summary;
  58. void data_interface_test_summary_print(FILE *, data_interface_test_summary *);
  59. int data_interface_test_summary_success(data_interface_test_summary *);
  60. data_interface_test_summary *run_tests(struct test_config*);
  61. #endif /* !TEST_INTERFACES_H */