oneAPI-samples icon indicating copy to clipboard operation
oneAPI-samples copied to clipboard

Cannot override optimization level set for particle-diffusion sample

Open ghost opened this issue 3 years ago • 4 comments

Summary

particle-diffusion/src/CMakeLists.txt sets default optimization level to -O3, regardless of the CMAKE_BUILD_TYPE

Version

oneAPI Base Tookit 2021.4

Environment

Ubuntu 20.04 Coffee Lake / GEN9 graphics

Steps to reproduce

from particle-diffusion sample directory run: mkdir build cd build cmake -DCMAKE_BUILD_TYPE=DEBUG ..

Observed behavior

Running "cmake -DCMAKE_BUILD_TYPE=DEBUG .." results in both -O0 and -O3 specified in flags.make: CMakeFiles/motionsim.exe.dir/flags.make:CXX_FLAGS = -g -O0 -O3 -std=c++17 -g As the result, dpcpp seem to performs -O3 optimization, defeating the purpose of DEBUG build

Expected behavior

cmake uses -O0 -g compiler flags when CMAKE_BUILD_TYPE=DEBUG is set

ghost avatar Sep 16 '21 18:09 ghost

@Alberto-Villarreal -can you loo into this please

JoeOster avatar Sep 21 '21 08:09 JoeOster

@Alberto-Villarreal -Please comment on this

JoeOster avatar Oct 08 '21 18:10 JoeOster

OneSmpl_Team1 working on this.

troy818 avatar Apr 25 '23 01:04 troy818

(OneSmpl_Team1)

Now only use O3 for cmake.

troy818 avatar Apr 25 '23 01:04 troy818