Skip to content

Commit eac3cd2

Browse files
jiriocroman-janik-nxp
authored andcommitted
Make the KWS model working on RT700.
1 parent 2955ef6 commit eac3cd2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

backends/nxp/runtime/NeutronBackend.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ typedef struct {
5151
int numInputs = 0;
5252
int numOutputs = 0;
5353
int numInputArgs = 0;
54+
uint32_t scratchSize = 0;
5455
NeutronModelConfig mcfg;
5556
NeutronDataConfig dcfg;
5657
NeutronModelHandle nmh = NULL;
@@ -194,6 +195,7 @@ class NeutronBackend final : public PyTorchBackendInterface {
194195
}
195196
uint32_t microcodeSize = buffer[6];
196197
uint32_t weightsSize = buffer[7];
198+
cfg->scratchSize = buffer[9];
197199
cfg->numInputs = buffer[11];
198200
cfg->numOutputs = buffer[12];
199201
if (cfg->numInputs != numInputs) {
@@ -236,7 +238,7 @@ class NeutronBackend final : public PyTorchBackendInterface {
236238
// Allocate place for input and output pointers.
237239
cfg->dcfg.inputs = static_cast<const void**>(context.allocate(cfg->numInputs * sizeof(void*)));
238240
cfg->dcfg.outputs = static_cast<void**>(context.allocate(cfg->numOutputs * sizeof(void*)));
239-
cfg->dcfg.outputs[cfg->numOutputs] = static_cast<void**>(context.allocate(1 * sizeof(void*)));
241+
cfg->dcfg.outputs[cfg->numOutputs] = static_cast<void*>(context.allocate(cfg->scratchSize, 16));
240242

241243
// Set inputs from args.
242244
// Transpose inputs if needed.

0 commit comments

Comments
 (0)