mandelbrot_generated.jl 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # StarPU --- Runtime system for heterogeneous multicore architectures.
  2. #
  3. # Copyright (C) 2020 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. if length(ARGS) != 7
  17. println("Usage : julia prog.jl cr ci start_dim step_dim stop_dim nslices nbr_tests")
  18. quit()
  19. end
  20. if (parse(Int64,ARGS[3]) % parse(Int64,ARGS[6]) != 0)
  21. println("The number of slices should divide all the dimensions.")
  22. quit()
  23. end
  24. include("../../src/Wrapper/Julia/starpu_include.jl")
  25. using StarPU
  26. @debugprint "starpu_init"
  27. starpu_init(extern_task_path = "../build/generated_tasks_mandelbrot.so")
  28. perfmodel = StarpuPerfmodel(
  29. perf_type = STARPU_HISTORY_BASED,
  30. symbol = "history_perf"
  31. )
  32. cl = StarpuCodelet(
  33. cpu_func = "mandelbrot",
  34. gpu_func = "CUDA_mandelbrot",
  35. modes = [STARPU_W, STARPU_R, STARPU_R],
  36. perfmodel = perfmodel
  37. )
  38. clcpu = StarpuCodelet(
  39. cpu_func = "mandelbrot",
  40. modes = [STARPU_W, STARPU_R, STARPU_R],
  41. perfmodel = perfmodel
  42. )
  43. clgpu = StarpuCodelet(
  44. gpu_func = "CUDA_mandelbrot",
  45. modes = [STARPU_W, STARPU_R, STARPU_R],
  46. perfmodel = perfmodel
  47. )
  48. include("mandelbrot_def.jl")
  49. display_time(parse(Float64,ARGS[1]), parse(Float64,ARGS[2]), map((x -> parse(Int64, x)), ARGS[3:7])...)
  50. @debugprint "starpu_shutdown"
  51. starpu_shutdown()