The stage that applies the operation to every element of two host sequences.
The element count is the length of a, or the shorter of a and b for a binary operation. The result is that many doubles.
context.record_stages({
word_pair_map_stage(context, config, WordPairOp::Div, numerators, denominators) });
const auto quotients = context.download_words(2, numerators.size());
Shader context whose numeric input is staged as a uvec2 per double.
DependencyStage word_pair_map_stage(WordPairExecutionContext &context, const GpuComputeConfig &config, Portal::Graphics::WordPairOp op, size_t count, uint32_t workgroup=256)
The stage that applies the operation to count elements whose operands are already on the device.
Portal::Graphics::ShaderSpec word_pair_map_spec(Portal::Graphics::WordPairOp op, uint32_t workgroup=256)
The spec of a WordPairMap kernel.
GpuComputeConfig config_from_spec(const Portal::Graphics::ShaderSpec &spec)
Derive a GpuComputeConfig from a ShaderSpec.
std::vector< GpuBufferBinding > bindings_from_spec(const Portal::Graphics::ShaderSpec &spec)
Derive a GpuBufferBinding list from a ShaderSpec.
209{
211 const size_t count = unary ? a.size() : std::min(a.size(), b.size());
212
214}
constexpr bool word_pair_unary(Portal::Graphics::WordPairOp op) noexcept
True for an operation that takes no second operand.
Where one operand of a WordPairMap stage comes from.