func_to_funcs.sh 1.6 KB

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