Skip to content

Commit

Permalink
Extract parallelism from polyhedron
Browse files Browse the repository at this point in the history
  • Loading branch information
hikettei committed Dec 17, 2024
1 parent ec33be1 commit 30cdfad
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
8 changes: 7 additions & 1 deletion source/polyhedral/auto-scheduler.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,14 @@
```
(auto-schedule scheduler poly)
```
An entrypoint for auto-scheduling"
An entrypoint for auto-scheduling.
https://github.com/Tiramisu-Compiler/tiramisu/blob/master/src/auto_scheduler/tiramisu_schedules_generator.cpp#L465
"
(declare (type Auto-Scheduler-Config scheduler) (type Polyhedral-IR poly))
;; [TODO] Creating smth like tiramisu
(caten/polyhedral/parallelism::polyir-set-parallel poly 0)
;; 1. start by implementing simple case
;; (setf (poly-schedule poly) (schedule scheduler poly)) ;; Getting an intial schedule, extracting parallelism
;; Tiling
;; (caten/polyhedral/tiling:tile-bands scheduler poly)
Expand Down
19 changes: 13 additions & 6 deletions source/polyhedral/parallelism.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
(defun check-legality-parallel (node dep)
"Reference: https://github.com/hikettei/tadashi/blob/main/src/legality.c#L91-L122"
(declare (type isl::schedule-node node) (type isl::union-map dep))
;; memo: :ISL_BOOL toka janai?
(when (print (isl:union-map-is-empty dep)) (return-from check-legality-parallel t))
(when (isl:union-map-is-empty dep) (return-from check-legality-parallel t))
(let* ((map (isl:schedule-node-band-get-partial-schedule-union-map node))
(domain (isl:union-map-apply-range (isl:union-map-apply-domain dep map) map))
(delta (isl:union-map-deltas domain))
Expand All @@ -28,8 +27,16 @@
(declare (ignore _))
(and retval (isl:union-set-is-empty cmp))))

;; Scheduling Command
(defun polyhedral-set-parallel (poly level)
(defun polyir-set-parallel (poly level)
(declare (type Polyhedral-IR poly))

)
(let ((schedule (poly-schedule poly))
(deps (poly-dependencies poly)))
(map-schedule-nodes
#'(lambda (type band)
(when (eql type :schedule-node-band)
(print "+++++++++++++")
(print band)
(print (check-legality-parallel band deps))))
poly)
(print "++++FINISH++++++")
))

0 comments on commit 30cdfad

Please sign in to comment.