Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hpvm-release
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
Model registry
Operate
Environments
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
hpvm-release
Commits
7c91431f
Commit
7c91431f
authored
7 years ago
by
kotsifa2
Browse files
Options
Downloads
Patches
Plain Diff
A version of Gradient working for merge
parent
ba543ac4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
llvm/test/VISC/parboil/benchmarks/pipeline/src/Gradient/main.cc
+23
-12
23 additions, 12 deletions
...est/VISC/parboil/benchmarks/pipeline/src/Gradient/main.cc
with
23 additions
and
12 deletions
llvm/test/VISC/parboil/benchmarks/pipeline/src/Gradient/main.cc
+
23
−
12
View file @
7c91431f
...
...
@@ -177,7 +177,8 @@ void horizontal(float* Is, size_t bytesIs,
//G[gloc] = Gx*Gx + Gy*Gy;
}
Gx
[
gloc
]
=
Val
;
__visc__return
(
m
);
//__visc__return(m);
__visc__return
(
bytesSx
);
}
void
WrapperHorizontal
(
float
*
Is
,
size_t
bytesIs
,
...
...
@@ -251,7 +252,8 @@ void vertical(float* Is, size_t bytesIs,
//G[gloc] = Gx*Gx + Gy*Gy;
}
Gy
[
gloc
]
=
Val
;
__visc__return
(
n
);
//__visc__return(n);
__visc__return
(
bytesSy
);
}
void
WrapperVertical
(
float
*
Is
,
size_t
bytesIs
,
...
...
@@ -280,7 +282,8 @@ void WrapperVertical(float* Is, size_t bytesIs,
void
squareRoot
(
float
*
Gx
,
size_t
bytesGx
,
float
*
Gy
,
size_t
bytesGy
,
float
*
G
,
size_t
bytesG
,
long
m
,
long
n
)
{
long
m
,
long
n
,
size_t
bytesSx
,
size_t
bytesSy
)
{
__visc__hint
(
visc
::
DEVICE
);
__visc__attributes
(
2
,
Gx
,
Gy
,
1
,
G
);
...
...
@@ -294,13 +297,15 @@ void squareRoot(float* Gx, size_t bytesGx,
G
[
index
]
=
__visc__sqrt
(
Gx
[
index
]
*
Gx
[
index
]
+
Gy
[
index
]
*
Gy
[
index
]);
}
__visc__return
(
m
);
//__visc__return(m);
__visc__return
(
bytesG
);
}
void
WrapperSquareRoot
(
float
*
Gx
,
size_t
bytesGx
,
float
*
Gy
,
size_t
bytesGy
,
float
*
G
,
size_t
bytesG
,
long
m
,
long
n
)
{
long
m
,
long
n
,
size_t
bytesSx
,
size_t
bytesSy
)
{
__visc__hint
(
visc
::
CPU_TARGET
);
__visc__attributes
(
2
,
Gx
,
Gy
,
1
,
G
);
...
...
@@ -314,6 +319,8 @@ void WrapperSquareRoot(float* Gx, size_t bytesGx,
__visc__bindIn
(
Node
,
5
,
5
,
0
);
// Bind bytesG
__visc__bindIn
(
Node
,
6
,
6
,
0
);
// Bind m
__visc__bindIn
(
Node
,
7
,
7
,
0
);
// Bind n
__visc__bindIn
(
Node
,
8
,
8
,
0
);
// Bind dummy 1
__visc__bindIn
(
Node
,
9
,
9
,
0
);
// Bind dummy 2
__visc__bindOut
(
Node
,
0
,
0
,
0
);
// bind output m
...
...
@@ -355,18 +362,22 @@ void Gradient(float* Is, size_t bytesIs,// 0
// Linear combination
__visc__bindIn
(
SNode
,
6
,
0
,
1
);
// Bind Gx
__visc__bindIn
(
SNode
,
7
,
1
,
1
);
// Bind bytesGx
__visc__bindIn
(
SNode
,
7
,
1
,
1
);
// Bind bytesGx
[Alt: Pass as edge from horizontal]
__visc__bindIn
(
SNode
,
8
,
2
,
1
);
// Bind Gy
__visc__bindIn
(
SNode
,
9
,
3
,
1
);
// Bind bytesGy
__visc__bindIn
(
SNode
,
9
,
3
,
1
);
// Bind bytesGy
[Alt: Pass as edge from vertical]
__visc__bindIn
(
SNode
,
10
,
4
,
1
);
// Bind G
__visc__bindIn
(
SNode
,
11
,
5
,
1
);
// Bind bytesG
//
__visc__bindIn(SNode, 12, 6,
0
); // Bind m [Pass as edge from
dilate
]
//
__visc__bindIn(SNode, 13, 7,
0
); // Bind n [Pass as edge from er
ode
]
__visc__bindIn
(
SNode
,
12
,
6
,
1
);
// Bind m [
Alt:
Pass as edge from
horizontal
]
__visc__bindIn
(
SNode
,
13
,
7
,
1
);
// Bind n [
Alt:
Pass as edge from
v
er
tical
]
__visc__edge
(
HNode
,
SNode
,
0
,
0
,
6
,
1
);
// Get m from dilate
__visc__edge
(
VNode
,
SNode
,
0
,
0
,
7
,
1
);
// Get n from erode
//__visc__edge(HNode, SNode, 0, 0, 6, 1); // Get m from horizontal
//__visc__edge(VNode, SNode, 0, 0, 7, 1); // Get n from vertical
//__visc__edge(HNode, SNode, 0, 0, 1, 1); // Get bytesGx from horizontal
//__visc__edge(VNode, SNode, 0, 0, 3, 1); // Get bytesGy from vertical
__visc__edge
(
HNode
,
SNode
,
0
,
0
,
8
,
1
);
// Get bytes from horizontal
__visc__edge
(
VNode
,
SNode
,
0
,
0
,
9
,
1
);
// Get bytesGy from vertical
__visc__bindOut
(
SNode
,
0
,
0
,
1
);
// bind output
m
__visc__bindOut
(
SNode
,
0
,
0
,
1
);
// bind output
bytesG
}
...
...
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