Browse Source

Adapt utests for builds supportin only some variable types

tags/v0.3.11^2
Martin Kroeker GitHub 5 years ago
parent
commit
63d7dad04c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 15 deletions
  1. +2
    -15
      utest/test_dsdot.c
  2. +6
    -0
      utest/test_fork.c

+ 2
- 15
utest/test_dsdot.c View File

@@ -32,7 +32,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**********************************************************************************/ **********************************************************************************/


#include "openblas_utest.h" #include "openblas_utest.h"
#if defined(BUILD_SINGLE) && defined(BUILD_DOUBLE)
CTEST(dsdot,dsdot_n_1) CTEST(dsdot,dsdot_n_1)
{ {
float x= 0.172555164F; float x= 0.172555164F;
@@ -47,17 +47,4 @@ CTEST(dsdot,dsdot_n_1)
ASSERT_DBL_NEAR_TOL(res2, res1, DOUBLE_EPS); ASSERT_DBL_NEAR_TOL(res2, res1, DOUBLE_EPS);


} }

CTEST(dsdot,dsdot_n_2)
{
float x[] = {0.1F, 0.2F, 0.3F, 0.4F, 0.5F, 0.6F, 0.7F, 0.8F};
float y[] = {0.1F, 0.2F, 0.3F, 0.4F, 0.5F, 0.6F, 0.7F, 0.8F};
blasint incx=1;
blasint incy=1;
blasint n=8;

double res1=0.0f, res2= 2.0400000444054616;

res1=BLASFUNC(dsdot)(&n, &x, &incx, &y, &incy);
ASSERT_DBL_NEAR_TOL(res2, res1, DOUBLE_EPS);
}
#endif

+ 6
- 0
utest/test_fork.c View File

@@ -48,6 +48,7 @@ void* xmalloc(size_t n)
} }
} }


#ifdef BUILD_DOUBLE
void check_dgemm(double *a, double *b, double *result, double *expected, blasint n) void check_dgemm(double *a, double *b, double *result, double *expected, blasint n)
{ {
char trans1 = 'T'; char trans1 = 'T';
@@ -59,9 +60,13 @@ void check_dgemm(double *a, double *b, double *result, double *expected, blasint
ASSERT_DBL_NEAR_TOL(expected[i], result[i], DOUBLE_EPS); ASSERT_DBL_NEAR_TOL(expected[i], result[i], DOUBLE_EPS);
} }
} }
#endif


CTEST(fork, safety) CTEST(fork, safety)
{ {
#ifndef BUILD_DOUBLE
exit(0);
#else
blasint n = 1000; blasint n = 1000;
int i; int i;


@@ -124,4 +129,5 @@ CTEST(fork, safety)
ASSERT_EQUAL(wait_pid, fork_pid); ASSERT_EQUAL(wait_pid, fork_pid);
ASSERT_EQUAL(0, WEXITSTATUS (child_status)); ASSERT_EQUAL(0, WEXITSTATUS (child_status));
} }
#endif
} }

Loading…
Cancel
Save