ax_dlb_callback_arg.m4 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. # StarPU --- Runtime system for heterogeneous multicore architectures.
  2. #
  3. # Copyright (C) 2018-2021 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
  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. # Check whether DLB callbacks expect an user argument
  17. AC_DEFUN([AX_DLB_CALLBACK_ARG],
  18. [AC_MSG_CHECKING([whether DLB callbacks expect an user argument])
  19. AC_CACHE_VAL(ac_cv_dlb_callback_arg,dnl
  20. [AC_TRY_COMPILE(dnl
  21. [#include <dlb_sp.h>
  22. dlb_handler_t dlb_handle;
  23. void _dlb_callback_disable_cpu(int cpuid, void *arg) {
  24. (void)cpuid;
  25. (void)arg;
  26. }
  27. void f(void) {
  28. (void)DLB_CallbackSet_sp(dlb_handle, dlb_callback_disable_cpu, (dlb_callback_t)_dlb_callback_disable_cpu, 0);
  29. }
  30. ],, ac_cv_dlb_callback_arg=yes, ac_cv_dlb_callback_arg=no)
  31. ])dnl AC_CACHE_VAL
  32. AC_MSG_RESULT([$ac_cv_dlb_callback_arg])
  33. if test $ac_cv_dlb_callback_arg = yes; then
  34. AC_DEFINE(STARPURM_HAVE_DLB_CALLBACK_ARG,1,[Define to 1 if DLB callbacks expect an user argument])
  35. fi
  36. ])