Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
Hercules
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
llvm
Hercules
Commits
e14ed8e2
Commit
e14ed8e2
authored
1 year ago
by
Russel Arbore
Browse files
Options
Downloads
Patches
Plain Diff
Infer vectorizable fork-joins
parent
bb957692
Branches
schedules
No related tags found
1 merge request
!13
Basic IR schedules framework
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hercules_ir/src/schedule.rs
+23
-2
23 additions, 2 deletions
hercules_ir/src/schedule.rs
with
23 additions
and
2 deletions
hercules_ir/src/schedule.rs
+
23
−
2
View file @
e14ed8e2
...
...
@@ -76,11 +76,10 @@ pub fn default_plan(
// Infer schedules.
infer_parallel_reduce
(
function
,
fork_join_map
,
&
mut
plan
);
infer_vectorize
(
function
,
fork_join_map
,
&
mut
plan
);
// Infer a partitioning.
partition_out_forks
(
function
,
reverse_postorder
,
fork_join_map
,
bbs
,
&
mut
plan
);
// Place fork partitions on the GPU.
place_fork_partitions_on_gpu
(
function
,
&
mut
plan
);
plan
...
...
@@ -166,6 +165,28 @@ pub fn infer_parallel_reduce(
}
}
/*
* Infer vectorizable fork-joins. Just check that there are no control nodes
* between a fork and its join.
*/
pub
fn
infer_vectorize
(
function
:
&
Function
,
fork_join_map
:
&
HashMap
<
NodeID
,
NodeID
>
,
plan
:
&
mut
Plan
,
)
{
for
id
in
(
0
..
function
.nodes
.len
())
.map
(
NodeID
::
new
)
.filter
(|
id
|
function
.nodes
[
id
.idx
()]
.is_join
())
{
let
u
=
get_uses
(
&
function
.nodes
[
id
.idx
()])
.as_ref
()[
0
];
if
let
Some
(
join
)
=
fork_join_map
.get
(
&
u
)
&&
*
join
==
id
{
plan
.schedules
[
u
.idx
()]
.push
(
Schedule
::
Vectorize
);
}
}
}
/*
* Create partitions corresponding to fork-join nests. Also, split the "top-
* level" partition into sub-partitions that are connected graphs. Place data
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment