UfuncProfiler ============= .. cpp:class:: numpy::UfuncProfiler numpy C++ class. Example ------- .. code-block:: cpp #include using namespace numpy; // Use UfuncProfiler UfuncProfiler obj; // ... operations ... Other Methods ------------- .. list-table:: :widths: 40 20 15 25 :header-rows: 1 * - Signature - Return Type - Location - Example * - ``double avgElementsPerBlock()`` - double - NP_FROMPYFUNC.H:214 - * - ``double avgTimePerElement()`` - double - NP_FROMPYFUNC.H:210 - * - ``void recordCall(size_telements, size_tblocks, doubletime_ms)`` - void - NP_FROMPYFUNC.H:203 - * - ``void reset()`` - void - NP_FROMPYFUNC.H:196 - :ref:`View ` Code Examples ------------- The following examples are extracted from the test suite. .. _example-ufuncprofiler-reset-0: .. dropdown:: reset (np_test_2_all.cpp:22610) :class-title: example-dropdown .. code-block:: cpp :linenos: :lineno-start: 22600 :emphasize-lines: 11 // Count iterations size_t outer_count = 0; size_t total_inner_count = 0; for (; !outer.is_finished(); ++outer) { size_t inner_count = 0; for (; !inner.is_finished(); ++inner) { inner_count++; total_inner_count++; } outer_count++; inner.reset(); } if (outer_count != 3 || total_inner_count != 12) { std::cout << " [FAIL] : Iteration counts incorrect"; throw std::runtime_error("np_test_nested_iters_basic failed"); } std::cout << " -> tests passed" << std::endl; }