Skip to content

Commit 5039f7c

Browse files
authored
Fix new compiler warning failures (#1199)
1 parent 2cb9cde commit 5039f7c

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,10 @@ if (NOT ${IS_NVCPP} GREATER -1)
206206
-Wlogical-op
207207
-Wnull-dereference)
208208
endif()
209+
else()
210+
# nvc++ diagnoses libcudacxx's if-consteval usage under all-warnings.
211+
set(WARN_FLAGS ${WARN_FLAGS}
212+
$<$<COMPILE_LANGUAGE:CUDA>:-Xcompiler=--diag_suppress,if_consteval_in_nonconstexpr_function>)
209213
endif()
210214

211215
if (CMAKE_CUDA_COMPILER_ID STREQUAL "Clang")

include/matx/core/pybind.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ class MATX_PYBIND_VISIBILITY MatXPybind {
423423
// copy a smaller tensor from a larger NumPy array, so keep that path bounded.
424424
for (int d = 0; d < RANK; d++) {
425425
const auto np_size = static_cast<index_t>(info.shape[d]);
426-
const bool valid_size = exact_shape ? ten.Size(d) == np_size : ten.Size(d) <= np_size;
426+
[[maybe_unused]] const bool valid_size = exact_shape ? ten.Size(d) == np_size : ten.Size(d) <= np_size;
427427
MATX_ASSERT_STR(valid_size, matxInvalidSize,
428428
"Numpy array dimension size is incompatible with tensor size");
429429
}

include/matx/kernels/sar_bp.cuh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -651,11 +651,12 @@ __global__ void SarBp(OutImageType output, const InitialImageType initial_image,
651651
};
652652

653653
const auto get_reference_phase_direct = [&phase_correction_partial](strict_compute_t range_delta) -> loose_complex_compute_t {
654+
const strict_compute_t phase = static_cast<strict_compute_t>(phase_correction_partial * range_delta);
654655
strict_compute_t sinx, cosx;
655656
if constexpr (cuda::std::is_same_v<strict_compute_t, double>) {
656-
::sincos(phase_correction_partial * range_delta, &sinx, &cosx);
657+
::sincos(phase, &sinx, &cosx);
657658
} else {
658-
::sincosf(phase_correction_partial * range_delta, &sinx, &cosx);
659+
::sincosf(phase, &sinx, &cosx);
659660
}
660661
return loose_complex_compute_t{
661662
static_cast<loose_compute_t>(cosx), static_cast<loose_compute_t>(sinx)

0 commit comments

Comments
 (0)