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
d83d48cf
Commit
d83d48cf
authored
5 months ago
by
Russel Arbore
Browse files
Options
Downloads
Patches
Plain Diff
parallelize parts of edge
parent
1aceb18f
No related branches found
No related tags found
1 merge request
!198
Optimization for miranda
Pipeline
#201849
failed
5 months ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
juno_samples/edge_detection/src/cpu.sch
+26
-2
26 additions, 2 deletions
juno_samples/edge_detection/src/cpu.sch
juno_samples/edge_detection/src/edge_detection.jn
+12
-12
12 additions, 12 deletions
juno_samples/edge_detection/src/edge_detection.jn
with
38 additions
and
14 deletions
juno_samples/edge_detection/src/cpu.sch
+
26
−
2
View file @
d83d48cf
...
...
@@ -24,6 +24,14 @@ predication(gaussian_smoothing);
simpl!(gaussian_smoothing);
predication(gaussian_smoothing);
simpl!(gaussian_smoothing);
let par = gaussian_smoothing@image_loop \ gaussian_smoothing@filter_loop;
fork-tile[4, 1, false, false](par);
fork-tile[4, 0, false, false](par);
fork-interchange[1, 2](par);
let split = fork-split(par);
let gaussian_smoothing_body = outline(split._0_gaussian_smoothing.fj2);
fork-coalesce(gaussian_smoothing, gaussian_smoothing_body);
simpl!(gaussian_smoothing, gaussian_smoothing_body);
no-memset(laplacian_estimate@res, laplacian_estimate@shr1, laplacian_estimate@shr2);
fixpoint {
...
...
@@ -32,6 +40,14 @@ fixpoint {
fork-coalesce(laplacian_estimate);
}
simpl!(laplacian_estimate);
let par = laplacian_estimate@image_loop \ laplacian_estimate@filter_loop;
fork-tile[4, 1, false, false](par);
fork-tile[4, 0, false, false](par);
fork-interchange[1, 2](par);
let split = fork-split(par);
let laplacian_estimate_body = outline(split._1_laplacian_estimate.fj2);
fork-coalesce(laplacian_estimate, laplacian_estimate_body);
simpl!(laplacian_estimate, laplacian_estimate_body);
no-memset(zero_crossings@res, zero_crossings@shr1, zero_crossings@shr2);
fixpoint {
...
...
@@ -40,6 +56,14 @@ fixpoint {
fork-coalesce(zero_crossings);
}
simpl!(zero_crossings);
let par = zero_crossings@image_loop \ zero_crossings@filter_loop;
fork-tile[4, 1, false, false](par);
fork-tile[4, 0, false, false](par);
fork-interchange[1, 2](par);
let split = fork-split(par);
let zero_crossings_body = outline(split._2_zero_crossings.fj2);
fork-coalesce(zero_crossings, zero_crossings_body);
simpl!(zero_crossings, zero_crossings_body);
no-memset(gradient@res);
fixpoint {
...
...
@@ -81,8 +105,8 @@ simpl!(reject_zero_crossings);
async-call(edge_detection@le, edge_detection@zc);
fork-split(gaussian_smoothing, laplacian_estimate, zero_crossings, gradient, reject_zero_crossings);
unforkify(gaussian_smoothing, laplacian_estimate, zero_crossings, gradient, reject_zero_crossings);
fork-split(gaussian_smoothing
_body
, laplacian_estimate
_body
, zero_crossings
_body
, gradient, reject_zero_crossings);
unforkify(gaussian_smoothing
_body
, laplacian_estimate
_body
, zero_crossings
_body
, gradient, reject_zero_crossings);
simpl!(*);
...
...
This diff is collapsed.
Click to expand it.
juno_samples/edge_detection/src/edge_detection.jn
+
12
−
12
View file @
d83d48cf
...
...
@@ -7,11 +7,11 @@ fn gaussian_smoothing<n, m, gs : usize>(
// Define the gaussian radius as half the gaussian size
const
gr
=
gs
/
2
;
for
row
=
0
to
n
{
@
image_loop
for
row
=
0
to
n
{
for
col
=
0
to
m
{
let
smoothed
=
0.0
;
for
i
=
0
to
gs
{
@
filter_loop
for
i
=
0
to
gs
{
for
j
=
0
to
gs
{
let
val
=
input
[
if
row
+
i
<
gr
then
0
else
if
row
+
i
-
gr
>
n
-
1
then
n
-
1
...
...
@@ -41,11 +41,11 @@ fn laplacian_estimate<n, m, sz: usize>(
@
res
let
result
:
f32
[
n
,
m
];
for
row
=
0
to
n
{
@
image_loop
for
row
=
0
to
n
{
for
col
=
0
to
m
{
// Copy data for dilation filter
@
shr1
let
imageArea
:
f32
[
sz
,
sz
];
for
i
=
0
to
sz
{
@
filter_loop
for
i
=
0
to
sz
{
for
j
=
0
to
sz
{
imageArea
[
i
,
j
]
=
if
row
+
i
<
r
then
MIN_BR
else
if
row
+
i
-
r
>
n
-
1
then
MIN_BR
...
...
@@ -57,7 +57,7 @@ fn laplacian_estimate<n, m, sz: usize>(
// Compute pixel of dilated image
let
dilated
=
MIN_BR
;
for
i
=
0
to
sz
{
@
filter_loop
for
i
=
0
to
sz
{
for
j
=
0
to
sz
{
dilated
=
max!
(
dilated
,
imageArea
[
i
,
j
]
*
structure
[
i
,
j
]);
}
...
...
@@ -65,7 +65,7 @@ fn laplacian_estimate<n, m, sz: usize>(
// Data copy for erotion filter
@
shr2
let
imageArea
:
f32
[
sz
,
sz
];
for
i
=
0
to
sz
{
@
filter_loop
for
i
=
0
to
sz
{
for
j
=
0
to
sz
{
imageArea
[
i
,
j
]
=
if
row
+
i
<
r
then
MAX_BR
else
if
row
+
i
-
r
>
n
-
1
then
MAX_BR
...
...
@@ -77,7 +77,7 @@ fn laplacian_estimate<n, m, sz: usize>(
// Compute pixel of eroded image
let
eroded
=
MAX_BR
;
for
i
=
0
to
sz
{
@
filter_loop
for
i
=
0
to
sz
{
for
j
=
0
to
sz
{
eroded
=
min!
(
eroded
,
imageArea
[
i
,
j
]
*
structure
[
i
,
j
]);
}
...
...
@@ -99,11 +99,11 @@ fn zero_crossings<n, m, sz: usize>(
@
res
let
result
:
f32
[
n
,
m
];
for
row
=
0
to
n
{
@
image_loop
for
row
=
0
to
n
{
for
col
=
0
to
m
{
// Data copy for dilation filter
@
shr1
let
imageArea
:
f32
[
sz
,
sz
];
for
i
=
0
to
sz
{
@
filter_loop
for
i
=
0
to
sz
{
for
j
=
0
to
sz
{
imageArea
[
i
,
j
]
=
if
row
+
i
<
r
then
MIN_BR
else
if
row
+
i
-
r
>
n
-
1
then
MIN_BR
...
...
@@ -117,7 +117,7 @@ fn zero_crossings<n, m, sz: usize>(
// Compute the pixel of dilated image
let
dilated
=
MIN_BR
;
for
i
=
0
to
sz
{
@
filter_loop
for
i
=
0
to
sz
{
for
j
=
0
to
sz
{
dilated
=
max!
(
dilated
,
imageArea
[
i
,
j
]
*
structure
[
i
,
j
]);
}
...
...
@@ -125,7 +125,7 @@ fn zero_crossings<n, m, sz: usize>(
// Data copy for erotion filter
@
shr2
let
imageArea
:
f32
[
sz
,
sz
];
for
i
=
0
to
sz
{
@
filter_loop
for
i
=
0
to
sz
{
for
j
=
0
to
sz
{
imageArea
[
i
,
j
]
=
if
row
+
i
<
r
then
MAX_BR
else
if
row
+
i
-
r
>
n
-
1
then
MAX_BR
...
...
@@ -139,7 +139,7 @@ fn zero_crossings<n, m, sz: usize>(
// Compute the pixel of eroded image
let
eroded
=
MAX_BR
;
for
i
=
0
to
sz
{
@
filter_loop
for
i
=
0
to
sz
{
for
j
=
0
to
sz
{
eroded
=
min!
(
eroded
,
imageArea
[
i
,
j
]
*
structure
[
i
,
j
]);
}
...
...
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