The spec of a WordPairMap kernel.
Result i is op(a[i], b[i]) in the template's emulated IEEE 754 binary64 arithmetic, rounded to nearest even, with the IEEE results for signed zeros, infinities, NaN and subnormals. Sqrt and ToFloat32 take only a. Bindings: a 0, b 1, result 2, or a 0 and result 1 for Sqrt and ToFloat32. The result of ToFloat32 is float32, the double rounded to nearest even, so it can feed a network.
- Parameters
-
| op | Operation applied to every element. |
| workgroup | Invocations per group, from 1 to 1024. |
Definition at line 45 of file WordPairMap.hpp.
47{
55 }
57 return assemble.
ssbo(
"result", BindingDirection::Output, result)
61}
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 & workgroup(uint32_t x, uint32_t y=1, uint32_t z=1)
Override workgroup size.
Assemble & tmpl(KernelTemplate t)
Set the kernel template.
Assemble & word_op(WordPairOp o)
Set the operation of a WordPairMap.
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
@ FLOAT32
32-bit float (standard GPU)
@ WordPairMap
Applies one IEEE double operation to word-pair doubles, one thread per element.
BindingDirection
Data flow direction for a shader binding slot.
@ ToFloat32
float32(a) rounded to nearest even, with IEEE results for zeros, infinities, NaN, overflow and float ...
constexpr bool word_pair_unary(Portal::Graphics::WordPairOp op) noexcept
True for an operation that takes no second operand.
References MayaFlux::Kakshya::FLOAT32, MayaFlux::Portal::Graphics::ShaderSpec::Assemble::ssbo(), MayaFlux::Portal::Graphics::ShaderSpec::Assemble::tmpl(), MayaFlux::Portal::Graphics::ToFloat32, MayaFlux::Kakshya::UINT32, MayaFlux::Kakshya::VEC2_U32, MayaFlux::Portal::Graphics::ShaderSpec::Assemble::word_op(), word_pair_unary(), and MayaFlux::Portal::Graphics::WordPairMap.