Skip to content

Commit

Permalink
formatting and update to CMake section of documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
will-saunders-ukaea committed Nov 27, 2024
1 parent 6c98a02 commit 0cb8a54
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
6 changes: 6 additions & 0 deletions docs/sphinx/source/guide-user/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ These downstream implementations should pass CMake variables or compilers at con
When a SYCL implementation is passed to NESO-Particles itself then it is used to build the tests.
Please read the section :ref:`device-aware-mpi` for more information relating to device aware MPI.

CXX Standard
------------

Although we explicitly set C++17 as the required C++ version on the NESO-Particles interface target, CMake may not pass this requirement down onto targets using NESO-Particles.
Downstream projects may need to explicitly set the required C++ standard to C++17.

Installing
==========

Expand Down
3 changes: 2 additions & 1 deletion include/neso_particles/loop/particle_loop_iteration_set.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,8 @@ class ParticleLoopBlockIterationSet {
const std::size_t max_num_blocks_per_workgroup =
(num_bytes_local == 0) ? local_size
: local_mem_size / num_bytes_per_block;
local_size = std::min(get_prev_power_of_two(max_num_blocks_per_workgroup), local_size);
local_size = std::min(get_prev_power_of_two(max_num_blocks_per_workgroup),
local_size);
NESOASSERT(local_size * stride * num_bytes_local <= local_mem_size,
"Failure to determine a local size for iteration set.");
return local_size;
Expand Down
24 changes: 10 additions & 14 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,11 @@ foreach(TEST ${TEST_SRCS})
add_sycl_to_target(TARGET ${TEST_NAME} SOURCES ${TEST_SOURCES})
gtest_add_tests(TARGET ${TEST_NAME})

set_target_properties(${TEST_NAME}
PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF
)

set_target_properties(
${TEST_NAME}
PROPERTIES CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF)

endforeach()

Expand All @@ -111,13 +109,11 @@ target_compile_definitions(${EXECUTABLE}
PRIVATE CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX})
target_compile_options(${EXECUTABLE} PRIVATE "-Wpedantic;-Wall;-Wextra")

set_target_properties(${EXECUTABLE}
PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF
)

set_target_properties(
${EXECUTABLE}
PROPERTIES CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF)

# define the test executable as a sycl target
add_sycl_to_target(TARGET ${EXECUTABLE} SOURCES ${TEST_MAIN} ${TEST_LIST})
Expand Down

0 comments on commit 0cb8a54

Please sign in to comment.