UfuncProfiler#
-
class numpy::UfuncProfiler#
numpy C++ class.
Example#
#include <numpy/np_ndarray.h>
using namespace numpy;
// Use UfuncProfiler
UfuncProfiler obj;
// ... operations ...
Other Methods#
Signature |
Return Type |
Location |
Example |
|---|---|---|---|
|
double |
NP_FROMPYFUNC.H:214 |
|
|
double |
NP_FROMPYFUNC.H:210 |
|
|
void |
NP_FROMPYFUNC.H:203 |
|
|
void |
NP_FROMPYFUNC.H:196 |
Code Examples#
The following examples are extracted from the test suite.
reset (np_test_2_all.cpp:22610)
22600 // Count iterations
22601 size_t outer_count = 0;
22602 size_t total_inner_count = 0;
22603 for (; !outer.is_finished(); ++outer) {
22604 size_t inner_count = 0;
22605 for (; !inner.is_finished(); ++inner) {
22606 inner_count++;
22607 total_inner_count++;
22608 }
22609 outer_count++;
22610 inner.reset();
22611 }
22612
22613 if (outer_count != 3 || total_inner_count != 12) {
22614 std::cout << " [FAIL] : Iteration counts incorrect";
22615 throw std::runtime_error("np_test_nested_iters_basic failed");
22616 }
22617
22618 std::cout << " -> tests passed" << std::endl;
22619 }