func_to_funcs.sh 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/bin/sh
  2. # StarPU --- Runtime system for heterogeneous multicore architectures.
  3. #
  4. # Copyright (C) 2011-2020 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
  5. #
  6. # StarPU is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU Lesser General Public License as published by
  8. # the Free Software Foundation; either version 2.1 of the License, or (at
  9. # your option) any later version.
  10. #
  11. # StarPU is distributed in the hope that it will be useful, but
  12. # WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. #
  15. # See the GNU Lesser General Public License in COPYING.LGPL for more details.
  16. #
  17. path_to_cocci_scripts=tools/dev/experimental/
  18. dir=${1:-.}
  19. if [ ! -d $dir ]
  20. then
  21. echo "${path_to_cocci_scripts} does not exist...";
  22. exit 1
  23. fi
  24. #cpu_func => cpu_funcs
  25. spatch -sp_file ${path_to_cocci_scripts}/cpu_func_to_cpu_funcs.cocci -dir $dir -in_place -very_quiet
  26. # cuda_func => cuda_funcs
  27. sed 's/cpu_funcs/cuda_funcs/;
  28. s/cpu_func/cuda_func/;
  29. s/STARPU_MULTIPLE_CPU_IMPLEMENTATIONS/STARPU_MULTIPLE_CUDA_IMPLEMENTATIONS/' \
  30. ${path_to_cocci_scripts}/cpu_func_to_cpu_funcs.cocci > /tmp/cuda.cocci
  31. spatch -sp_file /tmp/cuda.cocci -dir $dir -in_place -very_quiet
  32. rm /tmp/cuda.cocci
  33. # opencl_func => opencl_funcs
  34. sed 's/cpu_funcs/opencl_funcs/;
  35. s/cpu_func/opencl_func/;
  36. s/STARPU_MULTIPLE_CPU_IMPLEMENTATIONS/STARPU_MULTIPLE_OPENCL_IMPLEMENTATIONS/' \
  37. ${path_to_cocci_scripts}/cpu_func_to_cpu_funcs.cocci > /tmp/opencl.cocci
  38. spatch -sp_file /tmp/opencl.cocci -dir $dir -in_place -very_quiet
  39. rm /tmp/opencl.cocci
  40. exit 0