| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 6539d87 commit c9aca87
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -61,9 +61,10 @@ set(XTENSOR_PYTHON_BENCHMARK | |||
| 61 | 61 | ) | |
| 62 | 62 | ||
| 63 | 63 | set(XTENSOR_PYTHON_BENCHMARK_TARGET benchmark_xtensor_python) | |
| 64 | - add_library(${XTENSOR_PYTHON_BENCHMARK_TARGET} EXCLUDE_FROM_ALL | ||
| 64 | + add_library(${XTENSOR_PYTHON_BENCHMARK_TARGET} MODULE EXCLUDE_FROM_ALL | ||
| 65 | 65 | ${XTENSOR_PYTHON_BENCHMARK} ${XTENSOR_PYTHON_HEADERS}) | |
| 66 | 66 | ||
| 67 | + set_target_properties(${XTENSOR_PYTHON_BENCHMARK_TARGET} PROPERTIES PREFIX "") | ||
| 67 | 68 | set_target_properties(${XTENSOR_PYTHON_BENCHMARK_TARGET} PROPERTIES SUFFIX "${PYTHON_MODULE_EXTENSION}") | |
| 68 | 69 | ||
| 69 | 70 | if(APPLE) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,4 @@ | |||
| 1 | - from xtensor_python_benchmark import sum_array | ||
| 1 | + from benchmark_xtensor_python import sum_array | ||
| 2 | 2 | import numpy as np | |
| 3 | 3 | ||
| 4 | 4 | u = np.ones(1000000, dtype=float) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,4 @@ | |||
| 1 | - from xtensor_python_benchmark import pybind_sum_array | ||
| 1 | + from benchmark_xtensor_python import pybind_sum_array | ||
| 2 | 2 | import numpy as np | |
| 3 | 3 | ||
| 4 | 4 | u = np.ones(1000000, dtype=float) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,4 @@ | |||
| 1 | - from xtensor_python_benchmark import sum_tensor | ||
| 1 | + from benchmark_xtensor_python import sum_tensor | ||
| 2 | 2 | import numpy as np | |
| 3 | 3 | ||
| 4 | 4 | u = np.ones(1000000, dtype=float) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,15 +11,15 @@ | |||
| 11 | 11 | ||
| 12 | 12 | namespace py = pybind11; | |
| 13 | 13 | ||
| 14 | - PYBIND11_PLUGIN(xtensor_python_benchmark) | ||
| 14 | + PYBIND11_PLUGIN(benchmark_xtensor_python) | ||
| 15 | 15 | { | |
| 16 | 16 | if(_import_array() < 0) | |
| 17 | 17 | { | |
| 18 | 18 | PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import"); | |
| 19 | 19 | return nullptr; | |
| 20 | 20 | } | |
| 21 | 21 | ||
| 22 | - py::module m("xtensor_python_benchmark", "Benchmark module for xtensor python bindings"); | ||
| 22 | + py::module m("benchmark_xtensor_python", "Benchmark module for xtensor python bindings"); | ||
| 23 | 23 | ||
| 24 | 24 | m.def("sum_array", [](xt::pyarray<double> const& x) { | |
| 25 | 25 | double sum = 0; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -89,8 +89,8 @@ namespace xt | |||
| 89 | 89 | ||
| 90 | 90 | pytensor() = default; | |
| 91 | 91 | ||
| 92 | - pytensor(pybind11::handle h, borrowed_t); | ||
| 93 | - pytensor(pybind11::handle h, stolen_t); | ||
| 92 | + pytensor(pybind11::handle h, pybind11::object::borrowed_t); | ||
| 93 | + pytensor(pybind11::handle h, pybind11::object::stolen_t); | ||
| 94 | 94 | pytensor(const pybind11::object &o); | |
| 95 | 95 | ||
| 96 | 96 | pytensor(const shape_type& shape, const strides_type& strides); | |
@@ -137,22 +137,22 @@ namespace xt | |||
| 137 | 137 | ***************************/ | |
| 138 | 138 | ||
| 139 | 139 | template <class T, std::size_t N> | |
| 140 | - inline pytensor<T, N>::pytensor(pybind11::handle h, borrowed_t) | ||
| 141 | - : base_type(h, borrowed) | ||
| 140 | + inline pytensor<T, N>::pytensor(pybind11::handle h, pybind11::object::borrowed_t) | ||
| 141 | + : base_type(h, pybind11::object::borrowed) | ||
| 142 | 142 | { | |
| 143 | 143 | init_from_python(); | |
| 144 | 144 | } | |
| 145 | 145 | ||
| 146 | 146 | template <class T, std::size_t N> | |
| 147 | - inline pytensor<T, N>::pytensor(pybind11::handle h, stolen_t) | ||
| 148 | - : base_type(h, stolen) | ||
| 147 | + inline pytensor<T, N>::pytensor(pybind11::handle h, pybind11::object::stolen_t) | ||
| 148 | + : base_type(h, pybind11::object::stolen) | ||
| 149 | 149 | { | |
| 150 | 150 | init_from_python(); | |
| 151 | 151 | } | |
| 152 | 152 | ||
| 153 | 153 | template <class T, std::size_t N> | |
| 154 | 154 | inline pytensor<T, N>::pytensor(const pybind11::object& o) | |
| 155 | - : base_type(base_type::raw_array_t(o.ptr()), stolen) | ||
| 155 | + : base_type(base_type::raw_array_t(o.ptr()), pybind11::object::stolen) | ||
| 156 | 156 | { | |
| 157 | 157 | if(!this->m_ptr) | |
| 158 | 158 | throw pybind11::error_already_set(); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments