Correlation 4.10.0
An Analysis Tool for Liquids and for Amorphous Solids
Loading...
Searching...
No Matches
SIMDNormalization.hpp
Go to the documentation of this file.
1
8
9#pragma once
10
13#include "math/simd/detail/AVX512Kernels.hpp" // IWYU pragma: export
14#include "math/simd/detail/ScalarKernels.hpp" // IWYU pragma: export
15
16namespace correlation::math {
17
22template <typename T> inline T sincIntegral(const SincIntegralParams<T> &params) noexcept {
23#ifdef CORRELATION_SIMD_AVX512
24 return detail::avx512::sincIntegral(params);
25#elifdef CORRELATION_SIMD_AVX2
26 return detail::avx2::sincIntegral(params);
27#else
28 return detail::scalar::sincIntegral(params);
29#endif
30}
31
35inline double sincIntegral(double q_magnitude, const double *CORRELATION_RESTRICT integrand,
36 const double *CORRELATION_RESTRICT radial_bins,
37 double *CORRELATION_RESTRICT sinqr_scratch, std::size_t count) noexcept {
39 .q_magnitude = q_magnitude,
40 .integrand = integrand,
41 .radial_bins = radial_bins,
42 .sinqr_scratch = sinqr_scratch,
43 .count = count,
44 });
45}
46
50inline float sincIntegral(float q_magnitude, const float *CORRELATION_RESTRICT integrand,
51 const float *CORRELATION_RESTRICT radial_bins,
52 float *CORRELATION_RESTRICT sinqr_scratch, std::size_t count) noexcept {
54 .q_magnitude = q_magnitude,
55 .integrand = integrand,
56 .radial_bins = radial_bins,
57 .sinqr_scratch = sinqr_scratch,
58 .count = count,
59 });
60}
61
66template <typename T>
67inline void normalizeRdfBins(const RDFNormalizationParams<T> &params) noexcept {
68#ifdef CORRELATION_SIMD_AVX512
69 detail::avx512::normalizeRdfBins(params);
70#elifdef CORRELATION_SIMD_AVX2
72#else
74#endif
75}
76
81template <typename T> inline void scaleBins(const ScaleBinsParams<T> &params) noexcept {
82#ifdef CORRELATION_SIMD_AVX512
83 detail::avx512::scaleBins(params);
84#elifdef CORRELATION_SIMD_AVX2
86#else
88#endif
89}
90
95template <typename T> inline void scaleBins(T *arr, T scale_factor, std::size_t count) noexcept {
97 .arr = arr,
98 .scale_factor = scale_factor,
99 .count = count,
100 });
101}
102
103} // namespace correlation::math
Low-level AVX2 intrinsic kernel implementations.
Low-level AVX-512 intrinsic kernel implementations.
Common parameter containers, POD types, and scalar helpers for SIMD operations.
Low-level Scalar fallback kernel implementations.
void scaleBins(const ScaleBinsParams< double > &params) noexcept
Definition AVX2Kernels.hpp:353
void normalizeRdfBins(const RDFNormalizationParams< double > &params) noexcept
Definition AVX2Kernels.hpp:269
double sincIntegral(const SincIntegralParams< double > &params) noexcept
Definition AVX2Kernels.hpp:197
double sincIntegral(const SincIntegralParams< double > &params) noexcept
Definition ScalarKernels.hpp:92
void normalizeRdfBins(const RDFNormalizationParams< double > &params) noexcept
Definition ScalarKernels.hpp:143
void scaleBins(const ScaleBinsParams< double > &params) noexcept
Definition ScalarKernels.hpp:191
Defines universal mathematical and physical constants.
T sincIntegral(const SincIntegralParams< T > &params) noexcept
Computes a sinc-weighted integral over a range.
Definition SIMDNormalization.hpp:22
void scaleBins(const ScaleBinsParams< T > &params) noexcept
Scales an array by a constant factor in-place using ScaleBinsParams container.
Definition SIMDNormalization.hpp:81
void normalizeRdfBins(const RDFNormalizationParams< T > &params) noexcept
Normalizes Radial Distribution Function (RDF) bins.
Definition SIMDNormalization.hpp:67
Parameter container for normalizeRdfBins kernel invocations.
Definition SIMDTypes.hpp:70
Parameter container for scaleBins kernel invocations.
Definition SIMDTypes.hpp:88
Parameter container for sincIntegral kernel invocations.
Definition SIMDTypes.hpp:58