Bad build with cmake on windows
- Dominant language
- LLVM
- Stars
- 1.5k
- Forks
- 854
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 137
Description
### Describe the bug
I`m trying to build simple program, that adds two vectors. And it is ok when I use cmd for compilation. But with cmake it falls in runtime with this error, when i call queue.submit:
```
Exception: Exception 0xe06d7363 encountered at address 0x7fff5a72fb4c
Exception: Exception 0x80000003 encountered at address 0x7ffe28d0d0eb
Exception: Exception 0xc0000005 encountered at address 0x7ffe28d0d0fe: Access violation reading location 0x00000020
```
This is my cmake file:
```cmake
cmake_minimum_required(VERSION 3.30 FATAL_ERROR)
project(main LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 23)
find_package(IntelSYCL REQUIRED)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsycl -fsycl-targets=nvptx64-nvidia-cuda -fsycl-unnamed-lambda")
add_executable(main main.cpp)
```
and main.cpp:
```c++
#include
// #include
#include
class vector_addition;
int main(int, char**) {
sycl::float4 a = { 1.0, 2.0, 3.0, 4.0 };
sycl::float4 b = { 4.0, 3.0, 2.0, 1.0 };
sycl::float4 c = { 0.0, 0.0, 0.0, 0.0 };
// sycl::device device(sycl::gpu_selector_v);
sycl::queue queue(sycl::device{sycl::gpu_selector_v});
std::cout << "Running on "
<< queue.get_device().get_info()
<< "\n";
{
sycl::buffer a_sycl(&a, sycl::range<1>(1));
sycl::buffer b_sycl(&b, sycl::range<1>(1));
sycl::buffer c_sycl(&c, sycl::range<1>(1));
queue.submit([&] (sycl::handler& cgh) {
auto a_acc = a_sycl.get_access(cgh);
auto b_acc = b_sycl.get_access(cgh);
auto c_acc = c_sycl.get_access(cgh);
cgh.single_task([=] () {
c_acc[0] = a_acc[0] + b_acc[0];
});
});
}
std::cout << " A { " << a.x() << ", " << a.y() << ", " << a.z() << ", " << a.w() << " }\n"
<< "+ B { " << b.x() << ", " << b.y() << ", " << b.z() << ", " << b.w() << " }\n"
<< "------------------\n"
<< "= C { " << c.x() << ", " << c.y() << ", " << c.z() << ", " << c.w() << " }"
<< std::endl;
return 0;
}
```
### To reproduce
1. Include a code snippet that is as short as possible
2. Specify the command which should be used to compile the program
3. Specify the command which should be used to launch the program
4. Indicate what is wrong and what was expected
### Environment
- OS: Windows
- Target device and vendor: NVidia 3050
- DPC++ version: 2025
### Additional context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.