239 :
recording(shared ? std::move(shared) : std::make_shared<GpuDispatchRecorder>(
true))
240 ,
context(std::make_unique<ShaderExecutionContext<>>(
242 {
244 if (!
context->ensure_gpu_ready()) {
246 std::source_location::current(), "HubertPhonemeModel needs a graphics device and none is available");
247 }
248
249 front = pack(weights, front_specs());
251 front.values = std::vector<float> {};
252
253 for (uint32_t block = 0; block < k_blocks; ++block) {
254 blocks[block] = pack(weights, block_specs(block));
256 blocks[block].values = std::vector<float> {};
257 }
258
259 const auto folded = fold_position_weights(pack(weights, position_specs()));
262 context->upload_shared_raw(0, WeightsPosition,
reinterpret_cast<const uint8_t*
>(folded.data()), folded.size() *
sizeof(
float));
263 }
@ ComputeMatrix
Compute operations (Yantra - algorithms, matrices, DSP).
@ Yantra
DSP algorithms, computational units, matrix operations, Grammar.
@ COMPUTE
Storage buffer for compute shaders (device-local).
constexpr const char * conv1d_shader
constexpr uint32_t element_workgroup
Invocations per workgroup of the element-wise kernels.
void upload_packed_weights(GpuDispatchCore &context, uint32_t set, size_t binding, const PackedWeights &packed)
Allocate a shared buffer on a context and fill it with packed weights.
Portal::Graphics::GpuComputeConfig GpuComputeConfig
enum MayaFlux::Portal::Graphics::GpuBufferBinding::ElementType FLOAT32
std::unique_ptr< ShaderExecutionContext<> > context
std::shared_ptr< GpuDispatchRecorder > recording
TensorKernels::PackedWeights front
std::array< TensorKernels::PackedWeights, k_blocks > blocks