Commit Graph

665 Commits

Author SHA1 Message Date
Eric Fiselier 3b2d0abd2b Use correct integer type for complexity. MSVC warns otherwise 2016-07-22 17:48:37 -06:00
Eric Fiselier 950c8b7440 Fix suprious failures in complexity_test.cc 2016-07-22 17:31:05 -06:00
Eric Fiselier 440df36e7a Improve failure mode in complexity_test.cc 2016-07-22 16:18:34 -06:00
Eric Fiselier 1bd62bd0be Revert "Workaround missing std::this_thread::sleep_for function in tests."
GCC 4.6 doesn't provide std::chrono::steady_clock and GCC 4.7 doesn't provide
std::this_thread::sleep_for. I would prefer to support GCC 4.7 but I'm
reverting this since the bots are GCC 4.6.

This reverts commit c5f454957d.
2016-07-22 15:42:26 -06:00
Eric Fiselier c5f454957d Workaround missing std::this_thread::sleep_for function in tests.
GCC 4.7 doesn't provide std::this_thread::sleep_for on my system.
This patch changes the tests to use a different method for wasting
cycles.
2016-07-22 15:35:26 -06:00
Sven ebd37b191c set cpuinfo_num_cpus on Windows (#254) 2016-07-13 13:00:32 -07:00
Elliott Hughes b805b7c6e0 Add missing `volatile`s to 32-bit ARM cycleclock assembler. (#253)
Without these, clang reorders these instructions as if they were
regular loads/stores which causes SIGILL from the kernel because
it performs all the loads before it starts testing the values.
2016-07-12 12:40:09 -07:00
Eric Fiselier 7e40ff9e35 Provide a better implementation of DoNotOptimize(...).
This implementation is less likely to ICE compilers, and is more correct.
It also acts as a memory barrier which will help prevent writes to global memory
from being optimized away.
2016-07-11 14:58:50 -06:00
Steve Downey 2149577f89 Add export linker flags policy to cmake (#251)
Add policy CMP0056, which honors the link flags in try_compile and
try_run. This allows for building against non-system libc++ by providing
the correct -L and rpath options in a containing project.

For example:

    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L ${LLVM_ROOT}/lib -l c++ -l c++abi")
    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath,${LLVM_ROOT}/lib")
2016-07-06 12:36:56 -07:00
Ismael 885ca41cf8 added check for SetComplexityN (#248) 2016-06-27 11:26:23 -07:00
Ismael a0783fd7f6 fix 244 (#247) 2016-06-27 11:25:43 -07:00
Nick d147797aac Add state.SetComplexityN to docs. (#245)
Add `state.SetComplexityN(state.range_x());` to documentation so that complexity is calculated correctly.
2016-06-27 11:24:13 -07:00
Ryan 1d53e5e0d8 Clarified output formats (#241) 2016-06-20 09:15:09 -07:00
Ismael 3fdd76bd14 fix issue 235 (#236) 2016-06-03 09:33:17 -07:00
Dominic Hamon 2d088a9f2d Merge branch 'ismaelJimenez-added_lambdas' 2016-06-02 14:37:31 -07:00
Dominic Hamon e498143168 fix warning on loss of integer precision 2016-06-02 14:37:14 -07:00
Dominic Hamon 51c23a9115 Merge branch 'added_lambdas' of git://github.com/ismaelJimenez/benchmark into ismaelJimenez-added_lambdas 2016-06-02 14:33:14 -07:00
Ismael 2859ae9394 changed complexity_n to int and fix some whitespaces 2016-06-02 23:27:29 +02:00
Ismael 8ba94b4c18 changed global string to const char * 2016-06-02 22:40:21 +02:00
Ismael 1a633969b3 changed BigO logic order 2016-06-02 22:23:39 +02:00
Ismael 240ba4e64e changed BigOFunc argument from size_t to int 2016-06-02 22:21:52 +02:00
Ismael f964480080 Merge branch 'added_lambdas' of https://github.com/ismaelJimenez/benchmark into added_lambdas 2016-06-02 22:02:17 +02:00
Ismael 22cb9d9ce0 google formated 2016-06-02 22:01:31 +02:00
Ismael 3ef6339971 Update Readme.md 2016-06-02 20:58:14 +02:00
Ismael 109f528a40 removed functional library not needed 2016-06-02 19:48:53 +02:00
Ismael 11e3043554 checked format before pull request 2016-06-02 19:42:08 +02:00
Ismael 212cfe1c2e removed check on automatic fit, to avoid random convergence misfits breaking the build 2016-06-02 19:01:10 +02:00
Ismael 8c73d49b77 fixed reporter_output_test 2016-06-01 23:13:10 +02:00
Ismael 867f9145a0 added lambdas to complexity report 2016-06-01 23:08:01 +02:00
Billy O'Neal 84cd50b85e Add workaround for VS2013 const-incorrect atomic (#230) 2016-05-31 16:54:02 -07:00
Billy O'Neal 3685cad68c Added new noexcept macros for VS2013 (#229) 2016-05-31 14:52:26 -07:00
Eric Fiselier 74a278e206 Fix flaky test 2016-05-30 17:13:41 -06:00
Eric Fiselier 519e8d0e56 Fix missing declaration of FLAGS_color_print 2016-05-30 16:52:24 -06:00
Eric Fiselier 7188824c33 Fix windows build in console_reporter.cc. Fixes #228 2016-05-30 15:33:52 -06:00
Eric Fiselier 02230445e0 Move UnitTime helpers to reporter.h 2016-05-27 16:53:30 -06:00
Eric 1b263fe6d9 Cleanup reporters (#226)
* Move ComputeStats call out of the reporters

* Cleanup adjusted time calculations in reporters

* Move ComputeBigO call out of reporters

* Remove ReportComplexity interface using ReportRuns instead

* Factor out reporting of basic context information

* Attempt to fix GCC 4.6 build errors

* Move ComputeStats to complexity.cc
2016-05-27 16:45:25 -06:00
Eric 238e558fdb Allow benchmarks to take arbitrary arguments. (#221)
* Add lambda benchmarks

* Remove lambda capture since the lambda is not at a block scope

* Remove LambdaBenchmark helper since FunctionBenchmark can be used with non-capturing lambas

* Add lambda benchmarks

* Remove lambda capture since the lambda is not at a block scope

* Remove LambdaBenchmark helper since FunctionBenchmark can be used with non-capturing lambas

* Add more docs for BENCHMARK_CAPTURE.

* Fix use of misnamed parameter

* Guard BENCHMARK_CAPTURE tests against non-c++11 compilers

* Move tests out of basic_test.cc
2016-05-27 12:37:10 -07:00
Eric 5686bf1b38 Change reporters to use a specified output and error stream. Add tests for output. (#219)
* Add test for reporter output.

* setup err_stream tests

* Fix warnings in tests

* whitespace

* Fix build errors caused by super pedantic compilers

* Pass streams by pointer not non-const reference
2016-05-27 12:34:37 -07:00
Dominic Hamon 3f7a9c76fb Merge branch 'ismaelJimenez-update_complexity' 2016-05-26 14:02:58 -07:00
Dominic Hamon d6bc7e1581 Merge branch 'update_complexity' of git://github.com/ismaelJimenez/benchmark into ismaelJimenez-update_complexity 2016-05-26 14:01:28 -07:00
Ismael c1c7d33279 added benchmar_apit to complexity.cc 2016-05-26 22:39:17 +02:00
Ismael 805e8baee9 small refactor 2016-05-26 21:26:43 +02:00
Ismael ac3ec2ded3 moved complexity.h into src and BigO enum into benchmark_api 2016-05-26 21:16:40 +02:00
Ismael d82f0c3131 added includes 2016-05-26 20:57:27 +02:00
Ismael 37ab858e4b initialized doubles to 0.0 2016-05-26 19:44:11 +02:00
Eric 3ff8a6ecc8 Merge pull request #224 from zabereer/donotoptimize_with_test_merged
Force DoNotOptimize operand to memory for both gcc and clang
2016-05-26 00:53:38 -06:00
Albert Pretorius 74e82e822f Force DoNotOptimize operand to memory for both gcc and clang 2016-05-26 07:43:07 +01:00
Dominic Hamon a38f022b5a Merge branch 'efcs-skip_with_error' 2016-05-25 15:35:17 -07:00
Dominic Hamon 5e51e439a8 Merge branch 'skip_with_error' of git://github.com/efcs/benchmark into efcs-skip_with_error 2016-05-25 15:35:04 -07:00
Ismael 1715885611 fixed typos 2016-05-25 23:33:25 +02:00