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*
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
804 Discussions

ICX cannot find sinf16 even though mathimf is included

jboline
New Contributor I
558 Views

I'm trying to write a simple program, but for some reason the compiler cannot find sinf16.  My really simple test program is

#include <mathimf.h>

int main()
{
    _Float16 a;
    a = sinf16(1);
}

Using oneapi 2024.1.0 I try to build it with ICX but get an error that sinf16 is undeclared in spite of the fact it is defined in mathimf

jboline_0-1741905483060.png

What am I missing here?

 

0 Kudos
1 Solution
jboline
New Contributor I
498 Views

Ok, turns out this function is only valid for avx512fp16 architectures

View solution in original post

0 Kudos
2 Replies
jboline
New Contributor I
499 Views

Ok, turns out this function is only valid for avx512fp16 architectures

0 Kudos
Viet_H_Intel
Moderator
478 Views

Yes, will get "illegal instruction" if executed on non-support hardware. 

$ icx t4.c -D__AVX512FP16__ &&./a.out
Illegal instruction (core dumped)
$ cat t4.c
#include <mathimf.h>
#include<stdio.h>

int main()
{
_Float16 a;
a = sinf16(1);
printf ("a is %f\n",(float)a);
return 0;
}

 

0 Kudos
Reply