Intel® oneAPI DPC++/C++ Compiler
Talk to fellow users of Intel® oneAPI DPC++/C++ Compiler and companion tools like Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and Intel® Distribution for GDB*
744 Discussions

Compiler Bug: ICX crashes with -O2 with __bf16

crocix
Novice
1,959 Views

Compiling:

 

 

#include <stdlib.h>
#include <stdio.h>

#define M 4

__bf16 bf16test(__bf16* a){

    __bf16 r = a[0]*a[1] - a[1]*a[2];
    //__bf16 r = a[0]*a[1];
    

    return r;
}


int main()
{
    srandom(12345678);
    
    __bf16 ab[M];

    for (long i = 0; i<M; i++){
        ab[i] = (__bf16) (random()/((double) RAND_MAX));
    }

    __bf16 rb = bf16test(ab);
    printf("Value bf16:    %f\n", (double) rb);

    return 0;
}

 

 with

 

icx -O2 -march=sapphirerapids

 

makes the compiler (OneApi2024.0.0) crash with the error in the attached. You can use godbolt https://godbolt.org/ to reproduce it.

 

0 Kudos
1 Solution
Viet_H_Intel
Moderator
1,837 Views

This is a known issue and has been addressed. I checked our internal compiler and confirmed it worked.

$ icx -O2 -march=sapphirerapids t2.c -c
$

View solution in original post

0 Kudos
3 Replies
Alex_Y_Intel
Moderator
1,845 Views

This issue has been escalated to our engineers and we'll work on it internally and come back with update when we reach the conclusion. 

0 Kudos
Viet_H_Intel
Moderator
1,838 Views

This is a known issue and has been addressed. I checked our internal compiler and confirmed it worked.

$ icx -O2 -march=sapphirerapids t2.c -c
$

0 Kudos
crocix
Novice
1,824 Views

I confirm the issue has been fixed in oneAPI2024.1.0.

 

Thanks!

0 Kudos
Reply