NO

Author Topic: Compiling using AVX2  (Read 1633 times)

Offline HellOfMice

  • Member
  • *
  • Posts: 105
  • Never be pleased, always improve
Compiling using AVX2
« on: November 05, 2024, 04:57:37 PM »
When compiling using AVX2, I had this message:
***************************************************
Building BrowseForFolder.obj.
Building Gray.obj.
Building Log.obj.
Building MemorySetTo0.obj.
Building Profile.obj.
Building Search.obj.
C:\Users\51966\Documents\# IA 2024\Search\Speed Test\Search.c(451): warning #2804: Consider changing type to 'size_t' for loop variable '_i'.
C:\Users\51966\Documents\# IA 2024\Search\Speed Test\Search.c(451): warning #2804: Consider changing type to 'size_t' for loop variable '_i'.
fatal error: Internal error: get_rule_number().
*** Error code: 1 ***
Done.
********************************************************
For CPU-Z I have the following CPU
Code: [Select]
CPU-Z TXT Report
-------------------------------------------------------------------------
CPU-Z version         2.11.2.x64

Processors
-------------------------------------------------------------------------
CPU Groups         1
CPU Group 0         16 threads, mask=0xFFFF

Number of sockets      1
Number of threads      16

Timers
-------------------------------------------------------------------------
   ACPI timer      3.580 MHz
   Perf timer      10.000 MHz
   Sys timer      1.000 KHz

Processors Information
-------------------------------------------------------------------------
Socket 1         ID = 0
   Number of cores      8 (max
   Number of threads   16 (max 16)
   Number of CCDs      1
   Manufacturer      AuthenticAMD
   Name         AMD Ryzen 7 Mobile 5700U
   Codename      Lucienne
   Specification      AMD Ryzen 7 5700U with Radeon Graphics         
   Package       Socket FP6
   CPUID         F.8.1
   Extended CPUID      17.68
   Core Stepping     
   Technology      7 nm
   Core Speed      1926.9 MHz
   Multiplier x Bus Speed   19.33 x 99.7 MHz
   Base frequency (cores)   99.7 MHz
   Instructions sets   MMX (+), SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, SSE4A, x86-64, AES, AVX, AVX2, FMA3, SHA
   Microcode Revision   0x8608107
   L1 Data cache      8 x 32 KB (8-way, 64-byte line)
   L1 Instruction cache   8 x 32 KB (8-way, 64-byte line)
   L2 cache      8 x 512 KB (8-way, 64-byte line)
   L3 cache      2 x 4 MB (16-way, 64-byte line)
   Max CPUID level      0000000Dh
   Max CPUID ext. level   80000020h
   FID/VID Control      yes
   # of P-States      3
   P-State         FID 0xA5A - VID 0x35 (18.00x - 1.219 V)
   P-State         FID 0xC66 - VID 0x60 (17.00x - 0.950 V)
   P-State         FID 0xE62 - VID 0x66 (14.00x - 0.912 V)

Software
-------------------------------------------------------------------------
Windows Version         Microsoft Windows 11  Home (x64), Version 23H2, Build 22631.4391
Windows Installation Date   10/26/2024
DirectX Version         12.0

Register Spaces
-------------------------------------------------------------------------
Register space         PCI
Register space         PCI #2
Register space         PCI Express, base address = 0x0F0000000
Register space         LPC, base address = 0x0CD0
Register space         SMBus, base address = 0x0B00

What can I do? Only SSE2?

Thanks

Philippe
--------------------------------
Kenavo

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
Re: Compiling using AVX2
« Reply #1 on: November 05, 2024, 06:58:25 PM »
C compiler problem, so rearrange code and test it without / with optimization.
Also try another compiler, like Clang, as it can give lot of hints for code problems.
May the source be with you

Offline HellOfMice

  • Member
  • *
  • Posts: 105
  • Never be pleased, always improve
Re: Compiling using AVX2
« Reply #2 on: November 05, 2024, 07:00:17 PM »
I only have Pelle's Compiler but I will try your advice
Thanks


Philippe
--------------------------------
Kenavo

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
Re: Compiling using AVX2
« Reply #3 on: November 05, 2024, 07:21:12 PM »
Example with Clang and Pelles C modified headers:
Code: [Select]
C:\code\PellesC\_Forum\_test\StructInfo_GDI+.c
(27,2): warning: format specifies type 'int' but the argument has type 'unsigned long long' [-Wformat]
        PRINTSIZE(GDIPLUSSTARTUPINPUT);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\code\PellesC\_Forum\_test\StructInfo_GDI+.c(14,58): note: expanded from macro 'PRINTSIZE'
#define PRINTSIZE(x)  printf("\n%-16s %d %Xh bytes\n",#x,sizeof(x),sizeof(x));
                                      ~~                 ^~~~~~~~~
C:\code\PellesC\_Forum\_test\StructInfo_GDI+.c(27,2): warning: format specifies type 'unsigned int' but the argument has type 'unsigned long long' [-Wformat]
        PRINTSIZE(GDIPLUSSTARTUPINPUT);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\code\PellesC\_Forum\_test\StructInfo_GDI+.c(14,68): note: expanded from macro 'PRINTSIZE'
#define PRINTSIZE(x)  printf("\n%-16s %d %Xh bytes\n",#x,sizeof(x),sizeof(x));
                                         ~~                        ^~~~~~~~~
C:\code\PellesC\_Forum\_test\StructInfo_GDI+.c(28,2): warning: cast to smaller integer type 'LONG' (aka 'long') from 'UINT32 *' (aka 'unsigned int *') [-Wpointer-to-int-cast]
        PRINTOFSSIZE(GDIPLUSSTARTUPINPUT,GdiplusVersion);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\code\PellesC\_Forum\_test\StructInfo_GDI+.c(15,67): note: expanded from macro 'PRINTOFSSIZE'
#define PRINTOFSSIZE(type,field) printf("%-16s +%Xh %Xh\n",#field,(LONG)&(((type *)0)->field),sizeof(((type *)0)->field));
                                                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\code\PellesC\_Forum\_test\StructInfo_GDI+.c(28,2): warning: format specifies type 'unsigned int' but the argument has type 'LONG' (aka 'long') [-Wformat]
        PRINTOFSSIZE(GDIPLUSSTARTUPINPUT,GdiplusVersion);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\code\PellesC\_Forum\_test\StructInfo_GDI+.c(15,67): note: expanded from macro 'PRINTOFSSIZE'
#define PRINTOFSSIZE(type,field) printf("%-16s +%Xh %Xh\n",#field,(LONG)&(((type *)0)->field),sizeof(((type *)0)->field));
                                                ~~                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\code\PellesC\_Forum\_test\StructInfo_GDI+.c(28,2): warning: format specifies type 'unsigned int' but the argument has type 'unsigned long long' [-Wformat]
        PRINTOFSSIZE(GDIPLUSSTARTUPINPUT,GdiplusVersion);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\code\PellesC\_Forum\_test\StructInfo_GDI+.c(15,95): note: expanded from macro 'PRINTOFSSIZE'
#define PRINTOFSSIZE(type,field) printf("%-16s +%Xh %Xh\n",#field,(LONG)&(((type *)0)->field),sizeof(((type *)0)->field));
                                                    ~~                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~
C:\code\PellesC\_Forum\_test\StructInfo_GDI+.c(29,2): warning: cast to smaller integer type 'LONG' (aka 'long') from 'void **' [-Wpointer-to-int-cast]
        PRINTOFSSIZE(GDIPLUSSTARTUPINPUT,DebugEventCallback);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\code\PellesC\_Forum\_test\StructInfo_GDI+.c(15,67): note: expanded from macro 'PRINTOFSSIZE'
#define PRINTOFSSIZE(type,field) printf("%-16s +%Xh %Xh\n",#field,(LONG)&(((type *)0)->field),sizeof(((type *)0)->field));
                                                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\code\PellesC\_Forum\_test\StructInfo_GDI+.c(29,2): warning: format specifies type 'unsigned int' but the argument has type 'LONG' (aka 'long') [-Wformat]
        PRINTOFSSIZE(GDIPLUSSTARTUPINPUT,DebugEventCallback);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\code\PellesC\_Forum\_test\StructInfo_GDI+.c(15,67): note: expanded from macro 'PRINTOFSSIZE'
#define PRINTOFSSIZE(type,field) printf("%-16s +%Xh %Xh\n",#field,(LONG)&(((type *)0)->field),sizeof(((type *)0)->field));
                                                ~~                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\code\PellesC\_Forum\_test\StructInfo_GDI+.c(29,2): warning: format specifies type 'unsigned int' but the argument has type 'unsigned long long' [-Wformat]
        PRINTOFSSIZE(GDIPLUSSTARTUPINPUT,DebugEventCallback);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\code\PellesC\_Forum\_test\StructInfo_GDI+.c(15,95): note: expanded from macro 'PRINTOFSSIZE'
#define PRINTOFSSIZE(type,field) printf("%-16s +%Xh %Xh\n",#field,(LONG)&(((type *)0)->field),sizeof(((type *)0)->field));
                                                    ~~                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~
C:\code\PellesC\_Forum\_test\StructInfo_GDI+.c(30,2): warning: cast to smaller integer type 'LONG' (aka 'long') from 'BOOL *' (aka 'int *') [-Wpointer-to-int-cast]
        PRINTOFSSIZE(GDIPLUSSTARTUPINPUT,SuppressBackgroundThread);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\code\PellesC\_Forum\_test\StructInfo_GDI+.c(15,67): note: expanded from macro 'PRINTOFSSIZE'
#define PRINTOFSSIZE(type,field) printf("%-16s +%Xh %Xh\n",#field,(LONG)&(((type *)0)->field),sizeof(((type *)0)->field));
                                                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\code\PellesC\_Forum\_test\StructInfo_GDI+.c(30,2): warning: format specifies type 'unsigned int' but the argument has type 'LONG' (aka 'long') [-Wformat]
        PRINTOFSSIZE(GDIPLUSSTARTUPINPUT,SuppressBackgroundThread);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\code\PellesC\_Forum\_test\StructInfo_GDI+.c(15,67): note: expanded from macro 'PRINTOFSSIZE'
#define PRINTOFSSIZE(type,field) printf("%-16s +%Xh %Xh\n",#field,(LONG)&(((type *)0)->field),sizeof(((type *)0)->field));
                                                ~~                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\code\PellesC\_Forum\_test\StructInfo_GDI+.c(30,2): warning: format specifies type 'unsigned int' but the argument has type 'unsigned long long' [-Wformat]
        PRINTOFSSIZE(GDIPLUSSTARTUPINPUT,SuppressBackgroundThread);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\code\PellesC\_Forum\_test\StructInfo_GDI+.c(15,95): note: expanded from macro 'PRINTOFSSIZE'
#define PRINTOFSSIZE(type,field) printf("%-16s +%Xh %Xh\n",#field,(LONG)&(((type *)0)->field),sizeof(((type *)0)->field));
                                                    ~~                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~
C:\code\PellesC\_Forum\_test\StructInfo_GDI+.c(31,2): warning: cast to smaller integer type 'LONG' (aka 'long') from 'BOOL *' (aka 'int *') [-Wpointer-to-int-cast]
        PRINTOFSSIZE(GDIPLUSSTARTUPINPUT,SuppressExternalCodecs);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\code\PellesC\_Forum\_test\StructInfo_GDI+.c(15,67): note: expanded from macro 'PRINTOFSSIZE'
#define PRINTOFSSIZE(type,field) printf("%-16s +%Xh %Xh\n",#field,(LONG)&(((type *)0)->field),sizeof(((type *)0)->field));
                                                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\code\PellesC\_Forum\_test\StructInfo_GDI+.c(31,2): warning: format specifies type 'unsigned int' but the argument has type 'LONG' (aka 'long') [-Wformat]
        PRINTOFSSIZE(GDIPLUSSTARTUPINPUT,SuppressExternalCodecs);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\code\PellesC\_Forum\_test\StructInfo_GDI+.c(15,67): note: expanded from macro 'PRINTOFSSIZE'
#define PRINTOFSSIZE(type,field) printf("%-16s +%Xh %Xh\n",#field,(LONG)&(((type *)0)->field),sizeof(((type *)0)->field));
                                                ~~                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\code\PellesC\_Forum\_test\StructInfo_GDI+.c(31,2): warning: format specifies type 'unsigned int' but the argument has type 'unsigned long long' [-Wformat]
        PRINTOFSSIZE(GDIPLUSSTARTUPINPUT,SuppressExternalCodecs);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\code\PellesC\_Forum\_test\StructInfo_GDI+.c(15,95): note: expanded from macro 'PRINTOFSSIZE'
#define PRINTOFSSIZE(type,field) printf("%-16s +%Xh %Xh\n",#field,(LONG)&(((type *)0)->field),sizeof(((type *)0)->field));
                                                    ~~                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~
24
 warnings and 2 errors generated.
Done.
May the source be with you

Offline HellOfMice

  • Member
  • *
  • Posts: 105
  • Never be pleased, always improve
Re: Compiling using AVX2
« Reply #4 on: November 05, 2024, 07:27:23 PM »
Merci I don't load the compiler
--------------------------------
Kenavo

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
Re: Compiling using AVX2
« Reply #5 on: November 06, 2024, 01:27:24 PM »
Merci I don't load the compiler
Only some of us needs several C compilers to verify code issues.
May the source be with you

Offline HellOfMice

  • Member
  • *
  • Posts: 105
  • Never be pleased, always improve
Re: Compiling using AVX2
« Reply #6 on: November 06, 2024, 01:31:43 PM »
Hi Timo,


Just some words


I am reading AMD docs because I would like to compute average, deviation and std deviation.
But I can't find any instruction that insert 0 between rgb values and like this I could compute a sum
my program is slow when computing them in C
I tried the profiler and passed from 2.2% to 0.5%
I would like to try with SSE2.. SSE4.1 instructions
have you any idea?


Thank you for your help


Philippe
--------------------------------
Kenavo