Skip to content
Permalink
Browse files

Merge pull request #2134 from tylerjereddy/skylake_regress_guard_may14

TST: add SkylakeX AVX512 CI test
  • Loading branch information...
martin-frbg committed May 15, 2019
2 parents 9208ab8 + a211bc9 commit d8d568248143a2ec85d43a5eec44256efcecb17d
Showing with 76 additions and 0 deletions.
  1. +24 −0 azure-pipelines.yml
  2. +1 −0 utest/CMakeLists.txt
  3. +1 −0 utest/Makefile
  4. +50 −0 utest/test_kernel_regress.c
@@ -25,3 +25,27 @@ jobs:
make -C utest $COMMON_FLAGS $BTYPE" > Dockerfile
docker build .
displayName: Run manylinux1 docker build
- job: Intel_SDE_skx
pool:
vmImage: 'ubuntu-16.04'
steps:
- script: |
# at the time of writing the available Azure Ubuntu vm image
# does not support AVX512VL, so use more recent LTS version
echo "FROM ubuntu:bionic
COPY . /tmp/openblas
RUN apt-get -y update && apt-get -y install \\
cmake \\
gfortran \\
make \\
wget
RUN mkdir /tmp/SDE && cd /tmp/SDE && \\
mkdir sde-external-8.35.0-2019-03-11-lin && \\
wget --quiet -O sde-external-8.35.0-2019-03-11-lin.tar.bz2 https://www.dropbox.com/s/fopsnzj67572sj5/sde-external-8.35.0-2019-03-11-lin.tar.bz2?dl=0 && \\
tar -xjvf sde-external-8.35.0-2019-03-11-lin.tar.bz2 -C /tmp/SDE/sde-external-8.35.0-2019-03-11-lin --strip-components=1
RUN cd /tmp/openblas && CC=gcc make QUIET_MAKE=1 DYNAMIC_ARCH=1 NUM_THREADS=32 BINARY=64
CMD cd /tmp/openblas && echo 0 > /proc/sys/kernel/yama/ptrace_scope && CC=gcc OPENBLAS_VERBOSE=2 /tmp/SDE/sde-external-8.35.0-2019-03-11-lin/sde64 -cpuid_in /tmp/SDE/sde-external-8.35.0-2019-03-11-lin/misc/cpuid/skx/cpuid.def -- make -C utest DYNAMIC_ARCH=1 NUM_THREADS=32 BINARY=64" > Dockerfile
docker build -t intel_sde .
# we need a privileged docker run for sde process attachment
docker run --privileged intel_sde
displayName: 'Run AVX512 SkylakeX docker build / test'
@@ -38,6 +38,7 @@ if (NOT NO_LAPACK)
set(OpenBLAS_utest_src
${OpenBLAS_utest_src}
test_potrs.c
test_kernel_regress.c
)
endif()

@@ -13,6 +13,7 @@ OBJS=utest_main.o test_amax.o test_rotmg.o test_axpy.o test_dotu.o test_dsdot.o

ifneq ($(NO_LAPACK), 1)
OBJS += test_potrs.o
OBJS += test_kernel_regress.o
endif

#this does not work with OpenMP nor with native Windows or Android threads
@@ -0,0 +1,50 @@
#include "openblas_utest.h"
#include <stdio.h>
#include <stdlib.h>
#include <cblas.h>

#define LAPACK_ROW_MAJOR 101
blasint LAPACKE_dgesvd( blasint matrix_layout, char jobu, char jobvt,
blasint m, blasint n, double* a,
blasint lda, double* s, double* u, blasint ldu,
double* vt, blasint ldvt, double* superb );


#define DATASIZE 100

double s[DATASIZE];
double u[DATASIZE*DATASIZE];
double vt[DATASIZE*DATASIZE];
double X[DATASIZE*DATASIZE];
double superb[DATASIZE];
double tmp[DATASIZE*DATASIZE];
double m[DATASIZE*DATASIZE];

CTEST(kernel_regress,skx_avx)
{
double norm;
int i, j, info;
srand(0);
for (i = 0; i < DATASIZE*DATASIZE; i++) {
m[i] = (rand()+0.0)/RAND_MAX * 10;
tmp[i] = m[i];
}

info = LAPACKE_dgesvd( LAPACK_ROW_MAJOR, 'A', 'A', DATASIZE, DATASIZE, m, DATASIZE,
s, u, DATASIZE, vt, DATASIZE, superb);

for (i = 0; i < DATASIZE; i++) {
for (j = 0; j < DATASIZE; j++) {
u[i*DATASIZE+j] = u[i*DATASIZE+j]*s[j];
}
}
cblas_dgemm(CblasRowMajor, CblasNoTrans, CblasNoTrans,
DATASIZE, DATASIZE, DATASIZE, 1, u, DATASIZE, vt, DATASIZE, 0, X, DATASIZE);

for (i = 0; i < DATASIZE*DATASIZE; i++) {
X[i] = X[i] - tmp[i];
}

norm = cblas_dnrm2(DATASIZE*DATASIZE, X, 1);
ASSERT_DBL_NEAR_TOL(0.0, norm, 1e-10);
}

0 comments on commit d8d5682

Please sign in to comment.
You can’t perform that action at this time.