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
20478dcb
Commit
20478dcb
authored
4 years ago
by
Yifan Zhao
Browse files
Options
Downloads
Patches
Plain Diff
Make each compile step depends on their own pass/libs so that pass update triggers recompilation
parent
edc43964
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hpvm/test/dnn_benchmarks/CMakeLists.txt
+10
-14
10 additions, 14 deletions
hpvm/test/dnn_benchmarks/CMakeLists.txt
with
10 additions
and
14 deletions
hpvm/test/dnn_benchmarks/CMakeLists.txt
+
10
−
14
View file @
20478dcb
...
@@ -48,7 +48,7 @@ set(HPVM_RT_PATH ${PROJECT_BINARY_DIR}/tools/hpvm/projects/hpvm-rt/hpvm-rt.ll)
...
@@ -48,7 +48,7 @@ set(HPVM_RT_PATH ${PROJECT_BINARY_DIR}/tools/hpvm/projects/hpvm-rt/hpvm-rt.ll)
# Compile flags (clang++)
# Compile flags (clang++)
set
(
CLANG_FLAGS -fno-exceptions -std=c++11 -O3
)
set
(
CLANG_FLAGS -fno-exceptions -std=c++11 -O3
)
# All compilation uses HPVM_DEFAULT_PASSES
, some can pick from HPVM_OPTIONAL_PASSES
# All compilation uses HPVM_DEFAULT_PASSES
.
set
(
set
(
HPVM_DEFAULT_PASSES
HPVM_DEFAULT_PASSES
LLVMBuildDFG
LLVMBuildDFG
...
@@ -58,13 +58,6 @@ set(
...
@@ -58,13 +58,6 @@ set(
LLVMClearDFG
LLVMClearDFG
LLVMGenHPVM
LLVMGenHPVM
)
)
set
(
HPVM_OPTIONAL_PASSES
LLVMDFG2LLVM_CUDNN
LLVMDFG2LLVM_WrapperAPI
)
# Manually specify dependencies because we're not using cmake "normally"
list
(
APPEND DEPEND clang opt llvm-link hpvm-rt.ll
${
HPVM_DEFAULT_PASSES
}
${
HPVM_OPTIONAL_PASSES
}
)
set
(
WORK_DIR
${
CMAKE_CURRENT_BINARY_DIR
}
)
set
(
WORK_DIR
${
CMAKE_CURRENT_BINARY_DIR
}
)
set
(
test_compile_targets
""
)
set
(
test_compile_targets
""
)
...
@@ -78,34 +71,37 @@ function(compile_single_benchmark target src_file extra_passes extra_dfg_flags)
...
@@ -78,34 +71,37 @@ function(compile_single_benchmark target src_file extra_passes extra_dfg_flags)
)
)
add_custom_command
(
add_custom_command
(
OUTPUT
"
${
WORK_DIR
}
/
${
target
}
.ll"
DEPENDS
${
src_file
}
OUTPUT
"
${
WORK_DIR
}
/
${
target
}
.ll"
DEPENDS
${
src_file
}
clang
COMMAND
${
CMAKE_CXX_COMPILER
}
${
INCLUDE_COMPILER_STRINGS
}
${
CLANG_FLAGS
}
-emit-llvm -S
${
src_file
}
COMMAND
${
CMAKE_CXX_COMPILER
}
${
INCLUDE_COMPILER_STRINGS
}
${
CLANG_FLAGS
}
-emit-llvm -S
${
src_file
}
-o
${
WORK_DIR
}
/
${
target
}
.ll
-o
${
WORK_DIR
}
/
${
target
}
.ll
)
)
add_custom_command
(
add_custom_command
(
OUTPUT
"
${
WORK_DIR
}
/
${
target
}
.hpvm.ll"
DEPENDS
"
${
WORK_DIR
}
/
${
target
}
.ll"
OUTPUT
"
${
WORK_DIR
}
/
${
target
}
.hpvm.ll"
DEPENDS
"
${
WORK_DIR
}
/
${
target
}
.ll"
opt LLVMGenHPVM
COMMAND
${
LLVM_OPT
}
-load LLVMGenHPVM.so -genhpvm -globaldce -S
${
WORK_DIR
}
/
${
target
}
.ll
COMMAND
${
LLVM_OPT
}
-load LLVMGenHPVM.so -genhpvm -globaldce -S
${
WORK_DIR
}
/
${
target
}
.ll
-o
${
WORK_DIR
}
/
${
target
}
.hpvm.ll
-o
${
WORK_DIR
}
/
${
target
}
.hpvm.ll
)
)
add_custom_command
(
add_custom_command
(
OUTPUT
"
${
WORK_DIR
}
/
${
target
}
.llvm.ll"
DEPENDS
"
${
WORK_DIR
}
/
${
target
}
.hpvm.ll"
OUTPUT
"
${
WORK_DIR
}
/
${
target
}
.llvm.ll"
DEPENDS
"
${
WORK_DIR
}
/
${
target
}
.hpvm.ll"
opt
${
HPVM_DEFAULT_PASSES
}
${
extra_passes
}
COMMAND
${
LLVM_OPT
}
${
HPVM_PASSES
}
-S
${
WORK_DIR
}
/
${
target
}
.hpvm.ll
COMMAND
${
LLVM_OPT
}
${
HPVM_PASSES
}
-S
${
WORK_DIR
}
/
${
target
}
.hpvm.ll
-o
${
WORK_DIR
}
/
${
target
}
.llvm.ll
-o
${
WORK_DIR
}
/
${
target
}
.llvm.ll
)
)
add_custom_command
(
add_custom_command
(
OUTPUT
"
${
WORK_DIR
}
/
${
target
}
.linked.bc"
DEPENDS
"
${
WORK_DIR
}
/
${
target
}
.llvm.ll"
OUTPUT
"
${
WORK_DIR
}
/
${
target
}
.linked.bc"
DEPENDS
"
${
WORK_DIR
}
/
${
target
}
.llvm.ll"
hpvm-rt.ll 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
)
)
add_custom_command
(
add_custom_command
(
OUTPUT
"
${
WORK_DIR
}
/
${
target
}
"
DEPENDS
"
${
WORK_DIR
}
/
${
target
}
.linked.bc"
OUTPUT
"
${
WORK_DIR
}
/
${
target
}
"
DEPENDS
"
${
WORK_DIR
}
/
${
target
}
.linked.bc"
tensor_runtime gpu_profiler promise_profiler
COMMAND
${
CMAKE_CXX_COMPILER
}
COMMAND
${
CMAKE_CXX_COMPILER
}
${
WORK_DIR
}
/
${
target
}
.linked.bc
${
WORK_DIR
}
/
${
target
}
.linked.bc
$<TARGET_FILE:tensor_runtime> $<TARGET_FILE:gpu_profiler> $<TARGET_FILE:promise_profiler>
$<TARGET_FILE:tensor_runtime> $<TARGET_FILE:gpu_profiler> $<TARGET_FILE:promise_profiler>
-o
${
WORK_DIR
}
/
${
target
}
${
LINKER_FLAGS
}
-o
${
WORK_DIR
}
/
${
target
}
${
LINKER_FLAGS
}
)
)
add_custom_target
(
${
target
}
DEPENDS
"
${
WORK_DIR
}
/
${
target
}
"
)
add_custom_target
(
${
target
}
DEPENDS
"
${
WORK_DIR
}
/
${
target
}
"
)
add_dependencies
(
${
target
}
${
DEPEND
}
)
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
)
...
...
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