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

◆ download_words()

std::vector< double > MayaFlux::Yantra::WordPairExecutionContext::download_words ( size_t binding,
size_t count )
inlinenodiscard

Read a binding back as doubles after a recorded stage.

For stages recorded with record_stages, which leave nothing in primary_values. The context must have been built with the config the stage ran under. A binding that resolves to a shared buffer of set 0, its own or an imported one, is read from that buffer, as the shaders see it.

Parameters
bindingBinding that holds word pairs.
countDoubles to read.
Returns
The decoded doubles, or empty when the context stages order keys.

Definition at line 97 of file WordPairExecutionContext.hpp.

98 {
99 if (m_order_key) {
100 return {};
101 }
102 std::vector<uint8_t> bytes(count * sizeof(uint64_t));
103 if (shared_buffer_info(0, binding)) {
104 download_shared(0, binding, bytes.data(), bytes.size());
105 } else {
106 download_binding(binding, bytes.data(), bytes.size());
107 }
109 }
void download_binding(size_t index, void *dest, size_t byte_size)
Read back a specific binding into a caller-provided destination.
void download_shared(uint32_t set, size_t binding_index, void *dest, size_t byte_size)
std::optional< SharedBufferInfo > shared_buffer_info(uint32_t set, size_t binding_index) const
What the shared buffer at (set, binding_index) declares, or nothing when absent.
static std::vector< double > decode_word_pairs(std::span< const uint8_t > bytes)
Decode little-endian 64-bit words as IEEE 754 doubles.

References MayaFlux::Yantra::OperationHelper::decode_word_pairs(), MayaFlux::Yantra::GpuDispatchCore::download_binding(), MayaFlux::Yantra::GpuDispatchCore::download_shared(), m_order_key, and MayaFlux::Yantra::GpuDispatchCore::shared_buffer_info().

Referenced by MayaFlux::Yantra::read_argmax().

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