Skip to content

Commit f88ebc5

Browse files
Fix compute throttling to prevent blown buffers
1 parent 9911f9a commit f88ebc5

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

models/starComplexity.cc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,11 +367,16 @@ void StarComplexityGen::fillStarMap(unsigned numStars)
367367
starMapPopulated=syclQ().submit([&](auto& handler) {
368368
handler.depends_on(resultSwapped);
369369
handler.host_task([&]() {
370-
resultBufferConsumed=0;
371370
populateStarMap();
372371
});
373372
});
374373

374+
// reset resultBufferConsumed to number of compute threads outstanding
375+
resultBufferConsumed=0;
376+
for (auto& i: compute)
377+
if (eventStatus(i)!=sycl::info::event_command_status::complete)
378+
resultBufferConsumed+=numOps;
379+
375380
backedResultsReset=syclQ().parallel_for
376381
(blockSize,starMapPopulated,[block=&*block](auto i){block->backedResult[i].reset();});
377382
};
@@ -383,7 +388,7 @@ void StarComplexityGen::fillStarMap(unsigned numStars)
383388
{
384389
if (eventStatus(backedResultsReset)==sycl::info::event_command_status::complete)
385390
consumeResults(i+blockSize>=block->numGraphs);
386-
cout<<"pausing..."<<endl;
391+
cout<<"."<<flush;
387392
backedResultsReset.wait();
388393
}
389394

models/starComplexity.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
#starC.blockSize(40320)
2222

2323
starC.generateElementaryStars(nodes)
24-
#for numStars in range(1,maxStars+1):
25-
for numStars in range(6,8):
24+
for numStars in range(1,maxStars+1):
2625
starC.fillStarMap(numStars)
2726
print('completed',numStars,datetime.now())
2827
starC.canonicaliseStarMap()

0 commit comments

Comments
 (0)