Tiramisu-Compiler / tiramisu

A polyhedral compiler for expressing fast and portable data parallel algorithms
http://tiramisu-compiler.org
MIT License
916 stars 132 forks source link

Add autoscheduler module #322

Closed abdouskamel closed 3 years ago

abdouskamel commented 4 years ago

Here you can find the autoscheduler module, which is located in include/tiramisu/autoscheduler and src/autoscheduler.

make test gives 100%.

Files in the repo that I modified :

  1. configure.cmake : added an option to build or not build the autoscheduler.
  2. CMakeLists.txt : added commands to build the autoscheduler.
  3. README.md : added some instructions for how to build the autoscheduler.
  4. include/tiramisu/block.h and src/tiramisu_block.cpp : added function virtual void unroll(int L, int fac);, to unroll a loop in a block using its index.
  5. include/tiramisu/core.h : a. Define some classes of the autoscheduler as friends of the class tiramisu::function. b. Define some classes of the autoscheduler as friend of the class tiramisu::computation. c. Remove mentions of the file include/tiramisu/computation_graph.h. d. Add a header for the function : Halide::Argument::Kind halide_argtype_from_tiramisu_argtype(tiramisu::argument_t type);, so this function can be used in the autoscheduler. e. In the class computation, add function virtual void unroll(int L, int fac); to unroll a loop level using its index. f. In the class function, add functions : void reset_schedules(); (which is public), void clear_sched_graph(); and void remove_dimension_tags(); (which are private).
  6. src/tiramisu_core.cpp : add the body for virtual void unroll(int L, int fac);.
  7. src/tiramisu_function.cpp : add the bodies for void reset_schedules();, void clear_sched_graph(); and void remove_dimension_tags();.

Files removed : include/tiramisu/auto_scheduler.h include/tiramisu/computation_graph.h src/tiramisu_computation_graph.cpp.

Other additions are all in include/tiramisu/auto_scheduler or src/auto_scheduler.

I need to add two more things to the code of the autoscheduler, I will do it as soon as possible.

I created a repo here for how to use the autoscheduler : https://github.com/abdouskamel/demo_tiramisu_autoscheduler