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
6a828121
Commit
6a828121
authored
4 years ago
by
Yifan Zhao
Browse files
Options
Downloads
Patches
Plain Diff
Added cmake targets to run benchmarks
parent
c1bcf681
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
hpvm/test/dnn_benchmarks/CMakeLists.txt
+15
-3
15 additions, 3 deletions
hpvm/test/dnn_benchmarks/CMakeLists.txt
with
15 additions
and
3 deletions
hpvm/test/dnn_benchmarks/CMakeLists.txt
+
15
−
3
View file @
6a828121
...
@@ -40,10 +40,10 @@ list(
...
@@ -40,10 +40,10 @@ list(
)
)
# The hpvm-rt runtime
# The hpvm-rt runtime
# This has to be explicitly set as hpvm-rt.
ll
is created in a custom_target
# This has to be explicitly set as hpvm-rt.
bc
is created in a custom_target
# and does not export its file location.
# and does not export its file location.
# Keep this in sync with hpvm/projects/hpvm-rt/CMakeLists.txt.
# Keep this in sync with hpvm/projects/hpvm-rt/CMakeLists.txt.
set
(
HPVM_RT_PATH
${
PROJECT_BINARY_DIR
}
/tools/hpvm/projects/hpvm-rt/hpvm-rt.
ll
)
set
(
HPVM_RT_PATH
${
PROJECT_BINARY_DIR
}
/tools/hpvm/projects/hpvm-rt/hpvm-rt.
bc
)
# Compile flags (clang++)
# Compile flags (clang++)
set
(
CLANG_FLAGS -fno-exceptions -std=c++11 -O3
)
set
(
CLANG_FLAGS -fno-exceptions -std=c++11 -O3
)
...
@@ -89,7 +89,7 @@ function(compile_single_benchmark target src_file extra_passes extra_dfg_flags)
...
@@ -89,7 +89,7 @@ function(compile_single_benchmark target src_file extra_passes extra_dfg_flags)
)
)
add_custom_command
(
add_custom_command
(
OUTPUT
"
${
WORK_DIR
}
/
${
target
}
.linked.bc"
OUTPUT
"
${
WORK_DIR
}
/
${
target
}
.linked.bc"
DEPENDS
"
${
WORK_DIR
}
/
${
target
}
.llvm.ll"
hpvm-rt.
ll
llvm-link
DEPENDS
"
${
WORK_DIR
}
/
${
target
}
.llvm.ll"
hpvm-rt.
bc
llvm-link
COMMAND
${
LLVM_LINK
}
${
WORK_DIR
}
/
${
target
}
.llvm.ll
${
HPVM_RT_PATH
}
COMMAND
${
LLVM_LINK
}
${
WORK_DIR
}
/
${
target
}
.llvm.ll
${
HPVM_RT_PATH
}
-o
${
WORK_DIR
}
/
${
target
}
.linked.bc
-o
${
WORK_DIR
}
/
${
target
}
.linked.bc
)
)
...
@@ -106,12 +106,23 @@ function(compile_single_benchmark target src_file extra_passes extra_dfg_flags)
...
@@ -106,12 +106,23 @@ function(compile_single_benchmark target src_file extra_passes extra_dfg_flags)
set
(
test_compile_targets
${
test_compile_targets
}
${
target
}
PARENT_SCOPE
)
set
(
test_compile_targets
${
test_compile_targets
}
${
target
}
PARENT_SCOPE
)
endfunction
(
compile_single_benchmark
)
endfunction
(
compile_single_benchmark
)
set
(
test_run_targets
""
)
function
(
run_single_benchmark run_target benchmark
)
add_custom_target
(
${
run_target
}
COMMAND
${
WORK_DIR
}
/
${
benchmark
}
)
add_dependencies
(
${
run_target
}
${
benchmark
}
)
set
(
test_run_targets
${
test_run_targets
}
${
run_target
}
PARENT_SCOPE
)
endfunction
(
run_single_benchmark
)
file
(
GLOB entries ./benchmarks/*
)
file
(
GLOB entries ./benchmarks/*
)
foreach
(
dir
${
entries
}
)
foreach
(
dir
${
entries
}
)
get_filename_component
(
dirname
"
${
dir
}
"
NAME
)
get_filename_component
(
dirname
"
${
dir
}
"
NAME
)
compile_single_benchmark
(
compile_single_benchmark
(
"test_
${
dirname
}
"
${
dir
}
/
${
dirname
}
.cpp LLVMDFG2LLVM_CUDNN -dfg2llvm-cudnn
"test_
${
dirname
}
"
${
dir
}
/
${
dirname
}
.cpp LLVMDFG2LLVM_CUDNN -dfg2llvm-cudnn
)
)
run_single_benchmark
(
"run_
${
dirname
}
"
"test_
${
dirname
}
"
)
set
(
set
(
loop_extra_flags
loop_extra_flags
-dfg2llvm-wrapperapi
-dfg2llvm-wrapperapi
...
@@ -122,6 +133,7 @@ foreach(dir ${entries})
...
@@ -122,6 +133,7 @@ foreach(dir ${entries})
"test_
${
dirname
}
_loop"
${
dir
}
/
${
dirname
}
_loop.cpp
"test_
${
dirname
}
_loop"
${
dir
}
/
${
dirname
}
_loop.cpp
LLVMDFG2LLVM_WrapperAPI
"
${
loop_extra_flags
}
"
LLVMDFG2LLVM_WrapperAPI
"
${
loop_extra_flags
}
"
)
)
run_single_benchmark
(
"run_
${
dirname
}
_loop"
"test_
${
dirname
}
_loop"
)
endforeach
(
dir
)
endforeach
(
dir
)
message
(
STATUS
"List of test dnn benchmarks:
${
test_compile_targets
}
"
)
message
(
STATUS
"List of test dnn benchmarks:
${
test_compile_targets
}
"
)
add_custom_target
(
dnn_benchmarks DEPENDS
${
test_compile_targets
}
)
add_custom_target
(
dnn_benchmarks DEPENDS
${
test_compile_targets
}
)
...
...
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