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
b3060309
Commit
b3060309
authored
Jul 27, 2014
by
Dominic Hamon
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'mac' of
git://github.com/eddyxu/benchmark
into eddyxu-mac
parents
2d835a0c
3460bf1a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
6 deletions
+9
-6
CMakeLists.txt
CMakeLists.txt
+1
-0
benchmark.cc
src/benchmark.cc
+6
-5
sysinfo.cc
src/sysinfo.cc
+2
-1
No files found.
CMakeLists.txt
View file @
b3060309
...
...
@@ -9,6 +9,7 @@ set_directory_properties(properties EP_PREFIX "${CMAKE_BINARY_DIR}/third_party")
ExternalProject_Add
(
googletest
URL
"https://googletest.googlecode.com/files/gtest-1.7.0.zip"
SOURCE_DIR
"
${
CMAKE_BINARY_DIR
}
/third_party/gtest"
CMAKE_ARGS
"-DCMAKE_CXX_COMPILER=
${
CMAKE_CXX_COMPILER
}
"
INSTALL_COMMAND
""
)
ExternalProject_Get_Property
(
googletest source_dir
)
include_directories
(
${
source_dir
}
/include
)
...
...
src/benchmark.cc
View file @
b3060309
...
...
@@ -390,19 +390,20 @@ void BenchmarkFamilies::FindBenchmarks(
if
(
family
->
rangeX_
.
empty
()
&&
family
->
rangeY_
.
empty
())
{
instances
=
family
->
CreateBenchmarkInstances
(
Benchmark
::
kNoRange
,
Benchmark
::
kNoRange
);
benchmarks
->
insert
(
benchmarks
->
end
(),
instances
.
begin
(),
instances
.
end
());
std
::
copy
(
instances
.
begin
(),
instances
.
end
(),
std
::
back_inserter
(
*
benchmarks
));
}
else
if
(
family
->
rangeY_
.
empty
())
{
for
(
size_t
x
=
0
;
x
<
family
->
rangeX_
.
size
();
++
x
)
{
instances
=
family
->
CreateBenchmarkInstances
(
x
,
Benchmark
::
kNoRange
);
benchmarks
->
insert
(
benchmarks
->
end
(),
instances
.
begin
(),
instances
.
end
(
));
std
::
copy
(
instances
.
begin
(),
instances
.
end
(),
std
::
back_inserter
(
*
benchmarks
));
}
}
else
{
for
(
size_t
x
=
0
;
x
<
family
->
rangeX_
.
size
();
++
x
)
{
for
(
size_t
y
=
0
;
y
<
family
->
rangeY_
.
size
();
++
y
)
{
instances
=
family
->
CreateBenchmarkInstances
(
x
,
y
);
benchmarks
->
insert
(
benchmarks
->
end
(),
instances
.
begin
(),
instances
.
end
(
));
std
::
copy
(
instances
.
begin
(),
instances
.
end
(),
std
::
back_inserter
(
*
benchmarks
));
}
}
}
...
...
src/sysinfo.cc
View file @
b3060309
...
...
@@ -36,13 +36,14 @@
namespace
benchmark
{
namespace
{
const
int64_t
estimate_time_ms
=
1000
;
pthread_once_t
cpuinfo_init
=
PTHREAD_ONCE_INIT
;
double
cpuinfo_cycles_per_second
=
1.0
;
int
cpuinfo_num_cpus
=
1
;
// Conservative guess
pthread_mutex_t
cputimens_mutex
;
#if !defined OS_MACOSX
const
int64_t
estimate_time_ms
=
1000
;
// Helper function estimates cycles/sec by observing cycles elapsed during
// sleep(). Using small sleep time decreases accuracy significantly.
int64_t
EstimateCyclesPerSecond
()
{
...
...
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