diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index bfa9cba085..f02450ac0a 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -420,6 +420,25 @@ if(BUILD_CUML_CPP_LIBRARY) src/hdbscan/hdbscan.cu src/hdbscan/condensed_hierarchy.cu src/hdbscan/prediction_data.cu) + + set_property( + SOURCE src/hdbscan/condensed_hierarchy.cu + APPEND_STRING + PROPERTY COMPILE_FLAGS + " -Xcompiler=-Wno-maybe-uninitialized" + ) + set_property( + SOURCE src/hdbscan/hdbscan.cu + APPEND_STRING + PROPERTY COMPILE_FLAGS + " -Xcompiler=-Wno-maybe-uninitialized" + ) + set_property( + SOURCE src/hdbscan/prediction_data.cu + APPEND_STRING + PROPERTY COMPILE_FLAGS + " -Xcompiler=-Wno-maybe-uninitialized" + ) endif() if(all_algo OR holtwinters_algo) diff --git a/cpp/src/hdbscan/condensed_hierarchy.cu b/cpp/src/hdbscan/condensed_hierarchy.cu index 76f1a19cf8..5744bc51c8 100644 --- a/cpp/src/hdbscan/condensed_hierarchy.cu +++ b/cpp/src/hdbscan/condensed_hierarchy.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2024, NVIDIA CORPORATION. + * Copyright (c) 2021-2025, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -157,8 +158,9 @@ void CondensedHierarchy::condense(value_idx* full_parents, thrust::cuda::par.on(stream), full_sizes, full_sizes + size, - cuda::proclaim_return_type([=] __device__(value_idx a) -> bool { return a != -1; }), - 0, + cuda::proclaim_return_type( + [=] __device__(value_idx a) -> value_idx { return static_cast(a != -1); }), + static_cast(0), thrust::plus()); parents.resize(n_edges, stream); diff --git a/cpp/src/hdbscan/detail/utils.h b/cpp/src/hdbscan/detail/utils.h index b151628429..4456416a6f 100644 --- a/cpp/src/hdbscan/detail/utils.h +++ b/cpp/src/hdbscan/detail/utils.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2024, NVIDIA CORPORATION. + * Copyright (c) 2021-2025, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,6 +34,7 @@ #include #include +#include #include #include #include @@ -114,8 +115,9 @@ Common::CondensedHierarchy make_cluster_tree( thrust_policy, sizes, sizes + condensed_tree.get_n_edges(), - cuda::proclaim_return_type([=] __device__(value_idx a) -> bool { return a > 1; }), - 0, + cuda::proclaim_return_type( + [=] __device__(value_idx a) -> value_idx { return static_cast(a > 1); }), + static_cast(0), thrust::plus()); // remove leaves from condensed tree diff --git a/cpp/test/CMakeLists.txt b/cpp/test/CMakeLists.txt index 0576217965..28cca7baac 100644 --- a/cpp/test/CMakeLists.txt +++ b/cpp/test/CMakeLists.txt @@ -1,5 +1,5 @@ #============================================================================= -# Copyright (c) 2018-2024, NVIDIA CORPORATION. +# Copyright (c) 2018-2025, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -149,6 +149,12 @@ if("${CMAKE_CUDA_COMPILER_VERSION}" VERSION_GREATER_EQUAL "11.2") # An HDBSCAN gtest is failing w/ CUDA 11.2 for some reason. if(all_algo OR hdbscan_algo) ConfigureTest(PREFIX SG NAME HDBSCAN_TEST sg/hdbscan_test.cu ML_INCLUDE) + set_property( + SOURCE sg/hdbscan_test.cu + APPEND_STRING + PROPERTY COMPILE_FLAGS + " -Xcompiler=-Wno-maybe-uninitialized" + ) endif() endif()