oneapi-src / oneapi-src/oneAPI-samples
Cannot override optimization level set for particle-diffusion sample
@JoeOster is already working on this.
Since Sep 21, 2021.
- Dominant language
- C++
- Stars
- 1.2k
- Forks
- 745
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.