Skip to content

Commit

Permalink
Update MultiLocaleInference.chpl to have better comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Iainmon authored Sep 17, 2024
1 parent ced851d commit 311b2be
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions examples/MultiLocaleInference.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,21 @@ var preds: [imagesD] int;
config const numTries = 1;

var totalTime: real;

for i in 0..<numTries {

// Begin timing the inference on entire batch
var st = new Time.stopwatch();
st.start();

// coforall loc in Locales {
// on loc {
// const myAD = A.domain.localIndices();
// forall i in myAD;
// }
// }
// Feed each input through the network in parallel
forall (image,pred) in zip(images,preds) {
// Get reference to the model instance on the iteration's node
var model = localeModels[here.id].borrow();
// Map the input image to an int from 0-9
pred = model(image).argmax();
}


// Stop the timer
st.stop();
const tm = st.elapsed();
totalTime += tm;
Expand Down

0 comments on commit 311b2be

Please sign in to comment.