Skip to content

Commit db44326

Browse files
chore(google_benchmark): import google benchmark "fork"
1 parent 7c9f01e commit db44326

File tree

175 files changed

+26660
-121
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

175 files changed

+26660
-121
lines changed

.gitignore

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,9 @@
1-
# Prerequisites
2-
*.d
3-
4-
# Compiled Object files
5-
*.slo
6-
*.lo
7-
*.o
8-
*.obj
9-
10-
# Precompiled Headers
11-
*.gch
12-
*.pch
13-
14-
# Compiled Dynamic libraries
15-
*.so
16-
*.dylib
17-
*.dll
18-
19-
# Fortran module files
20-
*.mod
21-
*.smod
22-
23-
# Compiled Static libraries
24-
*.lai
25-
*.la
26-
*.a
27-
*.lib
28-
291
# Executables
302
*.exe
313
*.out
324
*.app
335

34-
build/
6+
build/
7+
8+
# Clangd cache
9+
.cache/

google_benchmark/.clang-format

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
Language: Cpp
3+
BasedOnStyle: Google
4+
PointerAlignment: Left
5+
...

google_benchmark/.clang-tidy

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
Checks: >
3+
abseil-*,
4+
bugprone-*,
5+
clang-analyzer-*,
6+
cppcoreguidelines-*,
7+
google-*,
8+
misc-*,
9+
performance-*,
10+
readability-*,
11+
-clang-analyzer-deadcode*,
12+
-clang-analyzer-optin*,
13+
-readability-identifier-length
14+
WarningsAsErrors: ''
15+
HeaderFilterRegex: ''
16+
FormatStyle: none
17+
CheckOptions:
18+
llvm-else-after-return.WarnOnConditionVariables: 'false'
19+
modernize-loop-convert.MinConfidence: reasonable
20+
modernize-replace-auto-ptr.IncludeStyle: llvm
21+
cert-str34-c.DiagnoseSignedUnsignedCharComparisons: 'false'
22+
google-readability-namespace-comments.ShortNamespaceLines: '10'
23+
cert-err33-c.CheckedFunctions: '::aligned_alloc;::asctime_s;::at_quick_exit;::atexit;::bsearch;::bsearch_s;::btowc;::c16rtomb;::c32rtomb;::calloc;::clock;::cnd_broadcast;::cnd_init;::cnd_signal;::cnd_timedwait;::cnd_wait;::ctime_s;::fclose;::fflush;::fgetc;::fgetpos;::fgets;::fgetwc;::fopen;::fopen_s;::fprintf;::fprintf_s;::fputc;::fputs;::fputwc;::fputws;::fread;::freopen;::freopen_s;::fscanf;::fscanf_s;::fseek;::fsetpos;::ftell;::fwprintf;::fwprintf_s;::fwrite;::fwscanf;::fwscanf_s;::getc;::getchar;::getenv;::getenv_s;::gets_s;::getwc;::getwchar;::gmtime;::gmtime_s;::localtime;::localtime_s;::malloc;::mbrtoc16;::mbrtoc32;::mbsrtowcs;::mbsrtowcs_s;::mbstowcs;::mbstowcs_s;::memchr;::mktime;::mtx_init;::mtx_lock;::mtx_timedlock;::mtx_trylock;::mtx_unlock;::printf_s;::putc;::putwc;::raise;::realloc;::remove;::rename;::scanf;::scanf_s;::setlocale;::setvbuf;::signal;::snprintf;::snprintf_s;::sprintf;::sprintf_s;::sscanf;::sscanf_s;::strchr;::strerror_s;::strftime;::strpbrk;::strrchr;::strstr;::strtod;::strtof;::strtoimax;::strtok;::strtok_s;::strtol;::strtold;::strtoll;::strtoul;::strtoull;::strtoumax;::strxfrm;::swprintf;::swprintf_s;::swscanf;::swscanf_s;::thrd_create;::thrd_detach;::thrd_join;::thrd_sleep;::time;::timespec_get;::tmpfile;::tmpfile_s;::tmpnam;::tmpnam_s;::tss_create;::tss_get;::tss_set;::ungetc;::ungetwc;::vfprintf;::vfprintf_s;::vfscanf;::vfscanf_s;::vfwprintf;::vfwprintf_s;::vfwscanf;::vfwscanf_s;::vprintf_s;::vscanf;::vscanf_s;::vsnprintf;::vsnprintf_s;::vsprintf;::vsprintf_s;::vsscanf;::vsscanf_s;::vswprintf;::vswprintf_s;::vswscanf;::vswscanf_s;::vwprintf_s;::vwscanf;::vwscanf_s;::wcrtomb;::wcschr;::wcsftime;::wcspbrk;::wcsrchr;::wcsrtombs;::wcsrtombs_s;::wcsstr;::wcstod;::wcstof;::wcstoimax;::wcstok;::wcstok_s;::wcstol;::wcstold;::wcstoll;::wcstombs;::wcstombs_s;::wcstoul;::wcstoull;::wcstoumax;::wcsxfrm;::wctob;::wctrans;::wctype;::wmemchr;::wprintf_s;::wscanf;::wscanf_s;'
24+
cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField: 'false'
25+
cert-dcl16-c.NewSuffixes: 'L;LL;LU;LLU'
26+
google-readability-braces-around-statements.ShortStatementLines: '1'
27+
cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic: 'true'
28+
google-readability-namespace-comments.SpacesBeforeComments: '2'
29+
modernize-loop-convert.MaxCopySize: '16'
30+
modernize-pass-by-value.IncludeStyle: llvm
31+
modernize-use-nullptr.NullMacros: 'NULL'
32+
llvm-qualified-auto.AddConstToQualified: 'false'
33+
modernize-loop-convert.NamingStyle: CamelCase
34+
llvm-else-after-return.WarnOnUnfixable: 'false'
35+
google-readability-function-size.StatementThreshold: '800'
36+
...
37+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.*third_party/.*

google_benchmark/.gitignore

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
*.a
2+
*.so
3+
*.so.?*
4+
*.dll
5+
*.exe
6+
*.dylib
7+
*.cmake
8+
!/cmake/*.cmake
9+
!/test/AssemblyTests.cmake
10+
*~
11+
*.swp
12+
*.pyc
13+
__pycache__
14+
.DS_Store
15+
16+
# lcov
17+
*.lcov
18+
/lcov
19+
20+
# cmake files.
21+
/Testing
22+
CMakeCache.txt
23+
CMakeFiles/
24+
cmake_install.cmake
25+
26+
# makefiles.
27+
Makefile
28+
29+
# in-source build.
30+
bin/
31+
lib/
32+
/test/*_test
33+
34+
# exuberant ctags.
35+
tags
36+
37+
# YouCompleteMe configuration.
38+
.ycm_extra_conf.pyc
39+
40+
# ninja generated files.
41+
.ninja_deps
42+
.ninja_log
43+
build.ninja
44+
install_manifest.txt
45+
rules.ninja
46+
47+
# bazel output symlinks.
48+
bazel-*
49+
MODULE.bazel.lock
50+
51+
# out-of-source build top-level folders.
52+
build/
53+
_build/
54+
build*/
55+
56+
# in-source dependencies
57+
/googletest/
58+
59+
# Visual Studio 2015/2017 cache/options directory
60+
.vs/
61+
CMakeSettings.json
62+
63+
# Visual Studio Code cache/options directory
64+
.vscode/
65+
66+
# Python build stuff
67+
dist/
68+
*.egg-info*
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
import os
2+
3+
import ycm_core
4+
5+
# These are the compilation flags that will be used in case there's no
6+
# compilation database set (by default, one is not set).
7+
# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR.
8+
flags = [
9+
"-Wall",
10+
"-Werror",
11+
"-pedantic-errors",
12+
"-std=c++0x",
13+
"-fno-strict-aliasing",
14+
"-O3",
15+
"-DNDEBUG",
16+
# ...and the same thing goes for the magic -x option which specifies the
17+
# language that the files to be compiled are written in. This is mostly
18+
# relevant for c++ headers.
19+
# For a C project, you would set this to 'c' instead of 'c++'.
20+
"-x",
21+
"c++",
22+
"-I",
23+
"include",
24+
"-isystem",
25+
"/usr/include",
26+
"-isystem",
27+
"/usr/local/include",
28+
]
29+
30+
31+
# Set this to the absolute path to the folder (NOT the file!) containing the
32+
# compile_commands.json file to use that instead of 'flags'. See here for
33+
# more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html
34+
#
35+
# Most projects will NOT need to set this to anything; you can just change the
36+
# 'flags' list of compilation flags. Notice that YCM itself uses that approach.
37+
compilation_database_folder = ""
38+
39+
if os.path.exists(compilation_database_folder):
40+
database = ycm_core.CompilationDatabase(compilation_database_folder)
41+
else:
42+
database = None
43+
44+
SOURCE_EXTENSIONS = [".cc"]
45+
46+
47+
def DirectoryOfThisScript():
48+
return os.path.dirname(os.path.abspath(__file__))
49+
50+
51+
def MakeRelativePathsInFlagsAbsolute(flags, working_directory):
52+
if not working_directory:
53+
return list(flags)
54+
new_flags = []
55+
make_next_absolute = False
56+
path_flags = ["-isystem", "-I", "-iquote", "--sysroot="]
57+
for flag in flags:
58+
new_flag = flag
59+
60+
if make_next_absolute:
61+
make_next_absolute = False
62+
if not flag.startswith("/"):
63+
new_flag = os.path.join(working_directory, flag)
64+
65+
for path_flag in path_flags:
66+
if flag == path_flag:
67+
make_next_absolute = True
68+
break
69+
70+
if flag.startswith(path_flag):
71+
path = flag[len(path_flag) :]
72+
new_flag = path_flag + os.path.join(working_directory, path)
73+
break
74+
75+
if new_flag:
76+
new_flags.append(new_flag)
77+
return new_flags
78+
79+
80+
def IsHeaderFile(filename):
81+
extension = os.path.splitext(filename)[1]
82+
return extension in [".h", ".hxx", ".hpp", ".hh"]
83+
84+
85+
def GetCompilationInfoForFile(filename):
86+
# The compilation_commands.json file generated by CMake does not have
87+
# entries for header files. So we do our best by asking the db for flags for
88+
# a corresponding source file, if any. If one exists, the flags for that
89+
# file should be good enough.
90+
if IsHeaderFile(filename):
91+
basename = os.path.splitext(filename)[0]
92+
for extension in SOURCE_EXTENSIONS:
93+
replacement_file = basename + extension
94+
if os.path.exists(replacement_file):
95+
compilation_info = database.GetCompilationInfoForFile(
96+
replacement_file
97+
)
98+
if compilation_info.compiler_flags_:
99+
return compilation_info
100+
return None
101+
return database.GetCompilationInfoForFile(filename)
102+
103+
104+
def FlagsForFile(filename, **kwargs):
105+
if database:
106+
# Bear in mind that compilation_info.compiler_flags_ does NOT return a
107+
# python list, but a "list-like" StringVec object
108+
compilation_info = GetCompilationInfoForFile(filename)
109+
if not compilation_info:
110+
return None
111+
112+
final_flags = MakeRelativePathsInFlagsAbsolute(
113+
compilation_info.compiler_flags_,
114+
compilation_info.compiler_working_dir_,
115+
)
116+
else:
117+
relative_to = DirectoryOfThisScript()
118+
final_flags = MakeRelativePathsInFlagsAbsolute(flags, relative_to)
119+
120+
return {"flags": final_flags, "do_cache": True}

google_benchmark/AUTHORS

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# This is the official list of benchmark authors for copyright purposes.
2+
# This file is distinct from the CONTRIBUTORS files.
3+
# See the latter for an explanation.
4+
#
5+
# Names should be added to this file as:
6+
# Name or Organization <email address>
7+
# The email address is not required for organizations.
8+
#
9+
# Please keep the list sorted.
10+
11+
Albert Pretorius <[email protected]>
12+
Alex Steele <[email protected]>
13+
Andriy Berestovskyy <[email protected]>
14+
Arne Beer <[email protected]>
15+
Carto
16+
Cezary Skrzyński <[email protected]>
17+
Christian Wassermann <[email protected]>
18+
Christopher Seymour <[email protected]>
19+
Colin Braley <[email protected]>
20+
Daniel Harvey <[email protected]>
21+
David Coeurjolly <[email protected]>
22+
Deniz Evrenci <[email protected]>
23+
Dirac Research
24+
Dominik Czarnota <[email protected]>
25+
Dominik Korman <[email protected]>
26+
Donald Aingworth <[email protected]>
27+
Eric Backus <[email protected]>
28+
Eric Fiselier <[email protected]>
29+
Eugene Zhuk <[email protected]>
30+
Evgeny Safronov <[email protected]>
31+
Fabien Pichot <[email protected]>
32+
Federico Ficarelli <[email protected]>
33+
Felix Homann <[email protected]>
34+
Gergely Meszaros <[email protected]>
35+
Gergő Szitár <[email protected]>
36+
Google Inc.
37+
Henrique Bucher <[email protected]>
38+
International Business Machines Corporation
39+
Ismael Jimenez Martinez <[email protected]>
40+
Jern-Kuan Leong <[email protected]>
41+
JianXiong Zhou <[email protected]>
42+
Joao Paulo Magalhaes <[email protected]>
43+
Jordan Williams <[email protected]>
44+
Jussi Knuuttila <[email protected]>
45+
Kaito Udagawa <[email protected]>
46+
Kishan Kumar <[email protected]>
47+
48+
Marcel Jacobse <[email protected]>
49+
Matt Clarkson <[email protected]>
50+
Maxim Vafin <[email protected]>
51+
Mike Apodaca <[email protected]>
52+
Min-Yih Hsu <[email protected]>
53+
MongoDB Inc.
54+
Nick Hutchinson <[email protected]>
55+
Norman Heino <[email protected]>
56+
Oleksandr Sochka <[email protected]>
57+
Ori Livneh <[email protected]>
58+
Paul Redmond <[email protected]>
59+
Radoslav Yovchev <[email protected]>
60+
Raghu Raja <[email protected]>
61+
Rainer Orth <[email protected]>
62+
Roman Lebedev <[email protected]>
63+
Sayan Bhattacharjee <[email protected]>
64+
65+
Shuo Chen <[email protected]>
66+
Staffan Tjernstrom <[email protected]>
67+
Steinar H. Gunderson <[email protected]>
68+
Stripe, Inc.
69+
Tobias Schmidt <[email protected]>
70+
Yixuan Qiu <[email protected]>
71+
Yusuke Suzuki <[email protected]>
72+
Zbigniew Skowron <[email protected]>

0 commit comments

Comments
 (0)