Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
multiint-benchmark.cc File Reference
#include <iomanip>
#include <iostream>
#include <sstream>
#include "util/benchmark.h"
#include "util/cpu-info.h"
#include "runtime/multi-precision.h"
#include "common/names.h"
Include dependency graph for multiint-benchmark.cc:

Go to the source code of this file.

Classes

struct  BaseInt128< BASE >
 
struct  int96
 
struct  TestData< Decimal >
 

Macros

#define TEST_ADD(NAME, RESULT, VALS)
 
#define TEST_MULTIPLY(NAME, RESULT, VALS)
 
#define TEST_DIVIDE(NAME, RESULT, VALS)
 

Typedefs

typedef BaseInt128< 1000000000 > Base1BInt128
 

Functions

void InitTestData (TestData *data, int n)
 
 TEST_ADD (TestBoostAdd, boost_result, boost_add_ints)
 
 TEST_ADD (TestCppAdd, cpp_result, cpp_add_ints)
 
 TEST_ADD (TestCpp96Add, cpp96_result, cpp96_add_ints)
 
 TEST_ADD (TestBaseBillionAdd, base1b_result, base1b_ints)
 
 TEST_ADD (TestInt64Add, int64_result, int64_ints)
 
 TEST_ADD (TestDoubleAdd, double_result, doubles)
 
 TEST_MULTIPLY (TestBoostMultiply, boost_result, boost_mult_ints)
 
 TEST_MULTIPLY (TestCppMultiply, cpp_result, cpp_mult_ints)
 
 TEST_MULTIPLY (TestCpp96Multiply, cpp96_result, cpp96_mult_ints)
 
 TEST_MULTIPLY (TestInt64Multiply, int64_result, int64_ints)
 
 TEST_MULTIPLY (TestDoubleMultiply, double_result, doubles)
 
 TEST_DIVIDE (TestBoostDivide, boost_result, boost_mult_ints)
 
 TEST_DIVIDE (TestCppDivide, cpp_result, cpp_mult_ints)
 
 TEST_DIVIDE (TestCpp96Divide, cpp96_result, cpp96_mult_ints)
 
 TEST_DIVIDE (TestInt64Divide, int64_result, int64_ints)
 
 TEST_DIVIDE (TestDoubleDivide, double_result, doubles)
 
int main (int argc, char **argv)
 

Macro Definition Documentation

#define TEST_ADD (   NAME,
  RESULT,
  VALS 
)
Value:
void NAME(int batch_size, void* d) {\
TestData* data = reinterpret_cast<TestData*>(d);\
for (int i = 0; i < batch_size; ++i) {\
data->RESULT = 0;\
for (int j = 0; j < data->VALS.size(); ++j) {\
data->RESULT += data->VALS[j];\
}\
}\
}

Definition at line 216 of file multiint-benchmark.cc.

#define TEST_DIVIDE (   NAME,
  RESULT,
  VALS 
)
Value:
void NAME(int batch_size, void* d) {\
TestData* data = reinterpret_cast<TestData*>(d);\
for (int i = 0; i < batch_size; ++i) {\
data->RESULT = 0;\
for (int j = 0; j < data->VALS.size() - 1; ++j) {\
data->RESULT += data->VALS[j + 1] / data->VALS[j];\
}\
}\
}

Definition at line 238 of file multiint-benchmark.cc.

#define TEST_MULTIPLY (   NAME,
  RESULT,
  VALS 
)
Value:
void NAME(int batch_size, void* d) {\
TestData* data = reinterpret_cast<TestData*>(d);\
for (int i = 0; i < batch_size; ++i) {\
data->RESULT = 1;\
for (int j = 0; j < data->VALS.size(); ++j) {\
data->RESULT *= data->VALS[j];\
}\
}\
}

Definition at line 227 of file multiint-benchmark.cc.

Typedef Documentation

typedef BaseInt128<1000000000> Base1BInt128

Definition at line 158 of file multiint-benchmark.cc.

Function Documentation

TEST_ADD ( TestBoostAdd  ,
boost_result  ,
boost_add_ints   
)
TEST_ADD ( TestCppAdd  ,
cpp_result  ,
cpp_add_ints   
)
TEST_ADD ( TestCpp96Add  ,
cpp96_result  ,
cpp96_add_ints   
)
TEST_ADD ( TestBaseBillionAdd  ,
base1b_result  ,
base1b_ints   
)
TEST_ADD ( TestInt64Add  ,
int64_result  ,
int64_ints   
)
TEST_ADD ( TestDoubleAdd  ,
double_result  ,
doubles   
)
TEST_DIVIDE ( TestBoostDivide  ,
boost_result  ,
boost_mult_ints   
)
TEST_DIVIDE ( TestCppDivide  ,
cpp_result  ,
cpp_mult_ints   
)
TEST_DIVIDE ( TestCpp96Divide  ,
cpp96_result  ,
cpp96_mult_ints   
)
TEST_DIVIDE ( TestInt64Divide  ,
int64_result  ,
int64_ints   
)
TEST_DIVIDE ( TestDoubleDivide  ,
double_result  ,
doubles   
)
TEST_MULTIPLY ( TestBoostMultiply  ,
boost_result  ,
boost_mult_ints   
)
TEST_MULTIPLY ( TestCppMultiply  ,
cpp_result  ,
cpp_mult_ints   
)
TEST_MULTIPLY ( TestCpp96Multiply  ,
cpp96_result  ,
cpp96_mult_ints   
)
TEST_MULTIPLY ( TestInt64Multiply  ,
int64_result  ,
int64_ints   
)
TEST_MULTIPLY ( TestDoubleMultiply  ,
double_result  ,
doubles   
)