| #ifndef CONVOLVE_INCLUDE |
| #define CONVOLVE_INCLUDE |
|
|
| #include <stddef.h> |
|
|
| |
| #undef _OPENMP |
|
|
| #if defined(_MSC_VER) |
|
|
| #define FORCE_INLINE __forceinline |
| #define NEVER_INLINE __declspec(noinline) |
|
|
| |
| #else |
|
|
| #define FORCE_INLINE inline __attribute__((always_inline)) |
| #define NEVER_INLINE __attribute__((noinline)) |
|
|
| #endif |
|
|
| |
| #if defined(_MSC_VER) |
| typedef signed omp_iter_var; |
| #else |
| typedef size_t omp_iter_var; |
| #endif |
|
|
| |
| #if defined(_MSC_VER) |
| #define LIB_CONVOLVE_EXPORT __declspec(dllexport) |
| #else |
| #define LIB_CONVOLVE_EXPORT |
| #endif |
|
|
| |
| |
| #if defined(_MSC_VER) |
| void PyInit__convolve(void); |
| #endif |
|
|
| #include "numpy/ndarrayobject.h" |
| #define DTYPE npy_float64 |
|
|
|
|
| LIB_CONVOLVE_EXPORT void convolveNd_c(DTYPE * const result, |
| const DTYPE * const f, |
| const unsigned n_dim, |
| const size_t * const image_shape, |
| const DTYPE * const g, |
| const size_t * const kernel_shape, |
| const bool nan_interpolate, |
| const bool embed_result_within_padded_region, |
| const unsigned n_threads); |
|
|
| |
| void convolve1d_c(DTYPE * const result, |
| const DTYPE * const f, const size_t nx, |
| const DTYPE * const g, const size_t nkx, |
| const bool nan_interpolate, |
| const bool embed_result_within_padded_region, |
| const unsigned n_threads); |
| FORCE_INLINE void convolve1d(DTYPE * const result, |
| const DTYPE * const f, const size_t nx, |
| const DTYPE * const g, const size_t nkx, |
| const bool nan_interpolate, |
| const bool embed_result_within_padded_region, |
| const unsigned n_threads); |
|
|
| |
| void convolve2d_c(DTYPE * const result, |
| const DTYPE * const f, const size_t nx, const size_t ny, |
| const DTYPE * const g, const size_t nkx, const size_t nky, |
| const bool nan_interpolate, |
| const bool embed_result_within_padded_region, |
| const unsigned n_threads); |
| FORCE_INLINE void convolve2d(DTYPE * const result, |
| const DTYPE * const f, const size_t nx, const size_t ny, |
| const DTYPE * const g, const size_t nkx, const size_t nky, |
| const bool nan_interpolate, |
| const bool embed_result_within_padded_region, |
| const unsigned n_threads); |
|
|
| |
| void convolve3d_c(DTYPE * const result, |
| const DTYPE * const f, const size_t nx, const size_t ny, const size_t nz, |
| const DTYPE * const g, const size_t nkx, const size_t nky, const size_t nkz, |
| const bool nan_interpolate, |
| const bool embed_result_within_padded_region, |
| const unsigned n_threads); |
| FORCE_INLINE void convolve3d(DTYPE * const result, |
| const DTYPE * const f, const size_t nx, const size_t ny, const size_t nz, |
| const DTYPE * const g, const size_t nkx, const size_t nky, const size_t nkz, |
| const bool nan_interpolate, |
| const bool embed_result_within_padded_region, |
| const unsigned n_threads); |
|
|
|
|
| #endif |
|
|