Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. Inlining Failed AVX-512
Qt 6.11 is out! See what's new in the release blog

Inlining Failed AVX-512

Scheduled Pinned Locked Moved Unsolved C++ Gurus
7 Posts 3 Posters 4.4k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    ofmrew
    wrote on last edited by
    #1

    I am trying to use AVX-512 but I get the inlining failed error. I am using Qt6 Creator and my processor is 11700 which supports AVX-512. I use #include <immintrin.h>, but I must be missing a compiler flag. Any suggestions or fixes? Thanks.

    kshegunovK 1 Reply Last reply
    0
    • O ofmrew

      I am trying to use AVX-512 but I get the inlining failed error. I am using Qt6 Creator and my processor is 11700 which supports AVX-512. I use #include <immintrin.h>, but I must be missing a compiler flag. Any suggestions or fixes? Thanks.

      kshegunovK Offline
      kshegunovK Offline
      kshegunov
      Moderators
      wrote on last edited by kshegunov
      #2
      #include <x86intrin.h>
      

      Also for gcc either -mnative or at the very least -mavx512f.

      ... also provide the full error texts and the relevant code, beside compiler/environment information.

      Read and abide by the Qt Code of Conduct

      1 Reply Last reply
      0
      • O Offline
        O Offline
        ofmrew
        wrote on last edited by kshegunov
        #3

        @kshegunov said in Inlining Failed AVX-512:

        -mnative

        Thanks for the fast response. Anything else I can provide.
        CONFIG += c++11 -mavx512f -mnative

        Program

           int n = 512;
            double c[8*8];
            double b[8*8];
        
            __m512d sv = _mm512_set1_pd(1.0);
            for (int i = 0;i<n/8 ;i++ ) {
                __m512d cv = _mm512_loadu_pd(&c[8*i]);
                __m512d bv = _mm512_loadu_pd(&b[8*i]);
                __m512d t1 = _mm512_mul_pd(bv, sv);
                        cv = _mm512_add_pd(t1, cv);
                        _mm512_store_pd(&c[8*i], cv);
            }
        

        Errors

        D:\QtPrograms\TryIntrinsics2\mainwindow.cpp:17: warning: AVX512F vector return without AVX512F enabled changes the ABI [-Wpsabi]
        ..\TryIntrinsics2\mainwindow.cpp:17:36: warning: AVX512F vector return without AVX512F enabled changes the ABI [-Wpsabi]
             __m512d sv = _mm512_set1_pd(1.0);
        
        
                                            ^D:\Qt\Tools\mingw810_64\lib\gcc\x86_64-w64-mingw32\8.1.0\include\avx512fintrin.h:190: error: inlining failed in call to always_inline '__m512d _mm512_set1_pd(double)': target specific option mismatch
                                            
                                            In file included from D:/Qt/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/immintrin.h:45,
                                            
                                                             from ..\TryIntrinsics2\mainwindow.h:6,
                                            
                                                             from ..\TryIntrinsics2\mainwindow.cpp:1:
                                            
                                            D:/Qt/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/avx512fintrin.h:190:1: error: inlining failed in call to always_inline '__m512d _mm512_set1_pd(double)': target specific option mismatch
                                            
                                             _mm512_set1_pd (double __A)
                                            
                                             ^~~~~~~~~~~~~~
                                            
                                            ..\TryIntrinsics2\mainwindow.cpp:17:32: note: called from here
                                            
                                                 __m512d sv = _mm512_set1_pd(1.0);
                                            
                                                              ~~~~~~~~~~~~~~^~~~~
        
        1 Reply Last reply
        0
        • O Offline
          O Offline
          ofmrew
          wrote on last edited by
          #4

          I should have added that the OS is Win 11 and the compiler is MinGW 64

          1 Reply Last reply
          0
          • kshegunovK Offline
            kshegunovK Offline
            kshegunov
            Moderators
            wrote on last edited by
            #5

            Please format your posts.

            CONFIG += c++11 -mavx512f -mnative
            

            doesn't do anything.
            -mnative and -mavx512f are flags that should be passed to the compiler. They've nothing to do with the CONFIG variable of a project file. Here:
            https://doc.qt.io/qt-5/qmake-variable-reference.html#qmake-cxxflags

            Read and abide by the Qt Code of Conduct

            1 Reply Last reply
            1
            • O Offline
              O Offline
              ofmrew
              wrote on last edited by
              #6

              I added:
              QMAKE_CXXFLAGS += -mavx512f -mnative

              and the compile had this error

              :-1: error: error: unrecognized command line option '-mnative'

              I removed -mnative and it compiled with no errors.

              I have used Qt for many years and I learned something new. Thanks for the help.

              K 1 Reply Last reply
              0
              • O ofmrew

                I added:
                QMAKE_CXXFLAGS += -mavx512f -mnative

                and the compile had this error

                :-1: error: error: unrecognized command line option '-mnative'

                I removed -mnative and it compiled with no errors.

                I have used Qt for many years and I learned something new. Thanks for the help.

                K Offline
                K Offline
                Konstantin Tokarev
                wrote on last edited by
                #7

                @ofmrew said in Inlining Failed AVX-512:

                -mnative

                Correct spelling of this options is -march=native

                1 Reply Last reply
                1

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved