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
7b6ba729
Commit
7b6ba729
authored
4 weeks ago
by
Russel Arbore
Browse files
Options
Downloads
Patches
Plain Diff
more bfs opt
parent
4cd1d610
No related branches found
No related tags found
2 merge requests
!215
Large benches
,
!214
More optimizations
Pipeline
#202020
passed
4 weeks ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
hercules_cg/src/gpu.rs
+11
-7
11 additions, 7 deletions
hercules_cg/src/gpu.rs
juno_samples/rodinia/bfs/src/gpu.sch
+1
-1
1 addition, 1 deletion
juno_samples/rodinia/bfs/src/gpu.sch
with
12 additions
and
8 deletions
hercules_cg/src/gpu.rs
+
11
−
7
View file @
7b6ba729
...
@@ -354,6 +354,7 @@ impl GPUContext<'_> {
...
@@ -354,6 +354,7 @@ impl GPUContext<'_> {
write!
(
write!
(
w
,
w
,
"
"
#define _CG_ABI_EXPERIMENTAL
#include <assert.h>
#include <assert.h>
#include <stdio.h>
#include <stdio.h>
#include <stddef.h>
#include <stddef.h>
...
@@ -1294,7 +1295,7 @@ namespace cg = cooperative_groups;
...
@@ -1294,7 +1295,7 @@ namespace cg = cooperative_groups;
}
}
if
!
is_primitive
&&
state
!=
KernelState
::
OutBlock
{
if
!
is_primitive
&&
state
!=
KernelState
::
OutBlock
{
write!
(
w
,
"{}}}
\n
"
,
tabs
)
?
;
write!
(
w
,
"{}}}
\n
"
,
tabs
)
?
;
write!
(
w
,
"{}{}.sync();
\n
"
,
tabs
,
cg_tile
)
?
;
//
write!(w, "{}{}.sync();\n", tabs, cg_tile)?;
*
num_tabs
-=
1
;
*
num_tabs
-=
1
;
}
}
if
!
is_primitive
&&
state
==
KernelState
::
OutBlock
{
if
!
is_primitive
&&
state
==
KernelState
::
OutBlock
{
...
@@ -1311,6 +1312,7 @@ namespace cg = cooperative_groups;
...
@@ -1311,6 +1312,7 @@ namespace cg = cooperative_groups;
}
}
if
!
is_primitive
if
!
is_primitive
&&
(
state
!=
KernelState
::
OutBlock
||
!
is_block_parallel
.unwrap_or
(
false
))
&&
(
state
!=
KernelState
::
OutBlock
||
!
is_block_parallel
.unwrap_or
(
false
))
&&
!
self
.function.schedules
[
id
.idx
()]
.contains
(
&
Schedule
::
NoResetConstant
)
{
{
let
data_size
=
self
.get_size
(
self
.typing
[
id
.idx
()],
None
);
let
data_size
=
self
.get_size
(
self
.typing
[
id
.idx
()],
None
);
write!
(
write!
(
...
@@ -1320,7 +1322,8 @@ namespace cg = cooperative_groups;
...
@@ -1320,7 +1322,8 @@ namespace cg = cooperative_groups;
)
?
;
)
?
;
write!
(
w
,
"{}
\t
*({} + i) = 0;
\n
"
,
tabs
,
define_variable
)
?
;
write!
(
w
,
"{}
\t
*({} + i) = 0;
\n
"
,
tabs
,
define_variable
)
?
;
write!
(
w
,
"{}}}
\n
"
,
tabs
)
?
;
write!
(
w
,
"{}}}
\n
"
,
tabs
)
?
;
write!
(
w
,
"{}{}.sync();
\n
"
,
tabs
,
cg_tile
)
?
;
//write!(w, "{}{}.sync();\n", tabs, cg_tile)?;
write!
(
w
,
"__syncthreads
\n
"
)
?
;
}
}
}
}
// Dynamic constants emitted at top
// Dynamic constants emitted at top
...
@@ -1595,7 +1598,7 @@ namespace cg = cooperative_groups;
...
@@ -1595,7 +1598,7 @@ namespace cg = cooperative_groups;
write!
(
w
,
"{}
\t
*({} + {}.size() * ({} / {}.size()) + {}.thread_rank()) = *({} + {}.size() * ({} / {}.size()) + {}.thread_rank());
\n
"
,
tabs
,
collect_with_indices
,
cg_tile
,
data_size
,
cg_tile
,
cg_tile
,
data_variable
,
cg_tile
,
data_size
,
cg_tile
,
cg_tile
)
?
;
write!
(
w
,
"{}
\t
*({} + {}.size() * ({} / {}.size()) + {}.thread_rank()) = *({} + {}.size() * ({} / {}.size()) + {}.thread_rank());
\n
"
,
tabs
,
collect_with_indices
,
cg_tile
,
data_size
,
cg_tile
,
cg_tile
,
data_variable
,
cg_tile
,
data_size
,
cg_tile
,
cg_tile
)
?
;
write!
(
w
,
"{}}}
\n
"
,
tabs
)
?
;
write!
(
w
,
"{}}}
\n
"
,
tabs
)
?
;
}
}
write!
(
w
,
"{}{}.sync();
\n
"
,
tabs
,
cg_tile
)
?
;
//
write!(w, "{}{}.sync();\n", tabs, cg_tile)?;
let
collect_variable
=
self
.get_value
(
*
collect
,
false
,
false
);
let
collect_variable
=
self
.get_value
(
*
collect
,
false
,
false
);
write!
(
w
,
"{}{} = {};
\n
"
,
tabs
,
define_variable
,
collect_variable
)
?
;
write!
(
w
,
"{}{} = {};
\n
"
,
tabs
,
define_variable
,
collect_variable
)
?
;
}
}
...
@@ -1705,20 +1708,20 @@ namespace cg = cooperative_groups;
...
@@ -1705,20 +1708,20 @@ namespace cg = cooperative_groups;
};
};
write!
(
write!
(
thread_block_tiles
,
thread_block_tiles
,
"
\t
cg::thread_block_tile<{}> {} = cg::tiled_partition<{}>(block);
\n
"
,
"
\t
cg::thread_block_tile<{}> {} = cg::
experimental::
tiled_partition<{}>(block);
\n
"
,
use_thread_per_id
,
cg_tile
,
use_thread_per_id
use_thread_per_id
,
cg_tile
,
use_thread_per_id
)
?
;
)
?
;
let
cg_tile_use
=
self
.get_cg_tile
(
id
,
CGType
::
Use
);
let
cg_tile_use
=
self
.get_cg_tile
(
id
,
CGType
::
Use
);
write!
(
write!
(
thread_block_tiles
,
thread_block_tiles
,
"
\t
cg::thread_block_tile<{}> {} = cg::tiled_partition<{}>(block);
\n
"
,
"
\t
cg::thread_block_tile<{}> {} = cg::
experimental::
tiled_partition<{}>(block);
\n
"
,
use_thread_quota
,
cg_tile_use
,
use_thread_quota
use_thread_quota
,
cg_tile_use
,
use_thread_quota
)
?
;
)
?
;
let
available_thread_quota
=
available_thread_quota
.unwrap
();
let
available_thread_quota
=
available_thread_quota
.unwrap
();
let
cg_tile_available
=
self
.get_cg_tile
(
id
,
CGType
::
Available
);
let
cg_tile_available
=
self
.get_cg_tile
(
id
,
CGType
::
Available
);
write!
(
write!
(
thread_block_tiles
,
thread_block_tiles
,
"
\t
cg::thread_block_tile<{}> {} = cg::tiled_partition<{}>(block);
\n
"
,
"
\t
cg::thread_block_tile<{}> {} = cg::
experimental::
tiled_partition<{}>(block);
\n
"
,
available_thread_quota
,
cg_tile_available
,
available_thread_quota
available_thread_quota
,
cg_tile_available
,
available_thread_quota
)
?
;
)
?
;
if
parallel_factor
.is_none
()
{
if
parallel_factor
.is_none
()
{
...
@@ -1780,7 +1783,8 @@ namespace cg = cooperative_groups;
...
@@ -1780,7 +1783,8 @@ namespace cg = cooperative_groups;
}
}
let
fork
=
self
.join_fork_map
.get
(
&
id
)
.unwrap
();
let
fork
=
self
.join_fork_map
.get
(
&
id
)
.unwrap
();
let
cg_tile_available
=
self
.get_cg_tile
(
*
fork
,
CGType
::
Available
);
let
cg_tile_available
=
self
.get_cg_tile
(
*
fork
,
CGType
::
Available
);
write!
(
w_term
,
"
\t
{}.sync();
\n
"
,
cg_tile_available
)
?
;
//write!(w_term, "\t{}.sync();\n", cg_tile_available)?;
write!
(
w_term
,
"
\t
__syncthreads;
\n
"
)
?
;
}
}
// If the Fork was parallelized, each thread or UsedPerId tile of
// If the Fork was parallelized, each thread or UsedPerId tile of
// threads only runs one ThreadID, so we can jump straight to the
// threads only runs one ThreadID, so we can jump straight to the
...
...
This diff is collapsed.
Click to expand it.
juno_samples/rodinia/bfs/src/gpu.sch
+
1
−
1
View file @
7b6ba729
...
@@ -38,7 +38,7 @@ fixpoint {
...
@@ -38,7 +38,7 @@ fixpoint {
}
}
simpl!(collect);
simpl!(collect);
fork-tile[
32
, 0, false, true](traverse, collect);
fork-tile[
1024
, 0, false, true](traverse, collect);
fork-split(traverse, collect);
fork-split(traverse, collect);
unforkify(init);
unforkify(init);
...
...
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