https://bugs.kde.org/show_bug.cgi?id=383010

Hou, Ao-ping <bill200...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bill200...@gmail.com

--- Comment #18 from Hou, Ao-ping <bill200...@gmail.com> ---
Hello, 
I have patched the "AVX-512_prototype_v3" patch.
But I can not use this patch for _mm512_setr_pd(...)
Could you please help me to solve it ?

I encounter the following ERROR:

[elliot@blacksburg ~]$ avx512-valgrind ./aaa 
==4021== Memcheck, a memory error detector
==4021== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==4021== Using Valgrind-3.14.0.GIT and LibVEX; rerun with -h for copyright info
==4021== Command: ./aaa
==4021== 
dis_ESC_0F3A__EVEX - UNRECOGNIZED OPCODE 0x1A
==4021== Invalid read of size 4
==4021==    at 0x400AB6: simd_assign(int, double*, double*) (in
/home/elliot/aaa)
==4021==    by 0x400825: main (in /home/elliot/aaa)
==4021==  Address 0xfffffffffffffff1 is not stack'd, malloc'd or (recently)
free'd
==4021== 
==4021== 
==4021== Process terminating with default action of signal 11 (SIGSEGV):
dumping core
==4021==  Access not within mapped region at address 0xFFFFFFFFFFFFFFF1
==4021==    at 0x400AB6: simd_assign(int, double*, double*) (in
/home/elliot/aaa)
==4021==    by 0x400825: main (in /home/elliot/aaa)
==4021==  If you believe this happened as a result of a stack
==4021==  overflow in your program's main thread (unlikely but
==4021==  possible), you can try to increase the size of the
==4021==  main thread stack using the --main-stacksize= flag.
==4021==  The main thread stack size used in this run was 8388608.


And my code is:
#include <xmmintrin.h>
#include <emmintrin.h>
#include <immintrin.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <float.h>

#include <avx512fintrin.h>
#include <avx512dqintrin.h>
#include <avx512cdintrin.h>

typedef double real;
typedef int64_t integer;
typedef __m512d realVect ;
typedef integer intVec __attribute__ ((vector_size(512)));
#define VECTOR_SIZE 8
#define SHIFT_SIZE 3

#define modSize(a) (((a>>SHIFT_SIZE )+1)<< SHIFT_SIZE)
#define NRM_RAND_VALE (5.0 - 10.0*(real)(rand()%10000)/(real)10000.0)

real *new_real(int n)
{
        real *c = (real *)aligned_alloc(1024, sizeof(real)*modSize(n));
        if(c==NULL){
                fprintf(stderr, "%s Error --- Cannot allocate real
array\n",__FUNCTION__);
                exit(1);
        }
        return c;
}

integer *new_integer(int n)
{
        integer *c = (integer *)aligned_alloc(1024, sizeof(integer)*n);
        if(c==NULL){
                fprintf(stderr, "%s Error --- Cannot allocate int
array\n",__FUNCTION__);
                exit(1);
        }
        return c;
}

inline void simd_assign(int n, real *c, real *a)
{
        realVect *rvc=(realVect *)c;
        for(int i=0; i<n; i+=VECTOR_SIZE){
                rvc[i>>SHIFT_SIZE] = _mm512_setr_pd(a[i], a[i+1], a[i+2],
a[i+3], a[i+4], a[i+5], a[i+6], a[i+7]);
        }
}




int main(int argc, char *argv[])
{
        int N=100000;
        real *a=new_real(N);
        real *c=new_real(N);

        for(int i=0; i<N; i++)
                a[i] = NRM_RAND_VALE;

        simd_assign(N,c,a);
        for(int i=0;i<N; i++){
                if(a[i] != c[i]){
                        printf("%s vector assign FAIL %d --- %f !=
%f\n",argv[0],i,c[i],a[i]);
                        return 1;
                }
        }
        printf("PASS\n");
        return 0;
}


Elliot

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to