Skip to content

Commit a284198

Browse files
pre commit
1 parent d64874f commit a284198

File tree

16 files changed

+62
-70
lines changed

16 files changed

+62
-70
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,4 +337,4 @@ if(DETRAY_BUILD_TUTORIALS)
337337
endif()
338338

339339
# Set up the packaging of the project.
340-
include(detray-packaging)
340+
include(detray-packaging)

cmake/detray-compiler-options-hip.cmake

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,39 @@ cmake_minimum_required(VERSION 3.21)
99
if(PROJECT_IS_TOP_LEVEL)
1010
include(detray-functions)
1111

12-
1312
#find HIP
1413
find_package(HIP REQUIRED)
1514
# Basic flags for all build modes.
16-
if( ( "${CMAKE_HIP_PLATFORM}" STREQUAL "hcc" ) OR
17-
( "${CMAKE_HIP_PLATFORM}" STREQUAL "amd" ) )
18-
detray_add_flag( CMAKE_HIP_FLAGS "-Wall" )
19-
detray_add_flag( CMAKE_HIP_FLAGS "-Wextra" )
20-
detray_add_flag( CMAKE_HIP_FLAGS "-Wshadow" )
21-
detray_add_flag( CMAKE_HIP_FLAGS "-Wunused-local-typedefs" )
22-
detray_add_flag( CMAKE_HIP_FLAGS "-pedantic" )
15+
if(
16+
("${CMAKE_HIP_PLATFORM}" STREQUAL "hcc")
17+
OR ("${CMAKE_HIP_PLATFORM}" STREQUAL "amd")
18+
)
19+
detray_add_flag( CMAKE_HIP_FLAGS "-Wall" )
20+
detray_add_flag( CMAKE_HIP_FLAGS "-Wextra" )
21+
detray_add_flag( CMAKE_HIP_FLAGS "-Wshadow" )
22+
detray_add_flag( CMAKE_HIP_FLAGS "-Wunused-local-typedefs" )
23+
detray_add_flag( CMAKE_HIP_FLAGS "-pedantic" )
2324
endif()
2425
# Generate debug symbols for the device code as well in a debug build.
25-
if( ( "${CMAKE_HIP_PLATFORM}" STREQUAL "nvcc" ) OR
26-
( "${CMAKE_HIP_PLATFORM}" STREQUAL "nvidia" ) )
27-
detray_add_flag( CMAKE_HIP_FLAGS_DEBUG "-G" )
26+
if(
27+
("${CMAKE_HIP_PLATFORM}" STREQUAL "nvcc")
28+
OR ("${CMAKE_HIP_PLATFORM}" STREQUAL "nvidia")
29+
)
30+
detray_add_flag( CMAKE_HIP_FLAGS_DEBUG "-G" )
2831
endif()
2932

3033
# Fail on warnings, if asked for that behaviour.
31-
if( DETRAY_FAIL_ON_WARNINGS )
32-
if( ( "${CMAKE_HIP_PLATFORM}" STREQUAL "hcc" ) OR
33-
( "${CMAKE_HIP_PLATFORM}" STREQUAL "amd" ) )
34-
detray_add_flag( CMAKE_HIP_FLAGS "-Werror" )
35-
elseif( ( "${CMAKE_HIP_PLATFORM}" STREQUAL "nvcc" ) OR
36-
( "${CMAKE_HIP_PLATFORM}" STREQUAL "nvidia" ) )
37-
detray_add_flag( CMAKE_HIP_FLAGS "-Werror all-warnings" )
38-
endif()
34+
if(DETRAY_FAIL_ON_WARNINGS)
35+
if(
36+
("${CMAKE_HIP_PLATFORM}" STREQUAL "hcc")
37+
OR ("${CMAKE_HIP_PLATFORM}" STREQUAL "amd")
38+
)
39+
detray_add_flag( CMAKE_HIP_FLAGS "-Werror" )
40+
elseif(
41+
("${CMAKE_HIP_PLATFORM}" STREQUAL "nvcc")
42+
OR ("${CMAKE_HIP_PLATFORM}" STREQUAL "nvidia")
43+
)
44+
detray_add_flag( CMAKE_HIP_FLAGS "-Werror all-warnings" )
45+
endif()
3946
endif()
4047
endif()

core/include/detray/definitions/detail/hip_definitions.hpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,27 @@
99

1010
#if defined(__HIPCC__)
1111

12+
#include <assert.h>
1213
#include <hip/hip_runtime.h>
13-
#include <hip/hip_runtime_api.h> // for hipDeviceSynchronize, hipGetLastError
14-
14+
#include <hip/hip_runtime_api.h> // for hipDeviceSynchronize, hipGetLastError
1515
#include <stdio.h>
1616
#include <stdlib.h>
17-
#include <assert.h>
1817

1918
/// Number of threads per Warp
2019
#define WARP_SIZE 32
2120

2221
/// Helper macro used for checking , type return values.
23-
22+
2423
#define DETRAY_HIP_ERROR_CHECK(ans) \
25-
{ hipAssert((ans) , __FILE__ , __LINE__); }
26-
inline void hipAssert( hipError_t code , const char *file , int line,
27-
bool abort = true ) {
24+
{ hipAssert((ans), __FILE__, __LINE__); }
25+
inline void hipAssert(hipError_t code, const char *file, int line,
26+
bool abort = true) {
2827
if (code != hipSuccess) {
29-
fprintf(stderr, "HIPassert: %s %s %d\n", hipGetErrorString(code),
30-
file, line);
28+
fprintf(stderr, "HIPassert: %s %s %d\n", hipGetErrorString(code), file,
29+
line);
3130
if (abort)
3231
exit(code);
3332
}
3433
}
3534

36-
#endif
35+
#endif

core/include/detray/utils/bounding_volume.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,7 @@ class axis_aligned_bounding_volume {
301301
/// Checks whether a point lies inside the box. The point has to be defined
302302
/// in the coordinate frame that is spanned by the box axes.
303303
template <concepts::point point_t>
304-
DETRAY_HOST_DEVICE
305-
constexpr bool is_inside(
304+
DETRAY_HOST_DEVICE constexpr bool is_inside(
306305
const point_t& loc_p,
307306
const scalar_t t = std::numeric_limits<scalar_t>::epsilon()) const {
308307
return m_mask.is_inside(loc_p, t);

extern/covfie/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ set(COVFIE_PLATFORM_CUDA
5252
"Enable covfie CUDA platform"
5353
)
5454

55-
56-
5755
set(COVFIE_REQUIRE_CXX20 OFF CACHE BOOL "Enable covfie C++20 requirement")
5856
set(COVFIE_QUIET ON CACHE BOOL "Quiet covfie feature warnings")
5957

tests/include/detray/test/device/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ endif()
2323

2424
if(DETRAY_BUILD_HIP)
2525
add_subdirectory(hip)
26-
endif()
26+
endif()

tests/include/detray/test/device/hip/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Mozilla Public License Version 2.0
66

77
# C++17 support for HIP requires CMake 3.21.
8-
cmake_minimum_required(VERSION 3.21) # HIP langauge support requires minimum 3.21
8+
cmake_minimum_required(VERSION 3.21) # HIP langauge support requires minimum 3.21
99

1010
# Enable HIP as a language.
1111
enable_language(HIP)

tests/include/detray/test/device/hip/material_validation.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ struct run_material_validation {
7272

7373
// Move the track parameters to device
7474
auto tracks_buffer = hip_cpy.to(vecmem::get_data(tracks), *dev_mr,
75-
vecmem::copy::type::host_to_device);
75+
vecmem::copy::type::host_to_device);
7676
vecmem::data::vector_view<track_t> tracks_view =
7777
vecmem::get_data(tracks_buffer);
7878

tests/include/detray/test/device/hip/navigation_validation.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ inline auto run_navigation_validation(
9292
vecmem::get_data(truth_intersection_traces, host_mr);
9393
auto truth_intersection_traces_buffer =
9494
hip_cpy.to(truth_intersection_traces_data, *dev_mr, host_mr,
95-
vecmem::copy::type::host_to_device);
95+
vecmem::copy::type::host_to_device);
9696
vecmem::data::jagged_vector_view<const intersection_record_t>
9797
truth_intersection_traces_view =
9898
vecmem::get_data(truth_intersection_traces_buffer);

tests/integration_tests/device/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ endif()
1414

1515
if(DETRAY_BUILD_HIP)
1616
add_subdirectory(hip)
17-
endif()
17+
endif()

0 commit comments

Comments
 (0)