summarylogtreecommitdiffstats
path: root/system-lib.patch
blob: 73886749bd931e1fff3fd2e4fb2df92fef82c7b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
--- src/raft-25.06.00/cpp/CMakeLists.txt	2025-06-06 03:23:44.000000000 +0800
+++ src/raft-25.06.00/cpp/CMakeLists.txt.new	2025-06-23 21:51:09.760674909 +0800
@@ -1,14 +1,16 @@
 # =============================================================================
 # Copyright (c) 2020-2024, NVIDIA CORPORATION.
 #
-# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
-# in compliance with the License. You may obtain a copy of the License at
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
 #
 # http://www.apache.org/licenses/LICENSE-2.0
 #
-# Unless required by applicable law or agreed to in writing, software distributed under the License
-# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
-# or implied. See the License for the specific language governing permissions and limitations under
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
 # the License.
 cmake_minimum_required(VERSION 3.30.4 FATAL_ERROR)
 include(../cmake/rapids_config.cmake)
@@ -17,8 +19,8 @@
 include(rapids-export)
 include(rapids-find)
 
-# workaround for rapids_cuda_init_architectures not working for arch detection with
-# enable_language(CUDA)
+# workaround for rapids_cuda_init_architectures not working for arch detection
+# with enable_language(CUDA)
 set(lang_list "CXX")
 
 include(rapids-cuda)
@@ -26,15 +28,14 @@
 list(APPEND lang_list "CUDA")
 
 project(
-  RAFT
-  VERSION "${RAPIDS_VERSION}"
-  LANGUAGES ${lang_list}
-)
+    RAFT
+    VERSION "${RAPIDS_VERSION}"
+    LANGUAGES ${lang_list})
 
 # Write the version header
 rapids_cmake_write_version_file(include/raft/version_config.hpp)
 
-# ##################################################################################################
+# ##############################################################################
 # * build type ---------------------------------------------------------------
 
 # Set a default build type if none was specified
@@ -43,96 +44,121 @@
 # this is needed for clang-tidy runs
 set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
 
-# ##################################################################################################
+# ##############################################################################
 # * User Options  ------------------------------------------------------------
 
 option(BUILD_SHARED_LIBS "Build raft shared libraries" ON)
 option(BUILD_TESTS "Build raft unit-tests" ON)
 option(BUILD_PRIMS_BENCH "Build raft C++ benchmark tests" OFF)
 option(CUDA_ENABLE_KERNELINFO "Enable kernel resource usage info" OFF)
-option(CUDA_ENABLE_LINEINFO
-       "Enable the -lineinfo option for nvcc (useful for cuda-memcheck / profiler)" OFF
-)
+option(
+    CUDA_ENABLE_LINEINFO
+    "Enable the -lineinfo option for nvcc (useful for cuda-memcheck / profiler)"
+    OFF)
 option(CUDA_STATIC_RUNTIME "Statically link the CUDA runtime" OFF)
 option(CUDA_STATIC_MATH_LIBRARIES "Statically link the CUDA math libraries" OFF)
-option(CUDA_LOG_COMPILE_TIME "Write a log of compilation times to nvcc_compile_log.csv" OFF)
-option(DETECT_CONDA_ENV "Enable detection of conda environment for dependencies" ON)
+option(CUDA_LOG_COMPILE_TIME
+       "Write a log of compilation times to nvcc_compile_log.csv" OFF)
+option(DETECT_CONDA_ENV
+       "Enable detection of conda environment for dependencies" ON)
 option(DISABLE_DEPRECATION_WARNINGS "Disable deprecaction warnings " ON)
 option(DISABLE_OPENMP "Disable OpenMP" OFF)
 option(RAFT_NVTX "Enable nvtx markers" OFF)
 
 set(RAFT_COMPILE_LIBRARY_DEFAULT OFF)
 if(BUILD_TESTS OR BUILD_PRIMS_BENCH)
-  set(RAFT_COMPILE_LIBRARY_DEFAULT ON)
+    set(RAFT_COMPILE_LIBRARY_DEFAULT ON)
 endif()
 option(RAFT_COMPILE_LIBRARY "Enable building raft library instantiations"
-       ${RAFT_COMPILE_LIBRARY_DEFAULT}
-)
+       ${RAFT_COMPILE_LIBRARY_DEFAULT})
 option(RAFT_COMPILE_DYNAMIC_ONLY "Only build the shared library and skip the
-static library. Has no effect if RAFT_COMPILE_LIBRARY is OFF" OFF
-)
+static library. Has no effect if RAFT_COMPILE_LIBRARY is OFF" OFF)
 
-# Needed because GoogleBenchmark changes the state of FindThreads.cmake, causing subsequent runs to
-# have different values for the `Threads::Threads` target. Setting this flag ensures
-# `Threads::Threads` is the same value across all builds so that cache hits occur
+# Needed because GoogleBenchmark changes the state of FindThreads.cmake, causing
+# subsequent runs to have different values for the `Threads::Threads` target.
+# Setting this flag ensures `Threads::Threads` is the same value across all
+# builds so that cache hits occur
 set(THREADS_PREFER_PTHREAD_FLAG ON)
 
 include(CMakeDependentOption)
-# cmake_dependent_option( RAFT_USE_FAISS_STATIC "Build and statically link the FAISS library for
-# nearest neighbors search on GPU" ON RAFT_COMPILE_LIBRARY OFF )
+# cmake_dependent_option( RAFT_USE_FAISS_STATIC "Build and statically link the
+# FAISS library for nearest neighbors search on GPU" ON RAFT_COMPILE_LIBRARY OFF
+# )
 
 message(VERBOSE "RAFT: Building optional components: ${raft_FIND_COMPONENTS}")
 message(VERBOSE "RAFT: Build RAFT unit-tests: ${BUILD_TESTS}")
 message(VERBOSE "RAFT: Building raft C++ benchmarks: ${BUILD_PRIMS_BENCH}")
-message(VERBOSE "RAFT: Enable detection of conda environment for dependencies: ${DETECT_CONDA_ENV}")
-message(VERBOSE "RAFT: Disable depreaction warnings " ${DISABLE_DEPRECATION_WARNINGS})
+message(
+    VERBOSE
+    "RAFT: Enable detection of conda environment for dependencies: ${DETECT_CONDA_ENV}"
+)
+message(VERBOSE "RAFT: Disable depreaction warnings "
+        ${DISABLE_DEPRECATION_WARNINGS})
 message(VERBOSE "RAFT: Disable OpenMP: ${DISABLE_OPENMP}")
-message(VERBOSE "RAFT: Enable kernel resource usage info: ${CUDA_ENABLE_KERNELINFO}")
+message(VERBOSE
+        "RAFT: Enable kernel resource usage info: ${CUDA_ENABLE_KERNELINFO}")
 message(VERBOSE "RAFT: Enable lineinfo in nvcc: ${CUDA_ENABLE_LINEINFO}")
 message(VERBOSE "RAFT: Enable nvtx markers: ${RAFT_NVTX}")
-message(VERBOSE "RAFT: Statically link the CUDA runtime: ${CUDA_STATIC_RUNTIME}")
-message(VERBOSE "RAFT: Statically link the CUDA math libraries: ${CUDA_STATIC_MATH_LIBRARIES}")
+message(VERBOSE
+        "RAFT: Statically link the CUDA runtime: ${CUDA_STATIC_RUNTIME}")
+message(
+    VERBOSE
+    "RAFT: Statically link the CUDA math libraries: ${CUDA_STATIC_MATH_LIBRARIES}"
+)
 
 # Set RMM logging level
 set(RMM_LOGGING_LEVEL
     "INFO"
-    CACHE STRING "Choose the logging level."
-)
+    CACHE STRING "Choose the logging level.")
 set_property(
-  CACHE RMM_LOGGING_LEVEL PROPERTY STRINGS "TRACE" "DEBUG" "INFO" "WARN" "ERROR" "CRITICAL" "OFF"
-)
+    CACHE RMM_LOGGING_LEVEL
+    PROPERTY STRINGS
+             "TRACE"
+             "DEBUG"
+             "INFO"
+             "WARN"
+             "ERROR"
+             "CRITICAL"
+             "OFF")
 message(VERBOSE "RAFT: RMM_LOGGING_LEVEL = '${RMM_LOGGING_LEVEL}'.")
 
 # Set logging level
 set(LIBRAFT_LOGGING_LEVEL
     "INFO"
-    CACHE STRING "Choose the logging level."
-)
+    CACHE STRING "Choose the logging level.")
 set_property(
-  CACHE LIBRAFT_LOGGING_LEVEL PROPERTY STRINGS "TRACE" "DEBUG" "INFO" "WARN" "ERROR" "CRITICAL"
-                                       "OFF"
-)
+    CACHE LIBRAFT_LOGGING_LEVEL
+    PROPERTY STRINGS
+             "TRACE"
+             "DEBUG"
+             "INFO"
+             "WARN"
+             "ERROR"
+             "CRITICAL"
+             "OFF")
 message(VERBOSE "RAFT: LIBRAFT_LOGGING_LEVEL = '${LIBRAFT_LOGGING_LEVEL}'.")
 
-# ##################################################################################################
+# ##############################################################################
 # * Conda environment detection ----------------------------------------------
 
 if(DETECT_CONDA_ENV)
-  rapids_cmake_support_conda_env(conda_env MODIFY_PREFIX_PATH)
-  if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND DEFINED ENV{CONDA_PREFIX})
-    message(
-      STATUS "RAFT: No CMAKE_INSTALL_PREFIX argument detected, setting to: $ENV{CONDA_PREFIX}"
-    )
-    set(CMAKE_INSTALL_PREFIX "$ENV{CONDA_PREFIX}")
-  endif()
+    rapids_cmake_support_conda_env(conda_env MODIFY_PREFIX_PATH)
+    if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND DEFINED
+                                                       ENV{CONDA_PREFIX})
+        message(
+            STATUS
+                "RAFT: No CMAKE_INSTALL_PREFIX argument detected, setting to: $ENV{CONDA_PREFIX}"
+        )
+        set(CMAKE_INSTALL_PREFIX "$ENV{CONDA_PREFIX}")
+    endif()
 endif()
 
-# ##################################################################################################
+# ##############################################################################
 # * compiler options ----------------------------------------------------------
 
 set(_ctk_static_suffix "")
 if(CUDA_STATIC_MATH_LIBRARIES)
-  set(_ctk_static_suffix "_static")
+    set(_ctk_static_suffix "_static")
 endif()
 
 # CUDA runtime
@@ -141,76 +167,76 @@
 # * determine GPU architectures
 # * enable the CMake CUDA language
 # * set other CUDA compilation flags
-rapids_find_package(
-  CUDAToolkit REQUIRED
-  BUILD_EXPORT_SET raft-exports
-  INSTALL_EXPORT_SET raft-exports
-)
+rapids_find_package(CUDAToolkit REQUIRED BUILD_EXPORT_SET raft-exports
+                    INSTALL_EXPORT_SET raft-exports)
 
 if(NOT DISABLE_OPENMP)
-  rapids_find_package(
-    OpenMP REQUIRED
-    BUILD_EXPORT_SET raft-exports
-    INSTALL_EXPORT_SET raft-exports
-  )
-  if(OPENMP_FOUND)
-    message(VERBOSE "RAFT: OpenMP found in ${OpenMP_CXX_INCLUDE_DIRS}")
-  endif()
+    rapids_find_package(OpenMP REQUIRED BUILD_EXPORT_SET raft-exports
+                        INSTALL_EXPORT_SET raft-exports)
+    if(OPENMP_FOUND)
+        message(VERBOSE "RAFT: OpenMP found in ${OpenMP_CXX_INCLUDE_DIRS}")
+    endif()
 endif()
 
 include(cmake/modules/ConfigureCUDA.cmake)
 
-# ##################################################################################################
+# ##############################################################################
 # * Requirements -------------------------------------------------------------
 
 # add third party dependencies using CPM
 rapids_cpm_init()
 
 include(${rapids-cmake-dir}/cpm/rapids_logger.cmake)
-rapids_cpm_rapids_logger(BUILD_EXPORT_SET raft-exports INSTALL_EXPORT_SET raft-exports)
+rapids_cpm_rapids_logger(BUILD_EXPORT_SET raft-exports INSTALL_EXPORT_SET
+                         raft-exports)
 create_logger_macros(RAFT "raft::default_logger()" include/raft/core)
 
 # CCCL before rmm/cuco so we get the right version of CCCL
-include(cmake/thirdparty/get_cccl.cmake)
-include(cmake/thirdparty/get_rmm.cmake)
+find_package(CCCL REQUIRED)
+find_package(rmm REQUIRED)
 include(cmake/thirdparty/get_cutlass.cmake)
+find_package(rapids_logger REQUIRED)
+find_package(nvtx3 REQUIRED)
 
 include(${rapids-cmake-dir}/cpm/cuco.cmake)
 rapids_cpm_cuco(BUILD_EXPORT_SET raft-exports INSTALL_EXPORT_SET raft-exports)
 
 if(BUILD_TESTS)
-  include(${rapids-cmake-dir}/cpm/gtest.cmake)
-  rapids_cpm_gtest(BUILD_STATIC)
+    include(${rapids-cmake-dir}/cpm/gtest.cmake)
+    rapids_cpm_gtest(BUILD_STATIC)
 endif()
 
 if(BUILD_PRIMS_BENCH)
-  include(${rapids-cmake-dir}/cpm/gbench.cmake)
-  rapids_cpm_gbench(BUILD_STATIC)
+    include(${rapids-cmake-dir}/cpm/gbench.cmake)
+    rapids_cpm_gbench(BUILD_STATIC)
 endif()
 
-# ##################################################################################################
+# ##############################################################################
 # * raft ---------------------------------------------------------------------
 add_library(raft INTERFACE)
 add_library(raft::raft ALIAS raft)
 
 target_include_directories(
-  raft INTERFACE "$<BUILD_INTERFACE:${RAFT_SOURCE_DIR}/include>"
-                 "$<BUILD_INTERFACE:${RAFT_BINARY_DIR}/include>" "$<INSTALL_INTERFACE:include>"
-)
+    raft
+    INTERFACE "$<BUILD_INTERFACE:${RAFT_SOURCE_DIR}/include>"
+              "$<BUILD_INTERFACE:${RAFT_BINARY_DIR}/include>"
+              "$<INSTALL_INTERFACE:include>")
 
-# Keep RAFT as lightweight as possible. Only CUDA libs and rmm should be used in global target.
+# Keep RAFT as lightweight as possible. Only CUDA libs and rmm should be used in
+# global target.
 target_link_libraries(
-  raft INTERFACE rapids_logger::rapids_logger rmm::rmm cuco::cuco nvidia::cutlass::cutlass
-                 CCCL::CCCL
-)
+    raft INTERFACE rapids_logger::rapids_logger rmm::rmm cuco::cuco
+                   nvidia::cutlass::cutlass CCCL::CCCL)
 
-target_compile_features(raft INTERFACE cxx_std_17 $<BUILD_INTERFACE:cuda_std_17>)
+target_compile_features(raft INTERFACE cxx_std_17
+                                       $<BUILD_INTERFACE:cuda_std_17>)
 target_compile_options(
-  raft INTERFACE $<$<COMPILE_LANG_AND_ID:CUDA,NVIDIA>:--expt-extended-lambda
-                 --expt-relaxed-constexpr>
-)
+    raft INTERFACE $<$<COMPILE_LANG_AND_ID:CUDA,NVIDIA>:--expt-extended-lambda
+                   --expt-relaxed-constexpr>)
 target_compile_definitions(
-  raft INTERFACE "RAFT_LOG_ACTIVE_LEVEL=RAPIDS_LOGGER_LOG_LEVEL_${LIBRAFT_LOGGING_LEVEL}"
+    raft
+    INTERFACE
+        "RAFT_LOG_ACTIVE_LEVEL=RAPIDS_LOGGER_LOG_LEVEL_${LIBRAFT_LOGGING_LEVEL}"
 )
 
 set(RAFT_CUSOLVER_DEPENDENCY CUDA::cusolver${_ctk_static_suffix})
@@ -218,266 +244,275 @@
 set(RAFT_CURAND_DEPENDENCY CUDA::curand${_ctk_static_suffix})
 set(RAFT_CUSPARSE_DEPENDENCY CUDA::cusparse${_ctk_static_suffix})
 
-set(RAFT_CTK_MATH_DEPENDENCIES ${RAFT_CUBLAS_DEPENDENCY} ${RAFT_CUSOLVER_DEPENDENCY}
-                               ${RAFT_CUSPARSE_DEPENDENCY} ${RAFT_CURAND_DEPENDENCY}
-)
+set(RAFT_CTK_MATH_DEPENDENCIES
+    ${RAFT_CUBLAS_DEPENDENCY} ${RAFT_CUSOLVER_DEPENDENCY}
+    ${RAFT_CUSPARSE_DEPENDENCY} ${RAFT_CURAND_DEPENDENCY})
 
 # Endian detection
 include(TestBigEndian)
 test_big_endian(BIG_ENDIAN)
 if(BIG_ENDIAN)
-  target_compile_definitions(raft INTERFACE RAFT_SYSTEM_LITTLE_ENDIAN=0)
+    target_compile_definitions(raft INTERFACE RAFT_SYSTEM_LITTLE_ENDIAN=0)
 else()
-  target_compile_definitions(raft INTERFACE RAFT_SYSTEM_LITTLE_ENDIAN=1)
+    target_compile_definitions(raft INTERFACE RAFT_SYSTEM_LITTLE_ENDIAN=1)
 endif()
 
 if(RAFT_COMPILE_LIBRARY)
-  file(
-    WRITE "${CMAKE_CURRENT_BINARY_DIR}/fatbin.ld"
-    [=[
+    file(
+        WRITE "${CMAKE_CURRENT_BINARY_DIR}/fatbin.ld"
+        [=[
 SECTIONS
 {
 .nvFatBinSegment : { *(.nvFatBinSegment) }
 .nv_fatbin : { *(.nv_fatbin) }
 }
-]=]
-  )
+]=])
 endif()
 
-# ##################################################################################################
+# ##############################################################################
 # * NVTX support in raft -----------------------------------------------------
 
 if(RAFT_NVTX)
-  # This enables NVTX within the project with no option to disable it downstream.
-  target_link_libraries(raft INTERFACE CUDA::nvtx3)
-  target_compile_definitions(raft INTERFACE NVTX_ENABLED)
+    # This enables NVTX within the project with no option to disable it
+    # downstream.
+    target_link_libraries(raft INTERFACE CUDA::nvtx3)
+    target_compile_definitions(raft INTERFACE NVTX_ENABLED)
 else()
-  # Allow enable NVTX downstream if not set here. This creates a new option at build/install time,
-  # which is set by default to OFF, but can be enabled in the dependent project.
-  get_property(
-    nvtx_option_help_string
-    CACHE RAFT_NVTX
-    PROPERTY HELPSTRING
-  )
-  string(
-    CONCAT
-      nvtx_export_string
-      "option(RAFT_NVTX \""
-      ${nvtx_option_help_string}
-      "\" OFF)"
-      [=[
+    # Allow enable NVTX downstream if not set here. This creates a new option at
+    # build/install time, which is set by default to OFF, but can be enabled in
+    # the dependent project.
+    get_property(
+        nvtx_option_help_string
+        CACHE RAFT_NVTX
+        PROPERTY HELPSTRING)
+    string(
+        CONCAT
+            nvtx_export_string
+            "option(RAFT_NVTX \""
+            ${nvtx_option_help_string}
+            "\" OFF)"
+            [=[
 
 target_link_libraries(raft::raft INTERFACE $<$<BOOL:${RAFT_NVTX}>:CUDA::nvtx3>)
 target_compile_definitions(raft::raft INTERFACE $<$<BOOL:${RAFT_NVTX}>:NVTX_ENABLED>)
 
-  ]=]
-  )
+  ]=])
 endif()
 
-# ##################################################################################################
+# ##############################################################################
 # * raft_compiled ------------------------------------------------------------
 add_library(raft_compiled INTERFACE)
 
 if(TARGET raft_compiled AND (NOT TARGET raft::compiled))
-  add_library(raft::compiled ALIAS raft_compiled)
+    add_library(raft::compiled ALIAS raft_compiled)
 endif()
 
 set_target_properties(raft_compiled PROPERTIES EXPORT_NAME compiled)
 
 if(RAFT_COMPILE_LIBRARY)
-  add_library(
-    raft_objs OBJECT
-    src/linalg/detail/coalesced_reduction.cu
-    src/raft_runtime/random/rmat_rectangular_generator_int64_double.cu
-    src/raft_runtime/random/rmat_rectangular_generator_int64_float.cu
-    src/raft_runtime/random/rmat_rectangular_generator_int_double.cu
-    src/raft_runtime/random/rmat_rectangular_generator_int_float.cu
-    src/raft_runtime/solver/lanczos_solver_int64_double.cu
-    src/raft_runtime/solver/lanczos_solver_int64_float.cu
-    src/raft_runtime/solver/lanczos_solver_int_double.cu
-    src/raft_runtime/solver/lanczos_solver_int_float.cu
-  )
-  set_target_properties(
-    raft_objs
-    PROPERTIES CXX_STANDARD 17
-               CXX_STANDARD_REQUIRED ON
-               CUDA_STANDARD 17
-               CUDA_STANDARD_REQUIRED ON
-               POSITION_INDEPENDENT_CODE ON
-  )
-
-  target_compile_definitions(raft_objs PRIVATE "RAFT_EXPLICIT_INSTANTIATE_ONLY")
-  target_compile_options(
-    raft_objs PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:${RAFT_CXX_FLAGS}>"
-                      "$<$<COMPILE_LANGUAGE:CUDA>:${RAFT_CUDA_FLAGS}>"
-  )
-
-  add_library(raft_lib SHARED $<TARGET_OBJECTS:raft_objs>)
-
-  set(_raft_lib_targets raft_lib)
-  if(NOT RAFT_COMPILE_DYNAMIC_ONLY)
-    add_library(raft_lib_static STATIC $<TARGET_OBJECTS:raft_objs>)
-    list(APPEND _raft_lib_targets raft_lib_static)
-  endif()
-
-  set_target_properties(
-    ${_raft_lib_targets}
-    PROPERTIES OUTPUT_NAME raft
-               BUILD_RPATH "\$ORIGIN"
-               INSTALL_RPATH "\$ORIGIN"
-               INTERFACE_POSITION_INDEPENDENT_CODE ON
-  )
-
-  list(APPEND _raft_lib_targets raft_objs)
-  foreach(target IN LISTS _raft_lib_targets)
-    target_link_libraries(
-      ${target}
-      PUBLIC raft::raft
-             ${RAFT_CTK_MATH_DEPENDENCIES} # TODO: Once `raft::resources` is used everywhere, this
-                                           # will just be cublas
-             $<TARGET_NAME_IF_EXISTS:OpenMP::OpenMP_CXX>
-    )
-
-    # So consumers know when using libraft.so/libraft.a
-    target_compile_definitions(${target} PUBLIC "RAFT_COMPILED")
-    # ensure CUDA symbols aren't relocated to the middle of the debug build binaries
-    target_link_options(${target} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/fatbin.ld")
-  endforeach()
+    add_library(
+        raft_objs OBJECT
+        src/linalg/detail/coalesced_reduction.cu
+        src/raft_runtime/random/rmat_rectangular_generator_int64_double.cu
+        src/raft_runtime/random/rmat_rectangular_generator_int64_float.cu
+        src/raft_runtime/random/rmat_rectangular_generator_int_double.cu
+        src/raft_runtime/random/rmat_rectangular_generator_int_float.cu
+        src/raft_runtime/solver/lanczos_solver_int64_double.cu
+        src/raft_runtime/solver/lanczos_solver_int64_float.cu
+        src/raft_runtime/solver/lanczos_solver_int_double.cu
+        src/raft_runtime/solver/lanczos_solver_int_float.cu)
+    set_target_properties(
+        raft_objs
+        PROPERTIES CXX_STANDARD 17
+                   CXX_STANDARD_REQUIRED ON
+                   CUDA_STANDARD 17
+                   CUDA_STANDARD_REQUIRED ON
+                   POSITION_INDEPENDENT_CODE ON)
+
+    target_compile_definitions(raft_objs
+                               PRIVATE "RAFT_EXPLICIT_INSTANTIATE_ONLY")
+    target_compile_options(
+        raft_objs PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:${RAFT_CXX_FLAGS}>"
+                          "$<$<COMPILE_LANGUAGE:CUDA>:${RAFT_CUDA_FLAGS}>")
+
+    add_library(raft_lib SHARED $<TARGET_OBJECTS:raft_objs>)
+
+    set(_raft_lib_targets raft_lib)
+    if(NOT RAFT_COMPILE_DYNAMIC_ONLY)
+        add_library(raft_lib_static STATIC $<TARGET_OBJECTS:raft_objs>)
+        list(APPEND _raft_lib_targets raft_lib_static)
+    endif()
+
+    set_target_properties(
+        ${_raft_lib_targets}
+        PROPERTIES OUTPUT_NAME raft
+                   BUILD_RPATH "\$ORIGIN"
+                   INSTALL_RPATH "\$ORIGIN"
+                   INTERFACE_POSITION_INDEPENDENT_CODE ON)
+
+    list(APPEND _raft_lib_targets raft_objs)
+    foreach(target IN LISTS _raft_lib_targets)
+        target_link_libraries(
+            ${target}
+            PUBLIC raft::raft
+                   ${RAFT_CTK_MATH_DEPENDENCIES} # TODO: Once `raft::resources`
+                                                 # is used everywhere, this will
+                                                 # just be cublas
+                   $<TARGET_NAME_IF_EXISTS:OpenMP::OpenMP_CXX>)
+
+        # So consumers know when using libraft.so/libraft.a
+        target_compile_definitions(${target} PUBLIC "RAFT_COMPILED")
+        # ensure CUDA symbols aren't relocated to the middle of the debug build
+        # binaries
+        target_link_options(${target} PRIVATE
+                            "${CMAKE_CURRENT_BINARY_DIR}/fatbin.ld")
+    endforeach()
 endif()
 
 if(TARGET raft_lib AND (NOT TARGET raft::raft_lib))
-  add_library(raft::raft_lib ALIAS raft_lib)
+    add_library(raft::raft_lib ALIAS raft_lib)
 endif()
 
-target_link_libraries(raft_compiled INTERFACE raft::raft $<TARGET_NAME_IF_EXISTS:raft::raft_lib>)
+target_link_libraries(
+    raft_compiled INTERFACE raft::raft $<TARGET_NAME_IF_EXISTS:raft::raft_lib>)
 
-# ##################################################################################################
+# ##############################################################################
 # * raft_compiled_static----------------------------------------------------------------------------
 
 if(NOT RAFT_COMPILE_DYNAMIC_ONLY)
-  add_library(raft_compiled_static INTERFACE)
+    add_library(raft_compiled_static INTERFACE)
 
-  if(TARGET raft_compiled_static AND (NOT TARGET raft::compiled_static))
-    add_library(raft::compiled_static ALIAS raft_compiled_static)
-  endif()
-  set_target_properties(raft_compiled_static PROPERTIES EXPORT_NAME compiled_static)
+    if(TARGET raft_compiled_static AND (NOT TARGET raft::compiled_static))
+        add_library(raft::compiled_static ALIAS raft_compiled_static)
+    endif()
+    set_target_properties(raft_compiled_static PROPERTIES EXPORT_NAME
+                                                          compiled_static)
+
+    if(TARGET raft_lib_static AND (NOT TARGET raft::raft_lib_static))
+        add_library(raft::raft_lib_static ALIAS raft_lib_static)
+    endif()
 
-  if(TARGET raft_lib_static AND (NOT TARGET raft::raft_lib_static))
-    add_library(raft::raft_lib_static ALIAS raft_lib_static)
-  endif()
-
-  target_link_libraries(
-    raft_compiled_static INTERFACE raft::raft $<TARGET_NAME_IF_EXISTS:raft::raft_lib_static>
-  )
+    target_link_libraries(
+        raft_compiled_static
+        INTERFACE raft::raft $<TARGET_NAME_IF_EXISTS:raft::raft_lib_static>)
 endif()
 
-# ##################################################################################################
-# * raft_distributed -------------------------------------------------------------------------------
+# ##############################################################################
+# * raft_distributed
+#   -------------------------------------------------------------------------------
 add_library(raft_distributed INTERFACE)
 
 if(TARGET raft_distributed AND (NOT TARGET raft::distributed))
-  add_library(raft::distributed ALIAS raft_distributed)
+    add_library(raft::distributed ALIAS raft_distributed)
 endif()
 
 set_target_properties(raft_distributed PROPERTIES EXPORT_NAME distributed)
 
 rapids_find_generate_module(
-  NCCL
-  HEADER_NAMES nccl.h
-  LIBRARY_NAMES nccl
-  BUILD_EXPORT_SET raft-distributed-exports
-  INSTALL_EXPORT_SET raft-distributed-exports
-)
+    NCCL
+    HEADER_NAMES
+    nccl.h
+    LIBRARY_NAMES
+    nccl
+    BUILD_EXPORT_SET
+    raft-distributed-exports
+    INSTALL_EXPORT_SET
+    raft-distributed-exports)
 
 rapids_export_package(
-  BUILD ucxx raft-distributed-exports COMPONENTS ucxx python GLOBAL_TARGETS ucxx::ucxx ucxx::python
-)
+    BUILD
+    ucxx
+    raft-distributed-exports
+    COMPONENTS
+    ucxx
+    python
+    GLOBAL_TARGETS
+    ucxx::ucxx
+    ucxx::python)
 rapids_export_package(
-  INSTALL ucxx raft-distributed-exports COMPONENTS ucxx python GLOBAL_TARGETS ucxx::ucxx
-                                                                              ucxx::python
-)
+    INSTALL
+    ucxx
+    raft-distributed-exports
+    COMPONENTS
+    ucxx
+    python
+    GLOBAL_TARGETS
+    ucxx::ucxx
+    ucxx::python)
 rapids_export_package(BUILD NCCL raft-distributed-exports)
 rapids_export_package(INSTALL NCCL raft-distributed-exports)
 
-# ucx is a requirement for raft_distributed, but its config is not safe to be found multiple times,
-# so rather than exporting a package dependency on it above we rely on consumers to find it
-# themselves. Once https://github.com/rapidsai/ucxx/issues/173 is resolved we can export it above
+# ucx is a requirement for raft_distributed, but its config is not safe to be
+# found multiple times, so rather than exporting a package dependency on it
+# above we rely on consumers to find it themselves. Once
+# https://github.com/rapidsai/ucxx/issues/173 is resolved we can export it above
 # again.
 target_link_libraries(raft_distributed INTERFACE ucx::ucp ucxx::ucxx NCCL::NCCL)
 
-# ##################################################################################################
+# ##############################################################################
 # * install targets-----------------------------------------------------------
 rapids_cmake_install_lib_dir(lib_dir)
 include(GNUInstallDirs)
 include(CPack)
 
 install(
-  TARGETS raft
-  DESTINATION ${lib_dir}
-  COMPONENT raft
-  EXPORT raft-exports
-)
+    TARGETS raft
+    DESTINATION ${lib_dir}
+    COMPONENT raft
+    EXPORT raft-exports)
 
 set(_raft_compiled_install_targets raft_compiled)
 if(NOT RAFT_COMPILE_DYNAMIC_ONLY)
-  list(APPEND _raft_compiled_install_targets raft_compiled_static)
+    list(APPEND _raft_compiled_install_targets raft_compiled_static)
 endif()
 install(
-  TARGETS ${_raft_compiled_install_targets}
-  DESTINATION ${lib_dir}
-  COMPONENT raft
-  EXPORT raft-compiled-exports
-)
+    TARGETS ${_raft_compiled_install_targets}
+    DESTINATION ${lib_dir}
+    COMPONENT raft
+    EXPORT raft-compiled-exports)
 
 if(TARGET raft_lib)
-  install(
-    TARGETS raft_lib
-    DESTINATION ${lib_dir}
-    COMPONENT compiled
-    EXPORT raft-compiled-lib-exports
-  )
-  if(NOT RAFT_COMPILE_DYNAMIC_ONLY)
     install(
-      TARGETS raft_lib_static
-      DESTINATION ${lib_dir}
-      COMPONENT compiled-static
-      EXPORT raft-compiled-static-lib-exports
-    )
-  endif()
-  install(
-    DIRECTORY include/raft_runtime
-    DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
-    COMPONENT compiled
-  )
+        TARGETS raft_lib
+        DESTINATION ${lib_dir}
+        COMPONENT compiled
+        EXPORT raft-compiled-lib-exports)
+    if(NOT RAFT_COMPILE_DYNAMIC_ONLY)
+        install(
+            TARGETS raft_lib_static
+            DESTINATION ${lib_dir}
+            COMPONENT compiled-static
+            EXPORT raft-compiled-static-lib-exports)
+    endif()
+    install(
+        DIRECTORY include/raft_runtime
+        DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
+        COMPONENT compiled)
 endif()
 
 install(
-  TARGETS raft_distributed
-  DESTINATION ${lib_dir}
-  COMPONENT distributed
-  EXPORT raft-distributed-exports
-)
+    TARGETS raft_distributed
+    DESTINATION ${lib_dir}
+    COMPONENT distributed
+    EXPORT raft-distributed-exports)
 
 install(
-  DIRECTORY include/raft
-  COMPONENT raft
-  DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
-)
+    DIRECTORY include/raft
+    COMPONENT raft
+    DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
 
 # Temporary install of raft.hpp while the file is removed
 install(
-  FILES include/raft.hpp
-  COMPONENT raft
-  DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/raft
-)
+    FILES include/raft.hpp
+    COMPONENT raft
+    DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/raft)
 
 install(
-  FILES ${CMAKE_CURRENT_BINARY_DIR}/include/raft/version_config.hpp
-  COMPONENT raft
-  DESTINATION include/raft
-)
+    FILES ${CMAKE_CURRENT_BINARY_DIR}/include/raft/version_config.hpp
+    COMPONENT raft
+    DESTINATION include/raft)
 
-# ##################################################################################################
+# ##############################################################################
 # * install export -----------------------------------------------------------
 set(doc_string
     [=[
@@ -497,35 +532,33 @@
   - raft::compiled_static brought in by the `compiled_static` optional component
   - raft::distributed brought in by the `distributed` optional component
 
-]=]
-)
+]=])
 
 set(code_string ${nvtx_export_string})
 
 string(
-  APPEND
-  code_string
-  [=[
+    APPEND
+    code_string
+    [=[
 if(compiled IN_LIST raft_FIND_COMPONENTS)
   enable_language(CUDA)
 endif()
-]=]
-)
+]=])
 set(raft_components compiled distributed)
 set(raft_export_sets raft-compiled-exports raft-distributed-exports)
 if(TARGET raft_lib)
-  list(APPEND raft_components compiled)
-  list(APPEND raft_export_sets raft-compiled-lib-exports)
-  if(NOT RAFT_COMPILE_DYNAMIC_ONLY)
-    list(APPEND raft_components compiled-static)
-    list(APPEND raft_export_sets raft-compiled-static-lib-exports)
-  endif()
+    list(APPEND raft_components compiled)
+    list(APPEND raft_export_sets raft-compiled-lib-exports)
+    if(NOT RAFT_COMPILE_DYNAMIC_ONLY)
+        list(APPEND raft_components compiled-static)
+        list(APPEND raft_export_sets raft-compiled-static-lib-exports)
+    endif()
 endif()
 
 string(
-  APPEND
-  code_string
-  [=[
+    APPEND
+    code_string
+    [=[
  option(RAFT_ENABLE_CUSOLVER_DEPENDENCY "Enable cusolver dependency" ON)
  option(RAFT_ENABLE_CUBLAS_DEPENDENCY "Enable cublas dependency" ON)
  option(RAFT_ENABLE_CURAND_DEPENDENCY "Enable curand dependency" ON)
@@ -542,51 +575,68 @@
   $<$<BOOL:${RAFT_ENABLE_CUSPARSE_DEPENDENCY}>:${RAFT_CUSPARSE_DEPENDENCY}>
   $<$<BOOL:${RAFT_ENABLE_CURAND_DEPENDENCY}>:${RAFT_CURAND_DEPENDENCY}>
 )
-]=]
-)
+]=])
 
 # Use `rapids_export` for 22.04 as it will have COMPONENT support
 rapids_export(
-  INSTALL raft
-  EXPORT_SET raft-exports
-  COMPONENTS ${raft_components}
-  COMPONENTS_EXPORT_SET ${raft_export_sets}
-  GLOBAL_TARGETS raft compiled distributed
-  NAMESPACE raft::
-  DOCUMENTATION doc_string
-  FINAL_CODE_BLOCK code_string
-)
+    INSTALL
+    raft
+    EXPORT_SET
+    raft-exports
+    COMPONENTS
+    ${raft_components}
+    COMPONENTS_EXPORT_SET
+    ${raft_export_sets}
+    GLOBAL_TARGETS
+    raft
+    compiled
+    distributed
+    NAMESPACE
+    raft::
+    DOCUMENTATION
+    doc_string
+    FINAL_CODE_BLOCK
+    code_string)
 
-# ##################################################################################################
+# ##############################################################################
 # * build export -------------------------------------------------------------
 rapids_export(
-  BUILD raft
-  EXPORT_SET raft-exports
-  COMPONENTS ${raft_components}
-  COMPONENTS_EXPORT_SET ${raft_export_sets}
-  GLOBAL_TARGETS raft compiled distributed
-  DOCUMENTATION doc_string
-  NAMESPACE raft::
-  FINAL_CODE_BLOCK code_string
-)
+    BUILD
+    raft
+    EXPORT_SET
+    raft-exports
+    COMPONENTS
+    ${raft_components}
+    COMPONENTS_EXPORT_SET
+    ${raft_export_sets}
+    GLOBAL_TARGETS
+    raft
+    compiled
+    distributed
+    DOCUMENTATION
+    doc_string
+    NAMESPACE
+    raft::
+    FINAL_CODE_BLOCK
+    code_string)
 
-# ##################################################################################################
+# ##############################################################################
 # * shared test/bench headers ------------------------------------------------
 
 if(BUILD_TESTS OR BUILD_PRIMS_BENCH)
-  add_subdirectory(internal)
+    add_subdirectory(internal)
 endif()
 
-# ##################################################################################################
+# ##############################################################################
 # * build test executable ----------------------------------------------------
 
 if(BUILD_TESTS)
-  add_subdirectory(tests)
+    add_subdirectory(tests)
 endif()
 
-# ##################################################################################################
+# ##############################################################################
 # * build benchmark executable -----------------------------------------------
 
 if(BUILD_PRIMS_BENCH)
-  add_subdirectory(bench/prims/)
+    add_subdirectory(bench/prims/)
 endif()