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

◆ lagged_pair_spec()

Portal::Graphics::ShaderSpec MayaFlux::Yantra::lagged_pair_spec ( Portal::Graphics::PairMap map,
bool centred,
uint32_t workgroup = 256 )
inlinenodiscard

The spec of a LaggedPair kernel.

For window w and lag l the kernel sums map(x[i], x[i + l]) over the window, with i + l inside it, in the template's emulated IEEE double arithmetic on word pairs. A centred kernel subtracts each window's mean from both operands first; the mean is the window sum divided by the window length, exactly rounded like a host quotient. A lag of the window length or more sums nothing. Bindings: values 0, result 1.

Parameters
mapPairwise map summed over the window.
centredTrue to remove each window's mean before the map.
workgroupInvocations per sum. A power of two from 2 to 1024.

Definition at line 34 of file LaggedPair.hpp.

36{
40 .pair_map(map)
41 .centred(centred)
42 .ssbo("values", BindingDirection::Input, Kakshya::GpuDataFormat::VEC2_U32)
43 .ssbo("result", BindingDirection::Output, Kakshya::GpuDataFormat::VEC2_U32)
51 .workgroup(workgroup)
52 .build();
53}
ShaderSpec build()
Finalise and return the ShaderSpec.
Assemble & pc(std::string name, Kakshya::GpuDataFormat format)
Declare a push constant field with explicit format.
Assemble & ssbo(std::string name, BindingDirection direction, Kakshya::GpuDataFormat format, Kakshya::DataModality modality=Kakshya::DataModality::SCALAR_F32)
Declare an SSBO binding.
Assemble & pair_map(PairMap m)
Set the pairwise map of a LaggedPair.
Assemble & centred(bool c=true)
Subtract each window's mean from both operands of a LaggedPair before the map.
Assemble & workgroup(uint32_t x, uint32_t y=1, uint32_t z=1)
Override workgroup size.
Assemble & tmpl(KernelTemplate t)
Set the kernel template.
Fluent assembler producing a ShaderSpec.
@ VEC2_U32
glm::uvec2: a 64-bit value as low word (x) and high word (y), not a sampled image format
@ LaggedPair
Sums a pairwise map of x[i] and x[i + lag] over a window, for every lag in a range,...
BindingDirection
Data flow direction for a shader binding slot.

References MayaFlux::Portal::Graphics::ShaderSpec::Assemble::build(), MayaFlux::Portal::Graphics::ShaderSpec::Assemble::centred(), MayaFlux::Portal::Graphics::LaggedPair, MayaFlux::Portal::Graphics::ShaderSpec::Assemble::pair_map(), MayaFlux::Portal::Graphics::ShaderSpec::Assemble::pc(), MayaFlux::Portal::Graphics::ShaderSpec::Assemble::ssbo(), MayaFlux::Portal::Graphics::ShaderSpec::Assemble::tmpl(), MayaFlux::Kakshya::UINT32, MayaFlux::Kakshya::VEC2_U32, and MayaFlux::Portal::Graphics::ShaderSpec::Assemble::workgroup().

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

Here is the call graph for this function:
Here is the caller graph for this function: