Skip to content

Commit

Permalink
Remove use of vectorizeOnly (#25143)
Browse files Browse the repository at this point in the history
Removes a use of `vectorizeOnly` in LCALS, which can now be replaced
with `foreach`. Since the test now uses all `foreach`, the filenames and
variables that use `vectorizeOnly` have also been renamed.

[Reviewed by @lydia-duncan]
  • Loading branch information
jabraham17 authored Jun 11, 2024
2 parents 93ecf28 + 690a666 commit 6b925c6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion test/studies/lcals/LCALSConfiguration.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ module LCALSConfiguration {
config const run_variantRawSPMD = false; // off by default because
// short and medium loops
// take too long.
config const run_variantRawVectorizeOnly = false; // off by default because
config const run_variantRawVector = false; // off by default because
// it currently behaves
// identically to the
// serial variant
Expand Down
6 changes: 3 additions & 3 deletions test/studies/lcals/LCALSMain.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use RunBRawLoops;
use RunCRawLoops;
use RunParallelRawLoops;
use RunSPMDRawLoops;
use RunVectorizeOnlyRawLoops;
use RunVectorRawLoops;

use IO;

Expand Down Expand Up @@ -118,7 +118,7 @@ proc main {
}
run_variants[LoopVariantID.RAW_SPMD] = true;
}
if run_variantRawVectorizeOnly then
if run_variantRawVector then
run_variants[LoopVariantID.RAW_VECTOR_ONLY] = true;


Expand Down Expand Up @@ -617,7 +617,7 @@ proc runLoopVariant(lvid: LoopVariantID, run_loop:[] bool, ilength: LoopLength)
runSPMDRawLoops(loop_stats, run_loop, ilength);
}
when LoopVariantID.RAW_VECTOR_ONLY {
runVectorizeOnlyRawLoops(loop_stats, run_loop, ilength);
runVectorRawLoops(loop_stats, run_loop, ilength);
}
/*
when LoopVariantID.FORALL_LAMBDA {
Expand Down
1 change: 0 additions & 1 deletion test/studies/lcals/LCALSMain.good
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
RunVectorizeOnlyRawLoops.chpl:4: warning: The 'VectorizingIterator' module has been deprecated; please use 'foreach' loops instead

allocateLoopSuiteRunInfo...

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
module RunVectorizeOnlyRawLoops {
module RunVectorRawLoops {
use LCALSDataTypes;
use Timer;
use VectorizingIterator;
private use Math;

proc runVectorizeOnlyRawLoops(loop_stats: [] shared LoopStat, run_loop:[] bool, ilength: LoopLength) {
proc runVectorRawLoops(loop_stats: [] shared LoopStat, run_loop:[] bool, ilength: LoopLength) {
var loop_suite_run_info = getLoopSuiteRunInfo();
var loop_data = getLoopData();

Expand Down Expand Up @@ -471,7 +470,8 @@ module RunVectorizeOnlyRawLoops {
var val = 0.0;
ltimer.start();
for 0..#num_samples {
forall i in vectorizeOnly(0..(len-1):int(32)) with (+ reduce sumx) {
// TODO: this should have a reduce intent instead of a ref intent
foreach i in 0..(len-1):int(32) with (ref sumx) {
var x = x0 + i*h;
sumx += trap_int_func(x, y, xp, yp);
}
Expand Down
File renamed without changes.

0 comments on commit 6b925c6

Please sign in to comment.