module numbers.cbenchmark_dot
¶
Short summary¶
module cpyquickhelper.numbers.cbenchmark_dot
Measures the execution time of functions implemented in C, the measures are also implemented in C. The functions propose different implementations of the dot product.
Documentation¶
Measures the execution time of functions implemented in C, the measures are also implemented in C. The functions propose different implementations of the dot product.
- cpyquickhelper.numbers.cbenchmark_dot.empty_vector_dot_product(arg0: numpy.ndarray[numpy.float32], arg1: numpy.ndarray[numpy.float32]) float ¶
Empty measure to have an idea about the processing due to python binding.
- cpyquickhelper.numbers.cbenchmark_dot.measure_scenario_A(values: List[float], th: float, repeat: int = 100, number: int = 10, verbose: bool = False) ExecutionStat ¶
Measure C++ implementation. Loop on
if (values[i] >= th) ++nb;
- cpyquickhelper.numbers.cbenchmark_dot.measure_scenario_B(values: List[float], th: float, repeat: int = 100, number: int = 10, verbose: bool = False) ExecutionStat ¶
Measure C++ implementation. Loop on
if (*it >= th) ++nb;
- cpyquickhelper.numbers.cbenchmark_dot.measure_scenario_C(values: List[float], th: float, repeat: int = 100, number: int = 10, verbose: bool = False) ExecutionStat ¶
Measure C++ implementation. Loop on
if (*it >= th) nb++;
- cpyquickhelper.numbers.cbenchmark_dot.measure_scenario_D(values: List[float], th: float, repeat: int = 100, number: int = 10, verbose: bool = False) ExecutionStat ¶
Measure C++ implementation. Loop on
nb += *it >= th ? 1 : 0;
- cpyquickhelper.numbers.cbenchmark_dot.measure_scenario_E(values: List[float], th: float, repeat: int = 100, number: int = 10, verbose: bool = False) ExecutionStat ¶
Measure C++ implementation. Loop on
if (*it >= th) nb += 1;
- cpyquickhelper.numbers.cbenchmark_dot.measure_scenario_F(values: List[float], th: float, repeat: int = 100, number: int = 10, verbose: bool = False) ExecutionStat ¶
Measure C++ implementation. Loop on
nb += (*it - th) >= 0 ? 1 : 0;
- cpyquickhelper.numbers.cbenchmark_dot.measure_scenario_G(values: List[float], th: float, repeat: int = 100, number: int = 10, verbose: bool = False) ExecutionStat ¶
Measure C++ implementation. Loop on
nb += (*it - th) < 0 ? 1 : 0;
- cpyquickhelper.numbers.cbenchmark_dot.measure_scenario_H(values: List[float], th: float, repeat: int = 100, number: int = 10, verbose: bool = False) ExecutionStat ¶
Measure C++ implementation. Loop on
nb += *it < th ? 1 : 0;
- cpyquickhelper.numbers.cbenchmark_dot.measure_scenario_I(values: List[float], th: float, repeat: int = 100, number: int = 10, verbose: bool = False) ExecutionStat ¶
Measure C++ implementation. Loop on
nb += 1 ^ ((unsigned int)(*it) >> (sizeof(int) * CHAR_BIT - 1));
- cpyquickhelper.numbers.cbenchmark_dot.measure_scenario_J(values: List[float], th: float, repeat: int = 100, number: int = 10, verbose: bool = False) ExecutionStat ¶
Measure C++ implementation. Loop on
nb += values[i] >= th ? 1 : 0;
- cpyquickhelper.numbers.cbenchmark_dot.measure_scenario_Sleep(values: List[float], th: float, repeat: int = 100, number: int = 10, verbose: bool = False) ExecutionStat ¶
Measure C++ implementation. Loop on
sleep
- cpyquickhelper.numbers.cbenchmark_dot.vector_dot_product(arg0: numpy.ndarray[numpy.float32], arg1: numpy.ndarray[numpy.float32]) float ¶
Computes a dot product in C++ with vectors of floats.
- cpyquickhelper.numbers.cbenchmark_dot.vector_dot_product16(arg0: numpy.ndarray[numpy.float32], arg1: numpy.ndarray[numpy.float32]) float ¶
Computes a dot product in C++ with vectors of floats. Goes 16 by 16.
- cpyquickhelper.numbers.cbenchmark_dot.vector_dot_product16_avx512(arg0: numpy.ndarray[numpy.float32], arg1: numpy.ndarray[numpy.float32]) float ¶
Computes a dot product in C++ with vectors of floats. Goes 16 by 16. Use SSE instructions because
__AVX512F__
is not defined.
- cpyquickhelper.numbers.cbenchmark_dot.vector_dot_product16_nofcall(arg0: numpy.ndarray[numpy.float32], arg1: numpy.ndarray[numpy.float32]) float ¶
Computes a dot product in C++ with vectors of floats. Goes 16 by 16. Do not call intermediate functions.
- cpyquickhelper.numbers.cbenchmark_dot.vector_dot_product16_sse(arg0: numpy.ndarray[numpy.float32], arg1: numpy.ndarray[numpy.float32]) float ¶
Computes a dot product in C++ with vectors of floats. Goes 16 by 16. Use SSE instructions.
- cpyquickhelper.numbers.cbenchmark_dot.vector_dot_product_openmp(p1: numpy.ndarray[numpy.float32], p2: numpy.ndarray[numpy.float32], nthreads: int = -1) float ¶
Computes a dot product in C++ with vectors of floats and parallelizes with OPENMP.