Skip to content
Permalink
Browse files

rename cbenchmark into cbenchmark_dot

  • Loading branch information...
sdpython committed Mar 19, 2019
1 parent a93303b commit d5a09ccfbed4fa8a03d9ed91dcbf9854fe68924f
@@ -27,18 +27,18 @@
import src

from src.cpyquickhelper.numbers import check_speed
from src.cpyquickhelper.numbers.cbenchmark import measure_scenario_A, measure_scenario_B # pylint: disable=W0611, E0611
from src.cpyquickhelper.numbers.cbenchmark import measure_scenario_C, measure_scenario_D # pylint: disable=W0611, E0611
from src.cpyquickhelper.numbers.cbenchmark import measure_scenario_E, measure_scenario_F # pylint: disable=W0611, E0611
from src.cpyquickhelper.numbers.cbenchmark import measure_scenario_G, measure_scenario_H # pylint: disable=W0611, E0611
from src.cpyquickhelper.numbers.cbenchmark import measure_scenario_I, measure_scenario_J # pylint: disable=W0611, E0611
from src.cpyquickhelper.numbers.cbenchmark import vector_dot_product, empty_vector_dot_product # pylint: disable=W0611, E0611
from src.cpyquickhelper.numbers.cbenchmark import vector_dot_product16, vector_dot_product16_sse # pylint: disable=W0611, E0611
from src.cpyquickhelper.numbers.cbenchmark import vector_dot_product16_nofcall # pylint: disable=W0611, E0611
from src.cpyquickhelper.numbers.cbenchmark import vector_dot_product16_avx512, get_simd_available_option # pylint: disable=W0611, E0611


class TestCBenchmark(ExtTestCase):
from src.cpyquickhelper.numbers.cbenchmark_dot import measure_scenario_A, measure_scenario_B # pylint: disable=W0611, E0611
from src.cpyquickhelper.numbers.cbenchmark_dot import measure_scenario_C, measure_scenario_D # pylint: disable=W0611, E0611
from src.cpyquickhelper.numbers.cbenchmark_dot import measure_scenario_E, measure_scenario_F # pylint: disable=W0611, E0611
from src.cpyquickhelper.numbers.cbenchmark_dot import measure_scenario_G, measure_scenario_H # pylint: disable=W0611, E0611
from src.cpyquickhelper.numbers.cbenchmark_dot import measure_scenario_I, measure_scenario_J # pylint: disable=W0611, E0611
from src.cpyquickhelper.numbers.cbenchmark_dot import vector_dot_product, empty_vector_dot_product # pylint: disable=W0611, E0611
from src.cpyquickhelper.numbers.cbenchmark_dot import vector_dot_product16, vector_dot_product16_sse # pylint: disable=W0611, E0611
from src.cpyquickhelper.numbers.cbenchmark_dot import vector_dot_product16_nofcall # pylint: disable=W0611, E0611
from src.cpyquickhelper.numbers.cbenchmark_dot import vector_dot_product16_avx512, get_simd_available_option # pylint: disable=W0611, E0611


class TestCBenchmarkDot(ExtTestCase):

funcs = [(k, v) for k, v in globals().copy().items()
if k.startswith("measure_scenario")]
@@ -9,7 +9,7 @@
#include <vector>
#include "unit_tests.h"
#include "weighted_number.h"
#include "cbenchmark.h"
#include "cbenchmark_dot.h"

void ASSERT_EQUAL(double a, double b)
{
@@ -221,9 +221,9 @@ def __str__(self):
],
language='c++')

ext_benchmark = Extension('cpyquickhelper.numbers.cbenchmark',
ext_benchmark = Extension('cpyquickhelper.numbers.cbenchmark_dot',
[os.path.join(
root, 'src/cpyquickhelper/numbers/cbenchmark.cpp')],
root, 'src/cpyquickhelper/numbers/cbenchmark_dot.cpp')],
extra_compile_args=extra_compile_args_numbers,
include_dirs=[
# Path to pybind11 headers
@@ -1,4 +1,4 @@
#include "cbenchmark.h"
#include "cbenchmark_dot.h"

#if !defined(_CRT_SECURE_NO_WARNINGS)
#define _CRT_SECURE_NO_WARNINGS
@@ -598,7 +598,7 @@ std::string get_simd_available_option()

#ifndef SKIP_PYTHON

PYBIND11_MODULE(cbenchmark, m) {
PYBIND11_MODULE(cbenchmark_dot, m) {
m.doc() =
#if defined(__APPLE__)
"Measures the execution time of functions implemented in C."
@@ -679,7 +679,7 @@ It can simply be called with the following example:
.. runpython::
:showcode:
from cpyquickhelper.numbers.cbenchmark import get_simd_available_option
from cpyquickhelper.numbers.cbenchmark_dot import get_simd_available_option
print(get_simd_available_option())
)pbdoc"
#endif
@@ -56,10 +56,10 @@ def _fcts():
Returns functions to measure.
"""
import numpy
from .cbenchmark import vector_dot_product # pylint: disable=E0611
from .cbenchmark import vector_dot_product16 # pylint: disable=E0611
from .cbenchmark import vector_dot_product16_nofcall # pylint: disable=E0611
from .cbenchmark import vector_dot_product16_sse # pylint: disable=E0611
from .cbenchmark_dot import vector_dot_product # pylint: disable=E0611
from .cbenchmark_dot import vector_dot_product16 # pylint: disable=E0611
from .cbenchmark_dot import vector_dot_product16_nofcall # pylint: disable=E0611
from .cbenchmark_dot import vector_dot_product16_sse # pylint: disable=E0611

def simple_dot(values):
return numpy.dot(values, values)

0 comments on commit d5a09cc

Please sign in to comment.
You can’t perform that action at this time.