Git Product home page Git Product logo

taskbench's Introduction

cpp20 CMake39

Linux (clang) Linux (gcc)

MacOS

Windows (Visual Studio) Windows (Cygwin) Windows (MinGW) Windows (MSYS2)

Thread Sanitizer Address Sanitizer

Code Style

taskbench

A C++ Library implementing different common tasks for benchmarking purposes

Build

Taskbenchs desired build system is CMake. This has several reasons but the most important is the convenience that all used external libraries build using CMake. Thus, all dependencies are included into this repository and build together with taskbench.

Requirements

  • A C++ compiler supporting C++20 features (including concepts):
    • g++>=10
    • clang>=10
    • msvc>=16.3
  • CMake (Version 3.9)
  • OpenCL (Your GPU drivers already provide OpenCL. Only install OpenCL if you have no external GPU.)

Dependencies

taskbench depends on the following libraries:

All these dependencies are included into this repository. No need to install anything!

Build

git submodule update --init --recursive
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release

This builds all target libraries as shared and static libraries.

Include taskbench to your CMake project

  1. Add taskbench to your project. Choose one of these options:
    1. Clone it from GitHub into external/taskbench: git clone https://github.com/lfreist/taskbench.git
    2. Include it as submodule (preferred): git submodule add https://github.com/lfreist/taskbench.git external/taskbench
  2. Add the following to your projects root CMakeLists.txt:
    # Your setup ...
    include_directories(external/taskbench/include)
    add_subdirectory(external/taskbench)
    # ...
  3. Include taskbench to your source files:
    // main.cpp
    
    #include <taskbench/taskbench.h>
    
    int main(int argc, char** argv) {
      // run all CPU benchmarks
      taskbench::cpu::Benchmark cpu_benchmark;
      cpu_benchmark.run_all(taskbench::seconds(3));
      return 0;
    }
  4. Link against taskbench or taskbench_static:
    # ...
    add_executable(main main.cpp)
    target_link_libraries(main taskbench::taskbench_static)

Run BlitzBench

Taskbench provides a command line tool BlitzBench that runs the implemented benchmark tasks and prints out the results. BlitzBench is built together with the library as described above.

./build/taskbench/BlitzBench # Linux/MacOS
.\build\taskbench\BlitzBench # Windows

Example Output

RAM Benchmarks:
    read                 (0.018 +/- 0.001) s [59.91 GiB/s]
    write                (0.017 +/- 0.001) s [66.17 GiB/s]
    read/write           (0.020 +/- 0.003) s [67.54 GiB/s]
CPU Benchmarks:
  AES Benchmarks:
    AES encryption       (1.330 +/- 0.005) s 
    AES decryption       (1.417 +/- 0.001) s 
  ZStandard Benchmarks:
    ZSTD compression     (0.874 +/- 0.001) s 
    ZSTD decompression   (0.769 +/- 0.000) s 
  FFT Benchmarks:
    FFT                  (0.722 +/- 0.006) s 
    Inverse FFT          (0.762 +/- 0.003) s 
  Matrix Multiplication Benchmarks:
    mmul (int)           (1.407 +/- 0.001) s [1.53 G op/s]
    mmul (double)        (1.653 +/- 0.004) s [1.30 G op/s]
  Sort Benchmarks:
    sort (int)           (2.057 +/- 0.001) s 
    sort (double)        (2.371 +/- 0.001) s 
    sort (string)        (1.188 +/- 0.000) s 
  Synthetic Benchmarks:
    add/sub (int)        (1.264 +/- 0.009) s [3.18 G op/s]
    mul (int)            (1.901 +/- 0.000) s [2.10 G op/s]
    div (int)            (1.096 +/- 0.000) s [365.23 M op/s]
    add/sub (double)     (1.567 +/- 0.000) s [2.55 G op/s]
    mul (double)         (3.216 +/- 0.000) s [1.24 G op/s]
    div (int)            (0.901 +/- 0.169) s [530.09 M op/s]
GPU Benchmarks:
  Matrix Multiplication Benchmarks:
    mmul                 (1.471 +/- 0.009) s [11.75 G op/s]
  Synthetic Benchmarks:
    integer ops          (0.982 +/- 0.076) s [596.29 G op/s]
    float ops            (0.328 +/- 0.002) s [1.69 T op/s]
  Memory Benchmarks:
    memory write         (0.020 +/- 0.000) s [51.35 GiB/s]
    memory read          (0.016 +/- 0.000) s [61.86 GiB/s]
  Transfer Benchmarks:
    write to device      (0.074 +/- 0.000) s [13.51 GiB/s]
    read from device     (0.074 +/- 0.000) s [13.50 GiB/s]

taskbench's People

Contributors

lfreist avatar

Stargazers

 avatar

Watchers

 avatar  avatar

taskbench's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.