-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Exactly as vecmem_setup_core(...), it is meant to set up the public flags for vecmem::sycl. Such that they could be (re-)evaluated in the context of the client project.
- Loading branch information
Showing
3 changed files
with
55 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# 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 | ||
|
||
# VecMem include(s). | ||
include( vecmem-check-language ) | ||
include( vecmem-check-sycl-source-compiles ) | ||
|
||
# CMake include(s). | ||
include( CheckCXXSourceCompiles ) | ||
|
||
# Helper function setting up the public definitions for vecmem::sycl | ||
# | ||
# Usage: vecmem_setup_sycl( vecmem::sycl ) | ||
# | ||
function( vecmem_setup_sycl libName ) | ||
|
||
# Check if a SYCL compiler is available. | ||
vecmem_check_language( SYCL ) | ||
|
||
# Set the SYCL definitions only if the build system knows about SYCL. | ||
if( CMAKE_SYCL_COMPILER ) | ||
|
||
# Check if sycl::local_accessor is available. | ||
vecmem_check_sycl_source_compiles( " | ||
#include <CL/sycl.hpp> | ||
int main() { | ||
cl::sycl::queue queue; | ||
queue.submit([](cl::sycl::handler& h) { | ||
cl::sycl::local_accessor<int> dummy(10, h); | ||
(void)dummy; | ||
}).wait_and_throw(); | ||
return 0; | ||
} | ||
" VECMEM_HAVE_SYCL_LOCAL_ACCESSOR ) | ||
if( VECMEM_HAVE_SYCL_LOCAL_ACCESSOR ) | ||
target_compile_definitions( ${libName} INTERFACE | ||
$<BUILD_INTERFACE:VECMEM_HAVE_SYCL_LOCAL_ACCESSOR> ) | ||
endif() | ||
|
||
endif() | ||
|
||
endfunction( vecmem_setup_sycl ) |