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

◆ magnitude_stage()

DependencyStage MayaFlux::Yantra::TensorKernels::magnitude_stage ( uint64_t src,
uint64_t dst,
uint32_t batch,
uint32_t channels,
uint32_t time )
inlinenodiscard

One nn_magnitude dispatch: sqrt(re^2 + im^2) of a complex signal stored as two channel halves.

src is [batch, 2 * channels, time] with the real parts in the first half of the channels and the imaginary parts in the second. dst is [batch, channels, time].

Exceptions
std::invalid_argumentWhen batch, channels or time is 0.

Definition at line 286 of file Stages.hpp.

288{
289 if (batch == 0 || channels == 0 || time == 0) {
290 detail::refuse("Magnitude needs a batch, channels and time");
291 }
292 const MagnitudePC pc { .src = src, .dst = dst, .batch = batch, .channels = channels, .time = time, .reserved = 0 };
294 detail::groups_for(static_cast<size_t>(batch) * channels * time, element_workgroup));
295}
DependencyStage make_stage(const char *shader, uint32_t local, const PC &pc, uint32_t groups)
Definition Stages.hpp:48
void refuse(std::string_view message)
Definition Layers.hpp:74
uint32_t groups_for(size_t invocations, uint32_t local)
Definition Stages.hpp:21
constexpr uint32_t element_workgroup
Invocations per workgroup of the element-wise kernels.
Definition Layouts.hpp:15
constexpr const char * magnitude_shader
Definition Layouts.hpp:25

References element_workgroup, MayaFlux::Yantra::TensorKernels::detail::groups_for(), magnitude_shader, MayaFlux::Yantra::TensorKernels::detail::make_stage(), and MayaFlux::Yantra::TensorKernels::detail::refuse().

Referenced by MayaFlux::Yantra::SileroVadModel::Impl::run().

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