1 #include "cheetah/pwft/cuda/Pwft.cuh" 4 #define RSQRT2 0.70710678118654746f 16 struct FormPower:
public thrust::unary_function<T,thrust::complex<T> >
18 inline __host__ __device__
19 T operator()(
const thrust::complex<T> &x)
const 21 T val = thrust::abs<T>(x);
31 struct FormPowerNN:
public thrust::binary_function<T, thrust::complex<T>, thrust::complex<T> >
33 inline __host__ __device__
34 T operator()(
const thrust::complex<T> &x,
const thrust::complex<T> &y)
const 36 T val = thrust::max<T>(thrust::abs<T>(x-y)*RSQRT2,thrust::abs<T>(x));
44 template <
typename T,
typename InputAlloc,
typename OutputAlloc>
49 PANDA_LOG_DEBUG <<
"GPU ID: "<<gpu.device_id();
50 output.
resize(input.size());
53 thrust::transform(thrust::cuda::par,
55 input.end(),output.
begin(),
59 template <
typename T,
typename InputAlloc,
typename OutputAlloc>
64 PANDA_LOG_DEBUG <<
"GPU ID: "<<gpu.device_id();
65 output.
resize(input.size());
69 thrust::transform(thrust::cuda::par,
70 input.begin()+1, input.end(),
71 input.begin(), output.
begin()+1,
void process_direct(ResourceType &gpu, data::FrequencySeries< Architecture, typename data::ComplexTypeTraits< cheetah::Cuda, T >::type, InputAlloc > const &input, data::PowerSeries< Architecture, T, OutputAlloc > &output)
Form power spectrum using absolute squared.
FourierFrequencyType const & frequency_step() const
Retrieve the frequency step of the series.
void process_nn(ResourceType &gpu, data::FrequencySeries< Architecture, typename data::ComplexTypeTraits< cheetah::Cuda, T >::type, InputAlloc > const &input, data::PowerSeries< Architecture, T, OutputAlloc > &output)
Form power spectrum using absolute squared with nearest neighbour comparison.
A helper class to determine the type of complex data for different architectures. ...
A container of Fourier series data.
Some limits and constants for FLDO.
ConstIterator begin() const
Iterators to device memory.
Class for power series (detected FrequencySeries).
void resize(std::size_t size)
resize the data
double degrees_of_freedom() const
Retreive the (assumed) degrees of freedom of the data distribution.