MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ run_chunk()

template<ComputeData InputType = std::vector<Kakshya::DataVariant>, ComputeData OutputType = Eigen::MatrixXd>
void MayaFlux::Yantra::WindowedKernelAnalyzer< InputType, OutputType >::run_chunk ( ShaderExecutionContext<> & context,
ChannelWindowedKernel & out,
std::span< const std::span< const double > > inputs,
size_t first,
size_t count,
const WindowedKernelConfig & cfg ) const
inlineprivate

Definition at line 579 of file WindowedKernelAnalyzer.hpp.

581 {
582 const size_t begin = first * cfg.hop_size;
583 const size_t end = (first + count - 1) * cfg.hop_size + cfg.window_size;
584
586 chunks.reserve(inputs.size());
588 bound.reserve(inputs.size());
589 for (const auto& samples : inputs) {
590 chunks.emplace_back(samples.begin() + static_cast<std::ptrdiff_t>(begin), samples.begin() + static_cast<std::ptrdiff_t>(end));
591 bound.push_back({ .samples = chunks.back(), .stride = cfg.hop_size, .offset = 0 });
592 }
593
594 const auto values = run_windowed_kernel(context, m_gpu, cfg.shape(), bound, cfg.window_size,
595 static_cast<uint32_t>(count), cfg.outputs, cfg.parameters);
596 out.values.insert(out.values.end(), values.begin(), values.end());
597 for (size_t w = 0; w < count; ++w) {
598 const size_t start = (first + w) * cfg.hop_size;
599 out.window_positions.emplace_back(start, start + cfg.window_size);
600 }
601 }
ShaderExecutionContext & context(const WindowedKernelConfig &cfg) const
Runs a caller's compute kernel once per window of every channel.
std::vector< float > run_windowed_kernel(ShaderExecutionContext<> &context, const GpuComputeConfig &config, const WindowedKernelShape &shape, std::span< const WindowedInput > inputs, uint32_t window_length, uint32_t window_count, uint32_t outputs, std::span< const float > parameters)
Run a windowed kernel over every window of one or more sequences.

Referenced by MayaFlux::Yantra::WindowedKernelAnalyzer< std::vector< Kakshya::DataVariant >, Eigen::MatrixXd >::analyse().

Here is the caller graph for this function: