diff --git a/ethosu/regor/architecture/architecture.cpp b/ethosu/regor/architecture/architecture.cpp index baf21599838d574973cd5684604f96a2226712e0..57a257ee11c64271ccfef72eb13e9486ecc5a6ea 100644 --- a/ethosu/regor/architecture/architecture.cpp +++ b/ethosu/regor/architecture/architecture.cpp @@ -90,6 +90,11 @@ MemArea Architecture::OutputFeatureMapMemory() return MemArea(_featuremapMemory, usage); } +MemArea Architecture::CPUMemory() +{ + return MemArea(_featuremapMemory, MemUsage::None); +} + IniParseResult Architecture::ParseSection(const std::string §ion, IniReader *reader) { // Parse the architecture config (must happen first in INI file ). diff --git a/ethosu/regor/architecture/architecture.hpp b/ethosu/regor/architecture/architecture.hpp index 5967770ef85540f2ca395de707ee13426e7c8165..c188d83384286aeb9ffbca455d8c219583459328 100644 --- a/ethosu/regor/architecture/architecture.hpp +++ b/ethosu/regor/architecture/architecture.hpp @@ -372,6 +372,7 @@ public: MemArea StagingMemory(); MemArea InputFeatureMapMemory(); MemArea OutputFeatureMapMemory(); + MemArea CPUMemory(); IniParseResult ParseSection(const std::string §ion, IniReader *reader); // Select named memories diff --git a/ethosu/regor/compiler/scheduler.cpp b/ethosu/regor/compiler/scheduler.cpp index e2cd127a6c5c39e5f2a090ebc7dfe93938619431..6a69f55984d2dec20f3bea5549f1a6a4da7b5b5f 100644 --- a/ethosu/regor/compiler/scheduler.cpp +++ b/ethosu/regor/compiler/scheduler.cpp @@ -333,7 +333,11 @@ int Scheduler::UpdateSchedulerTensor(TensorUsage usage, SchedulerConnection *con conn->requireFullTensor = conn->requireFullTensor || cpuTensor; tensor->needsLinearFormat = tensor->needsLinearFormat || cpuTensor || CheckLinearFormatForConcatSplit(tensor); - if ( _options.separateIORegions && !tensor->IsConstant() && cpuTensor && tensor->hasNPUReaders ) + if ( cpuTensor && !tensor->hasNPUWriters && !tensor->hasNPUReaders ) + { + tensor->memArea = _arch->CPUMemory(); + } + else if ( _options.separateIORegions && !tensor->IsConstant() && cpuTensor && tensor->hasNPUReaders ) { tensor->memArea = _arch->InputFeatureMapMemory(); }