forked from chapel-lang/chapel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix sinLUT tests (chapel-lang#24547)
Fixes the .good files for the sinLUT tests I added. These were relying on random numbers with a seed that varied. This PR passes a seed value to `srand` that is constant. Also, due to platform differences in the `rand` algorithm, this PR adds a PREDIFF to validate that Calculated and Lookup give the same answer, since putting just the value returned in the good file is not portable. tested on MacOS and Linux, with and without comm [Reviewed by @benharsh]
- Loading branch information
Showing
11 changed files
with
81 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env bash | ||
|
||
cp $2 $2.prediff.tmp | ||
> $2 | ||
|
||
# check that Chapel Calculated == Chapel Lookup | ||
calc=`sed '1q;d' $2.prediff.tmp | sed 's/.*: //'` | ||
lookup=`sed '2q;d' $2.prediff.tmp | sed 's/.*: //'` | ||
if [ "$calc" = "$lookup" ]; then | ||
echo "Chapel Calculated == Chapel Lookup" >> $2 | ||
else | ||
echo "Chapel Calculated != Chapel Lookup" >> $2 | ||
fi | ||
# check that C Caclulated == C Lookup | ||
calc=`sed '3q;d' $2.prediff.tmp | sed 's/.*: //'` | ||
lookup=`sed '4q;d' $2.prediff.tmp | sed 's/.*: //'` | ||
if [ "$calc" = "$lookup" ]; then | ||
echo "C Calculated == C Lookup" >> $2 | ||
else | ||
echo "C Calculated != C Lookup" >> $2 | ||
fi | ||
|
||
rm $2.prediff.tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
float c_sin(unsigned int size, int iterations, float* resArray); | ||
float c_sin(unsigned int size, int iterations, unsigned int seed, float* resArray); | ||
void fillTable(unsigned int size); | ||
float c_table(unsigned int size, int iterations, float* resArray); | ||
float c_table(unsigned int size, int iterations, unsigned int seed, float* resArray); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
Chapel Calculated: -1.2311 | ||
Chapel Lookup: -1.2311 | ||
C Calculated: -1.2311 | ||
C Lookup: -1.2311 | ||
Chapel Calculated == Chapel Lookup | ||
C Calculated == C Lookup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
Chapel Calculated: -1.2311 | ||
Chapel Lookup: -1.2311 | ||
C Calculated: -1.2311 | ||
C Lookup: -1.2311 | ||
Chapel Calculated == Chapel Lookup | ||
C Calculated == C Lookup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
Chapel Calculated: -1.2311 | ||
Chapel Lookup: -1.2311 | ||
C Calculated: -1.2311 | ||
C Lookup: -1.2311 | ||
Chapel Calculated == Chapel Lookup | ||
C Calculated == C Lookup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
Chapel Calculated: -1.2311 | ||
Chapel Lookup: -1.2311 | ||
C Calculated: -1.2311 | ||
C Lookup: -1.2311 | ||
Chapel Calculated == Chapel Lookup | ||
C Calculated == C Lookup |