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*

Detecting underfined behavior with ICPX

peizhao
Beginner
897 Views

I've encountered undefined behavior in my SYCL application, leading to incorrect results when compiled with the -O2 option. I attempted to detect this using a sanitizer, configuring my CMake file with compile options like:

 

   add_compile_options(-Wall -g -O2 -fsanitize=undefined)
      set(SYCL_FLAGS "-fsycl"
         "-fsycl-targets=spir64_x86_64"
         "-fsycl-unnamed-lambda"
         "-Wno-linker-warnings")
 
.......
target_link_libraries(-fsanitize=undefined)
 
However, during the build stage, I received a warning  icpx: warning: ignoring '-fsanitize=undefined' option as it is not currently supported for target 'spir64_x86_64-unknown-unknown' [-Woption-ignored]. 
 
How can I enable a sanitizer with ICPX for my 12th Gen Intel® Core™ i9-12900H CPU?
 
 
 
 

 

 

0 Kudos
1 Reply
Alex_Y_Intel
Moderator
499 Views

-fsanitize=undefined and -fsycl-targets=spir64_x86_64 options cannot be used together. you may want to take off -fsycl-targets=spir64_x86_64, depending on what you want to achieve. 

0 Kudos
Reply