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
8f3c406e
Commit
8f3c406e
authored
9 years ago
by
Prakalp Srivastava
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of bitbucket.org:psrivas2/visc
parents
fd8d3085
8e9531a2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
llvm/test/VISC/parboil/parboilParser.py
+78
-64
78 additions, 64 deletions
llvm/test/VISC/parboil/parboilParser.py
with
78 additions
and
64 deletions
llvm/test/VISC/parboil/parboilParser.py
+
78
−
64
View file @
8f3c406e
...
@@ -219,11 +219,14 @@ def printTimerDecomposition(csvDict, isVisc):
...
@@ -219,11 +219,14 @@ def printTimerDecomposition(csvDict, isVisc):
line
=
line
+
csvDict
[
app
][
v
][
test
][
t
][
cat
]
+
"
,
"
line
=
line
+
csvDict
[
app
][
v
][
test
][
t
][
cat
]
+
"
,
"
print
line
print
line
def
plotTimerDecomposition
(
csvDict
,
isVisc
):
def
plotTimerDecomposition
(
csvDict
,
plotapp
):
global
num_figs
global
num_figs
# get apps
# get apps
apps
=
csvDict
.
keys
()
if
not
plotapp
:
apps
=
csvDict
.
keys
()
else
:
apps
=
[
plotapp
]
# get tests for each app
# get tests for each app
tests
=
dict
()
tests
=
dict
()
...
@@ -231,79 +234,89 @@ def plotTimerDecomposition(csvDict, isVisc):
...
@@ -231,79 +234,89 @@ def plotTimerDecomposition(csvDict, isVisc):
tests
[
app
]
=
getTests
(
app
,
csvDict
)
tests
[
app
]
=
getTests
(
app
,
csvDict
)
# list of timer-category pairs
# list of timer-category pairs
if
isVisc
:
visc_timers
=
[(
'
Final
'
,
'
Kernel
'
),
timers
=
[(
'
Final
'
,
'
Kernel
'
),
(
'
Final
'
,
'
Load Program Binary
'
),
(
'
Final
'
,
'
Load Program Binary
'
),
(
'
Final
'
,
'
Argument Unpack
'
),
(
'
Final
'
,
'
Argument Unpack
'
),
(
'
Final
'
,
'
Marshal Arguments
'
),
(
'
Final
'
,
'
Marshal Arguments
'
),
(
'
Final
'
,
'
Free Memory
'
),
(
'
Final
'
,
'
Free Memory
'
),
(
'
Final
'
,
'
Memory Track
'
),
(
'
Final
'
,
'
Memory Track
'
),
(
'
Final
'
,
'
Clear Context
'
),
(
'
Final
'
,
'
Clear Context
'
),
(
'
Final
'
,
'
Total GPU Computation
'
),
(
'
Final
'
,
'
Total GPU Computation
'
),
(
'
Final
'
,
'
Copy Pointer Arguments
'
),
(
'
Final
'
,
'
Copy Pointer Arguments
'
),
(
'
Final
'
,
'
Initialize Context
'
),
(
'
Final
'
,
'
Initialize Context
'
),
(
'
Final
'
,
'
Read Output
'
),
(
'
Final
'
,
'
Read Output
'
),
(
'
Final
'
,
'
Pthread Create
'
),
(
'
Final
'
,
'
Pthread Create
'
),
(
'
Final
'
,
'
Copy Scalar Arguments
'
),
(
'
Final
'
,
'
Copy Scalar Arguments
'
),
(
'
Final
'
,
'
WorkGroup Size Calculation
'
),
(
'
Final
'
,
'
WorkGroup Size Calculation
'
),
(
'
Final
'
,
'
IO
'
),
(
'
Final
'
,
'
IO
'
),
(
'
Final
'
,
'
Output Pack
'
),
(
'
Final
'
,
'
Output Pack
'
),
(
'
Parboil
'
,
'
Mem_Untrack
'
),
(
'
Parboil
'
,
'
Mem_Untrack
'
),
(
'
Parboil
'
,
'
Clear_Ctx
'
),
(
'
Parboil
'
,
'
Clear_Ctx
'
),
(
'
GenVISC_Timer
'
,
'
Timer Wall Time
'
)]
(
'
GenVISC_Timer
'
,
'
Timer Wall Time
'
)]
opencl_timers
=
[(
'
Final
'
,
'
Init_Ctx
'
),
else
:
(
'
Final
'
,
'
Arg_Unpack
'
),
timers
=
[(
'
Final
'
,
'
Init_Ctx
'
),
(
'
Final
'
,
'
Copy_Scalar
'
),
(
'
Final
'
,
'
Arg_Unpack
'
),
(
'
Final
'
,
'
Mem_Track
'
),
(
'
Final
'
,
'
Copy_Scalar
'
),
(
'
Final
'
,
'
Driver
'
),
(
'
Final
'
,
'
Mem_Track
'
),
(
'
Final
'
,
'
Output_Unpack
'
),
(
'
Final
'
,
'
Driver
'
),
(
'
Final
'
,
'
Arg_Pack
'
),
(
'
Final
'
,
'
Output_Unpack
'
),
(
'
Final
'
,
'
Copy
'
),
(
'
Final
'
,
'
Arg_Pack
'
),
(
'
Final
'
,
'
Compute
'
),
(
'
Final
'
,
'
Copy
'
),
(
'
Final
'
,
'
Setup
'
),
(
'
Final
'
,
'
Compute
'
),
(
'
Final
'
,
'
Read_Output
'
),
(
'
Final
'
,
'
Setup
'
),
(
'
Final
'
,
'
IO
'
),
(
'
Final
'
,
'
Read_Output
'
),
(
'
Final
'
,
'
Pthread_Create
'
),
(
'
Final
'
,
'
IO
'
),
(
'
Final
'
,
'
Kernel
'
),
(
'
Final
'
,
'
Pthread_Create
'
),
(
'
Final
'
,
'
Mem_Free
'
),
(
'
Final
'
,
'
Kernel
'
),
(
'
Final
'
,
'
Copy Async
'
),
(
'
Final
'
,
'
Mem_Free
'
),
(
'
Final
'
,
'
Copy_Ptr
'
),
(
'
Final
'
,
'
Copy Async
'
),
(
'
Final
'
,
'
Output_Pack
'
),
(
'
Final
'
,
'
Copy_Ptr
'
),
(
'
Final
'
,
'
Mem_Untrack
'
),
(
'
Final
'
,
'
Output_Pack
'
),
(
'
Final
'
,
'
Clear_Ctx
'
),
(
'
Final
'
,
'
Mem_Untrack
'
),
(
'
Final
'
,
'
Timer Wall Time
'
)]
(
'
Final
'
,
'
Clear_Ctx
'
),
(
'
Final
'
,
'
Timer Wall Time
'
)]
# num_experiments = 0;
# for app in apps:
# for test in tests[app]:
# num_experiments += 1
# exp_count = 0
for
app
in
apps
:
for
app
in
apps
:
v
=
'
visc
'
if
isVisc
else
getOpenCLVersionName
(
app
)
for
test
in
tests
[
app
]:
for
test
in
tests
[
app
]:
# exp_count += 1
# Plotting visc timers
v
=
'
visc
'
n_vals
=
0
;
n_vals
=
0
;
axis_values
=
[]
axis_values
=
[]
time_decomp
=
[]
visc_
time_decomp
=
[]
for
(
t
,
cat
)
in
timers
:
for
(
t
,
cat
)
in
visc_
timers
:
n_vals
+=
1
n_vals
+=
1
axis_values
.
append
(
cat
);
axis_values
.
append
(
cat
);
time_decomp
.
append
(
float
(
csvDict
[
app
][
v
][
test
][
t
][
cat
]))
visc_
time_decomp
.
append
(
float
(
csvDict
[
app
][
v
][
test
][
t
][
cat
]))
opacity
=
0.4
opacity
=
0.4
num_figs
+=
1
num_figs
+=
1
fig
,
ax
=
plt
.
subplots
(
num
=
num_figs
)
fig
=
plt
.
figure
(
num
=
num_figs
)
ax
=
fig
.
add_subplot
(
211
);
index
=
np
.
arange
(
n_vals
)
index
=
np
.
arange
(
n_vals
)
plt
.
barh
(
index
,
time_decomp
,
alpha
=
opacity
,
color
=
'
b
'
,
label
=
v
)
plt
.
barh
(
index
,
visc_
time_decomp
,
alpha
=
opacity
,
color
=
'
b
'
,
label
=
v
)
plt
.
xlabel
(
'
Time (s)
'
)
plt
.
xlabel
(
'
Time (s)
'
)
plt
.
ylabel
(
'
Timers
'
)
plt
.
ylabel
(
'
Timers
'
)
plt
.
title
(
'
Time Decomposition -
'
+
app
+
'
'
+
test
+
'
'
+
v
)
plt
.
title
(
'
Time Decomposition -
'
+
app
+
'
'
+
test
+
'
'
+
v
)
plt
.
yticks
(
index
,
axis_values
)
plt
.
yticks
(
index
,
axis_values
)
plt
.
tight_layout
()
plt
.
tight_layout
()
v
=
getOpenCLVersionName
(
app
)
n_vals
=
0
;
axis_values
=
[]
opencl_time_decomp
=
[]
for
(
t
,
cat
)
in
opencl_timers
:
n_vals
+=
1
axis_values
.
append
(
cat
);
opencl_time_decomp
.
append
(
float
(
csvDict
[
app
][
v
][
test
][
t
][
cat
]))
opacity
=
0.4
ax
=
fig
.
add_subplot
(
212
);
index
=
np
.
arange
(
n_vals
)
plt
.
barh
(
index
,
opencl_time_decomp
,
alpha
=
opacity
,
color
=
'
r
'
,
label
=
v
)
plt
.
xlabel
(
'
Time (s)
'
)
plt
.
ylabel
(
'
Timers
'
)
plt
.
title
(
'
Time Decomposition -
'
+
app
+
'
'
+
test
+
'
'
+
v
)
plt
.
yticks
(
index
,
axis_values
)
plt
.
tight_layout
()
# command line options parser
# command line options parser
...
@@ -314,9 +327,9 @@ parser.add_option("--print-timers-visc",action="store_true",default=False,dest="
...
@@ -314,9 +327,9 @@ parser.add_option("--print-timers-visc",action="store_true",default=False,dest="
parser
.
add_option
(
"
--print-timers-opencl
"
,
action
=
"
store_true
"
,
default
=
False
,
dest
=
"
printTimersOpencl
"
)
parser
.
add_option
(
"
--print-timers-opencl
"
,
action
=
"
store_true
"
,
default
=
False
,
dest
=
"
printTimersOpencl
"
)
parser
.
add_option
(
"
--print-all
"
,
action
=
"
store_true
"
,
default
=
False
,
dest
=
"
printAll
"
)
parser
.
add_option
(
"
--print-all
"
,
action
=
"
store_true
"
,
default
=
False
,
dest
=
"
printAll
"
)
parser
.
add_option
(
"
--plot-totals
"
,
action
=
"
store_true
"
,
default
=
False
,
dest
=
"
plotTotals
"
)
parser
.
add_option
(
"
--plot-totals
"
,
action
=
"
store_true
"
,
default
=
False
,
dest
=
"
plotTotals
"
)
parser
.
add_option
(
"
--plot-timers-visc
"
,
action
=
"
store_true
"
,
default
=
False
,
dest
=
"
plotTimersVisc
"
)
parser
.
add_option
(
"
--plot-timers
"
,
action
=
"
store_true
"
,
default
=
False
,
dest
=
"
plotTimers
"
)
parser
.
add_option
(
"
--plot-timers-opencl
"
,
action
=
"
store_true
"
,
default
=
False
,
dest
=
"
plotTimersOpencl
"
)
parser
.
add_option
(
"
--plot-all
"
,
action
=
"
store_true
"
,
default
=
False
,
dest
=
"
plotAll
"
)
parser
.
add_option
(
"
--plot-all
"
,
action
=
"
store_true
"
,
default
=
False
,
dest
=
"
plotAll
"
)
parser
.
add_option
(
"
--plot-app
"
,
action
=
"
store
"
,
type
=
"
string
"
,
dest
=
"
plotapp
"
)
# main
# main
def
main
():
def
main
():
...
@@ -350,14 +363,15 @@ def main():
...
@@ -350,14 +363,15 @@ def main():
print
''
print
''
# plot graphs
# plot graphs
if
options
.
plotTotals
or
options
.
plotAll
:
if
options
.
plotTotals
or
options
.
plotAll
:
plotTotalExecutionTimeTable
(
csvDict
)
plotTotalExecutionTimeTable
(
csvDict
)
if
options
.
plot
TimersVisc
or
options
.
plotAll
:
if
options
.
plot
app
and
not
options
.
plotapp
in
csvDict
.
keys
()
:
p
lotTimerDecomposition
(
csvDict
,
isVisc
=
True
)
p
rint
"
parboilReader.py: Error: No input file was given!
"
raise
OSError
if
options
.
plotTimers
Opencl
or
options
.
plotAll
:
el
if
options
.
plot
app
or
options
.
plot
Timers
or
options
.
plotAll
:
plotTimerDecomposition
(
csvDict
,
isVisc
=
False
)
plotTimerDecomposition
(
csvDict
,
options
.
plotapp
)
plt
.
show
()
plt
.
show
()
for
i
in
range
(
num_figs
):
for
i
in
range
(
num_figs
):
...
...
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