forked from OpenMathLib/OpenBLAS
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request OpenMathLib#4419 from martin-frbg/issue4413
[WIP] Add fixes and utests for ZSCAL with NaN or Inf arguments
- Loading branch information
Showing
15 changed files
with
172 additions
and
42 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
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
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
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 |
---|---|---|
|
@@ -98,7 +98,7 @@ | |
fcomip %st(1), %st | ||
ffreep %st(0) | ||
jne .L30 | ||
|
||
jp .L30 | ||
EMMS | ||
|
||
pxor %mm0, %mm0 | ||
|
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 |
---|---|---|
|
@@ -98,6 +98,7 @@ | |
xorps %xmm7, %xmm7 | ||
comisd %xmm0, %xmm7 | ||
jne .L100 | ||
jp .L100 | ||
|
||
comisd %xmm1, %xmm7 | ||
jne .L100 | ||
|
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 |
---|---|---|
|
@@ -82,6 +82,7 @@ | |
pxor %xmm15, %xmm15 | ||
comisd %xmm0, %xmm15 | ||
jne .L100 | ||
jp .L100 | ||
|
||
comisd %xmm1, %xmm15 | ||
jne .L100 | ||
|
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 |
---|---|---|
|
@@ -15,6 +15,7 @@ else () | |
test_dsdot.c | ||
test_dnrm2.c | ||
test_swap.c | ||
test_zscal.c | ||
) | ||
endif () | ||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#include "openblas_utest.h" | ||
#include <cblas.h> | ||
#ifdef BUILD_COMPLEX16 | ||
|
||
#ifndef NAN | ||
#define NAN 0.0/0.0 | ||
#endif | ||
#ifndef INFINITY | ||
#define INFINITY 1.0/0.0 | ||
#endif | ||
|
||
CTEST(zscal, i_nan) | ||
{ | ||
double i[] = {0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1 }; | ||
double nan[] = {NAN,0, NAN,0, NAN,0, NAN,0, NAN,0, NAN,0, NAN,0, NAN,0, NAN,0, NAN,0}; | ||
cblas_zscal(9, i, &nan, 1); | ||
ASSERT_TRUE(isnan(nan[0])); | ||
ASSERT_TRUE(isnan(nan[1])); | ||
ASSERT_TRUE(isnan(nan[16])); | ||
ASSERT_TRUE(isnan(nan[17])); | ||
} | ||
|
||
CTEST(zscal, nan_i) | ||
{ | ||
double i[] = {0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1 }; | ||
double nan[] = {NAN,0, NAN,0, NAN,0, NAN,0, NAN,0, NAN,0, NAN,0, NAN,0, NAN,0, NAN,0}; | ||
cblas_zscal(9, &nan, &i, 1); | ||
ASSERT_TRUE(isnan(i[0])); | ||
ASSERT_TRUE(isnan(i[1])); | ||
ASSERT_TRUE(isnan(i[16])); | ||
ASSERT_TRUE(isnan(i[17])); | ||
} | ||
|
||
CTEST(zscal, i_inf) | ||
{ | ||
double i[] = {0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1 }; | ||
double inf[] = {INFINITY, 0, INFINITY,0, INFINITY,0, INFINITY,0, INFINITY,0, INFINITY,0, INFINITY,0, INFINITY,0, INFINITY,0}; | ||
cblas_zscal(9, i, &inf, 1); | ||
ASSERT_TRUE(isnan(inf[0])); | ||
ASSERT_TRUE(isinf(inf[1])); | ||
ASSERT_TRUE(isnan(inf[16])); | ||
ASSERT_TRUE(isinf(inf[17])); | ||
} | ||
|
||
CTEST(zscal, inf_i) | ||
{ | ||
double i[] = {0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1 }; | ||
double inf[] = {INFINITY, 0, INFINITY,0, INFINITY,0, INFINITY,0, INFINITY,0, INFINITY,0, INFINITY,0, INFINITY,0, INFINITY,0}; | ||
cblas_zscal(9, &inf, &i, 1); | ||
ASSERT_TRUE(isnan(i[0])); | ||
ASSERT_TRUE(isinf(i[1])); | ||
ASSERT_TRUE(isnan(i[16])); | ||
ASSERT_TRUE(isinf(i[17])); | ||
} | ||
|
||
#endif |
Oops, something went wrong.