Skip to content

Commit

Permalink
Deduplicate empty.sycl file
Browse files Browse the repository at this point in the history
The current setup uses `try_compile` on the source file `empty.sycl`
twice, which leads to the following error when using Ninja, enabling
SYCL, and having the tests enabled:

```
error: sycl/cmake/empty.sycl is defined as an output multiple times
```

This commit takes the path of least resistance and clones the file into
`empty_ubsan.sycl` so that these compile tests no longer collide.
  • Loading branch information
stephenswat authored and krasznaa committed Aug 7, 2024
1 parent eaf551f commit daf7c39
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/sycl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ vecmem_add_test( sycl
include( CheckCXXCompilerFlag )
check_cxx_compiler_flag( "-fsanitize=undefined" VECMEM_HAVE_UBSAN )
vecmem_check_sycl_code_compiles( VECMEM_HAVE_SYCL_UBSAN
"${CMAKE_CURRENT_SOURCE_DIR}/../../sycl/cmake/empty.sycl"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/empty_ubsan.sycl"
CMAKE_FLAGS -DCOMPILE_DEFINITIONS=-fsanitize=undefined )
if( VECMEM_HAVE_UBSAN AND VECMEM_HAVE_SYCL_UBSAN )
target_compile_options( vecmem_test_sycl PRIVATE "-fsanitize=undefined" )
Expand Down
13 changes: 13 additions & 0 deletions tests/sycl/cmake/empty_ubsan.sycl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* VecMem project, part of the ACTS project (R&D line)
*
* (c) 2024 CERN for the benefit of the ACTS project
*
* Mozilla Public License Version 2.0
*/

// SYCL include(s).
#include <CL/sycl.hpp>

int main() {
return 0;
}

0 comments on commit daf7c39

Please sign in to comment.