Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
benchmark
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
benchmark
Commits
b7d03ac4
Commit
b7d03ac4
authored
Mar 18, 2015
by
Eric Fiselier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add BENCHMARK_TEMPLATE1 macro
parent
92fc9b99
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
benchmark_api.h
include/benchmark/benchmark_api.h
+11
-1
No files found.
include/benchmark/benchmark_api.h
View file @
b7d03ac4
...
@@ -445,7 +445,7 @@ class Benchmark {
...
@@ -445,7 +445,7 @@ class Benchmark {
// BENCHMARK_TEMPLATE(BM_Foo, 1);
// BENCHMARK_TEMPLATE(BM_Foo, 1);
//
//
// will register BM_Foo<1> as a benchmark.
// will register BM_Foo<1> as a benchmark.
#
define BENCHMARK_TEMPLATE(n, a)
\
#
define BENCHMARK_TEMPLATE1(n, a)
\
static ::benchmark::internal::Benchmark* BENCHMARK_CONCAT( \
static ::benchmark::internal::Benchmark* BENCHMARK_CONCAT( \
__benchmark_, n, __LINE__) BENCHMARK_UNUSED = \
__benchmark_, n, __LINE__) BENCHMARK_UNUSED = \
(new ::benchmark::internal::Benchmark(#n "<" #a ">", n<a>))
(new ::benchmark::internal::Benchmark(#n "<" #a ">", n<a>))
...
@@ -455,6 +455,16 @@ class Benchmark {
...
@@ -455,6 +455,16 @@ class Benchmark {
__benchmark_, n, __LINE__) BENCHMARK_UNUSED = \
__benchmark_, n, __LINE__) BENCHMARK_UNUSED = \
(new ::benchmark::internal::Benchmark(#n "<" #a "," #b ">", n<a, b>))
(new ::benchmark::internal::Benchmark(#n "<" #a "," #b ">", n<a, b>))
#if __cplusplus >= 201103L
#define BENCHMARK_TEMPLATE(n, ...) \
static ::benchmark::internal::Benchmark* BENCHMARK_CONCAT( \
_benchmark_, n, __LINE__) BENCHMARK_UNUSED = \
(new ::benchmark::internal::Benchmark( \
#n "<" #__VA_ARGS__ ">", n< __VA_ARGS__ > ))
#else
#define BENCHMARK_TEMPLATE(n, a) BENCHMARK_TEMPLATE1(n, a)
#endif
// Helper macro to create a main routine in a test that runs the benchmarks
// Helper macro to create a main routine in a test that runs the benchmarks
#define BENCHMARK_MAIN() \
#define BENCHMARK_MAIN() \
int main(int argc, const char** argv) { \
int main(int argc, const char** argv) { \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment