index 2291d97f9ab543aed19d147b7464b2742cd937fc..5cc618feec4515aeb02783e06ff6c3e1afa88e88 100644 (file)
bool Run(int num_eve,int num_dsp, const char* ref_output);
-Executor* CreateExecutor(DeviceType dt, int num, const Configuration& c,
- int layer_group_id);
-
-
int main(int argc, char *argv[])
{
// Catch ctrl-c to ensure a clean exit
c.PARAM_HEAP_SIZE = (3 << 20); // 3MB
c.NETWORK_HEAP_SIZE = (20 << 20); // 20MB
+ // Run this example for 16 input frames
c.numFrames = 16;
- // Assign layers 12, 13 and 14 to layer group 2
- c.layerIndex2LayerGroupId = { {12, 2}, {13, 2}, {14, 2} };
+ // Assign layers 12, 13 and 14 to the DSP layer group
+ const int EVE_LG = 1;
+ const int DSP_LG = 2;
+ c.layerIndex2LayerGroupId = { {12, DSP_LG}, {13, DSP_LG}, {14, DSP_LG} };
// Open input file for reading
std::ifstream input(c.inData, std::ios::binary);
try
{
// Create Executors - use all the DSP and EVE cores available
- // Layer group 1 will be executed on EVE, 2 on DSP
- unique_ptr<Executor> eve(CreateExecutor(DeviceType::EVE,num_eve,c,1));
- unique_ptr<Executor> dsp(CreateExecutor(DeviceType::DSP,num_dsp,c,2));
+ // Specify layer group id for each Executor
+ unique_ptr<Executor> eve(CreateExecutor(DeviceType::EVE,
+ num_eve, c, EVE_LG));
+ unique_ptr<Executor> dsp(CreateExecutor(DeviceType::DSP,
+ num_dsp, c, DSP_LG));
// Create pipelines. Each pipeline has 1 EVE and 1 DSP. If there are
// more EVEs than DSPs, the DSPs are shared across multiple
{
EOP* eop = EOPs[frame_idx % num_eops];
- // Wait for previous frame on the same eo to finish processing
+ // Wait for previous frame on the same EOP to finish processing
if (eop->ProcessFrameWait())
{
ReportTime(eop);
return status;
}
-// Create an Executor with the specified type and number of EOs
-Executor* CreateExecutor(DeviceType dt, int num, const Configuration& c,
- int layer_group_id)
-{
- if (num == 0) return nullptr;
-
- DeviceIds ids;
- for (int i = 0; i < num; i++)
- ids.insert(static_cast<DeviceId>(i));
-
- return new Executor(dt, ids, c, layer_group_id);
-}