Skip to content

Commit

Permalink
Normalize whitespace (#2547)
Browse files Browse the repository at this point in the history
This PR applies `pre-commit` hooks to normalize whitespace (trimming trailing whitespace and enforcing consistent end-of-file newlines).

These rules are already applied to most other RAPIDS repos, so this PR aligns with the norm in RAPIDS.

Authors:
  - Bradley Dice (https://github.com/bdice)

Approvers:
  - Corey J. Nolet (https://github.com/cjnolet)
  - Vyas Ramasubramani (https://github.com/vyasr)

URL: #2547
  • Loading branch information
bdice authored Jan 25, 2025
1 parent fc4c490 commit ef4a7e1
Show file tree
Hide file tree
Showing 201 changed files with 177 additions and 226 deletions.
7 changes: 6 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Copyright (c) 2022-2023, NVIDIA CORPORATION.
# Copyright (c) 2022-2025, NVIDIA CORPORATION.

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
Expand Down
1 change: 0 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -473,4 +473,3 @@ if hasArg docs; then
cd ${SPHINX_BUILD_DIR}
sphinx-build -b html source _html
fi

5 changes: 2 additions & 3 deletions cpp/cmake/patches/cutlass/build-export.patch
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ index 7419bdf5e..545384d82 100755
- $<BUILD_INTERFACE:${cute_SOURCE_DIR}/include>
- $<BUILD_INTERFACE:${cute_SOURCE_DIR}/examples>
)

# Mark CTK headers as system to supress warnings from them
--
--
2.34.1

2 changes: 1 addition & 1 deletion cpp/include/raft/cluster/detail/kmeans_auto_find_k.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -227,4 +227,4 @@ void find_k(raft::resources const& handle,
n_iter);
}
}
} // namespace raft::cluster::detail
} // namespace raft::cluster::detail
2 changes: 1 addition & 1 deletion cpp/include/raft/cluster/detail/mst.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -204,4 +204,4 @@ void build_sorted_mst(
raft::copy_async(mst_weight, mst_coo.weights.data(), mst_coo.n_edges, stream);
}

}; // namespace raft::cluster::detail
}; // namespace raft::cluster::detail
2 changes: 1 addition & 1 deletion cpp/include/raft/cluster/detail/single_linkage.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,4 @@ void single_linkage(raft::resources const& handle,
out->n_leaves = m;
out->n_connected_components = 1;
}
}; // namespace raft::cluster::detail
}; // namespace raft::cluster::detail
2 changes: 1 addition & 1 deletion cpp/include/raft/common/nvtx.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@

#pragma once

#include <raft/core/nvtx.hpp>
#include <raft/core/nvtx.hpp>
2 changes: 1 addition & 1 deletion cpp/include/raft/core/coo_matrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,4 +297,4 @@ class coo_matrix

/** @} */

} // namespace raft
} // namespace raft
2 changes: 1 addition & 1 deletion cpp/include/raft/core/csr_matrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,4 +309,4 @@ class csr_matrix

/** @} */

} // namespace raft
} // namespace raft
2 changes: 1 addition & 1 deletion cpp/include/raft/core/detail/mdspan_util.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ MDSPAN_INLINE_FUNCTION auto popc(uint64_t v) -> int32_t
#endif // compiler
}

} // end namespace raft::detail
} // end namespace raft::detail
2 changes: 1 addition & 1 deletion cpp/include/raft/core/device_coo_matrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,4 +395,4 @@ auto make_device_coordinate_structure_view(raft::device_span<RowType> rows,

/** @} */

}; // namespace raft
}; // namespace raft
2 changes: 1 addition & 1 deletion cpp/include/raft/core/device_csr_matrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -422,4 +422,4 @@ auto make_device_compressed_structure_view(raft::device_span<IndptrType> indptr,

/** @} */

}; // namespace raft
}; // namespace raft
2 changes: 1 addition & 1 deletion cpp/include/raft/core/device_span.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ using device_span = span<T, true, extent>;
/**
* @}
*/
} // end namespace raft
} // end namespace raft
2 changes: 1 addition & 1 deletion cpp/include/raft/core/host_coo_matrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,4 +393,4 @@ auto make_host_coordinate_structure_view(raft::host_span<RowType> rows,

/** @} */

}; // namespace raft
}; // namespace raft
2 changes: 1 addition & 1 deletion cpp/include/raft/core/host_csr_matrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,4 +423,4 @@ auto make_host_compressed_structure_view(raft::host_span<IndptrType> indptr,

/** @} */

}; // namespace raft
}; // namespace raft
2 changes: 1 addition & 1 deletion cpp/include/raft/core/host_mdarray.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,4 +253,4 @@ auto make_host_vector(IndexType n)
return make_host_mdarray<ElementType, IndexType, LayoutPolicy>(make_extents<IndexType>(n));
}

} // end namespace raft
} // end namespace raft
2 changes: 1 addition & 1 deletion cpp/include/raft/core/host_span.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ using host_span = span<T, false, extent>;
* @}
*/

} // end namespace raft
} // end namespace raft
2 changes: 1 addition & 1 deletion cpp/include/raft/core/resource/device_id.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ inline int get_device_id(resources const& res)
/**
* @}
*/
} // namespace raft::resource
} // namespace raft::resource
2 changes: 1 addition & 1 deletion cpp/include/raft/core/resource/device_properties.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ inline cudaDeviceProp& get_device_properties(resources const& res)
/**
* @}
*/
} // namespace raft::resource
} // namespace raft::resource
2 changes: 1 addition & 1 deletion cpp/include/raft/core/resource/sub_comms.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@ inline void set_subcomm(resources const& res,
* @}
*/

} // namespace raft::resource
} // namespace raft::resource
2 changes: 1 addition & 1 deletion cpp/include/raft/core/sparse_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,4 +222,4 @@ class sparse_matrix {

/* @} */

} // namespace raft
} // namespace raft
2 changes: 1 addition & 1 deletion cpp/include/raft/distance/detail/fused_distance_nn/gemm.h
Original file line number Diff line number Diff line change
Expand Up @@ -406,4 +406,4 @@ struct FusedDistanceNNGemm<double,

} // namespace kernel
} // namespace gemm
} // namespace cutlass
} // namespace cutlass
2 changes: 1 addition & 1 deletion cpp/include/raft/distance/detail/pairwise_distance_gemm.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,4 +235,4 @@ struct PairwiseDistanceGemm<double,

} // namespace kernel
} // namespace gemm
} // namespace cutlass
} // namespace cutlass
2 changes: 1 addition & 1 deletion cpp/include/raft/distance/fused_distance_nn.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
*/
#pragma once

#include "fused_distance_nn-inl.cuh"
#include "fused_distance_nn-inl.cuh"
2 changes: 1 addition & 1 deletion cpp/include/raft/label/classlabels.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,4 @@ void make_monotonic(Type* out, Type* in, size_t N, cudaStream_t stream, bool zer
}; // namespace label
}; // end namespace raft

#endif
#endif
2 changes: 1 addition & 1 deletion cpp/include/raft/label/detail/merge_labels.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,4 @@ void merge_labels(value_idx* labels_a,

} // namespace detail
}; // namespace label
}; // namespace raft
}; // namespace raft
2 changes: 1 addition & 1 deletion cpp/include/raft/label/merge_labels.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ void merge_labels(value_idx* labels_a,
}; // namespace label
}; // namespace raft

#endif
#endif
2 changes: 1 addition & 1 deletion cpp/include/raft/linalg/cholesky_r1_update.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,4 @@ void choleskyRank1Update(raft::resources const& handle,
}; // namespace linalg
}; // namespace raft

#endif
#endif
2 changes: 1 addition & 1 deletion cpp/include/raft/linalg/coalesced_reduction.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,4 @@ void coalesced_reduction(raft::resources const& handle,
}; // end namespace linalg
}; // end namespace raft

#endif
#endif
2 changes: 1 addition & 1 deletion cpp/include/raft/linalg/detail/add.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ void addDevScalar(

} // namespace detail
} // namespace linalg
} // namespace raft
} // namespace raft
2 changes: 1 addition & 1 deletion cpp/include/raft/linalg/divide.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,4 @@ void divide_scalar(raft::resources const& handle,
}; // end namespace linalg
}; // end namespace raft

#endif
#endif
2 changes: 1 addition & 1 deletion cpp/include/raft/linalg/eig.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -223,4 +223,4 @@ void eig_jacobi(raft::resources const& handle,
}; // end namespace linalg
}; // end namespace raft

#endif
#endif
2 changes: 1 addition & 1 deletion cpp/include/raft/linalg/eltwise.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@ void eltwiseDivideCheckZero(
}; // end namespace linalg
}; // end namespace raft

#endif
#endif
2 changes: 1 addition & 1 deletion cpp/include/raft/linalg/gemv.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -307,4 +307,4 @@ void gemv(raft::resources const& handle,

}; // namespace linalg
}; // namespace raft
#endif
#endif
2 changes: 1 addition & 1 deletion cpp/include/raft/linalg/linalg_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ enum class FillMode { UPPER, LOWER };
*/
enum class Operation { NON_TRANSPOSE, TRANSPOSE };

} // end namespace raft::linalg
} // end namespace raft::linalg
2 changes: 1 addition & 1 deletion cpp/include/raft/linalg/lstsq.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -248,4 +248,4 @@ void lstsq_qr(raft::resources const& handle,
}; // namespace linalg
}; // namespace raft

#endif
#endif
2 changes: 1 addition & 1 deletion cpp/include/raft/linalg/map_reduce.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,4 @@ void map_reduce(raft::resources const& handle,

} // end namespace raft::linalg

#endif
#endif
2 changes: 1 addition & 1 deletion cpp/include/raft/linalg/map_then_reduce.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ template <typename InType,
}; // end namespace linalg
}; // end namespace raft

#endif
#endif
2 changes: 1 addition & 1 deletion cpp/include/raft/linalg/matrix_vector.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -200,4 +200,4 @@ void binary_sub(raft::resources const& handle,

/** @} */ // end of matrix_vector

} // namespace raft::linalg
} // namespace raft::linalg
2 changes: 1 addition & 1 deletion cpp/include/raft/linalg/multiply.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@ void multiply_scalar(
}; // end namespace linalg
}; // end namespace raft

#endif
#endif
2 changes: 1 addition & 1 deletion cpp/include/raft/linalg/power.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,4 @@ void power_scalar(
}; // end namespace linalg
}; // end namespace raft

#endif
#endif
2 changes: 1 addition & 1 deletion cpp/include/raft/linalg/qr.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,4 @@ void qr_get_qr(raft::resources const& handle,
}; // namespace linalg
}; // namespace raft

#endif
#endif
2 changes: 1 addition & 1 deletion cpp/include/raft/linalg/reduce.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,4 @@ void reduce(raft::resources const& handle,
}; // end namespace linalg
}; // end namespace raft

#endif
#endif
2 changes: 1 addition & 1 deletion cpp/include/raft/linalg/reduce_cols_by_key.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,4 @@ void reduce_cols_by_key(
}; // end namespace linalg
}; // end namespace raft

#endif
#endif
2 changes: 1 addition & 1 deletion cpp/include/raft/linalg/reduce_rows_by_key.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,4 @@ void reduce_rows_by_key(
}; // end namespace linalg
}; // end namespace raft

#endif
#endif
2 changes: 1 addition & 1 deletion cpp/include/raft/linalg/rsvd.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -880,4 +880,4 @@ void randomized_svd(const raft::resources& handle,
}; // end namespace linalg
}; // end namespace raft

#endif
#endif
2 changes: 1 addition & 1 deletion cpp/include/raft/linalg/sqrt.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ void sqrt(raft::resources const& handle, InType in, OutType out)
}; // end namespace linalg
}; // end namespace raft

#endif
#endif
2 changes: 1 addition & 1 deletion cpp/include/raft/linalg/strided_reduction.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,4 @@ void strided_reduction(raft::resources const& handle,
}; // end namespace linalg
}; // end namespace raft

#endif
#endif
2 changes: 1 addition & 1 deletion cpp/include/raft/linalg/subtract.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -226,4 +226,4 @@ void subtract_scalar(
}; // end namespace linalg
}; // end namespace raft

#endif
#endif
2 changes: 1 addition & 1 deletion cpp/include/raft/linalg/svd.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -420,4 +420,4 @@ void svd_reconstruction(raft::resources const& handle,
}; // end namespace linalg
}; // end namespace raft

#endif
#endif
2 changes: 1 addition & 1 deletion cpp/include/raft/matrix/col_wise_sort.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,4 @@ void sort_cols_per_row(Args... args)

}; // end namespace raft::matrix

#endif
#endif
2 changes: 1 addition & 1 deletion cpp/include/raft/matrix/detail/gather_inplace.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,4 @@ void gather(raft::resources const& handle,

} // namespace detail
} // namespace matrix
} // namespace raft
} // namespace raft
2 changes: 1 addition & 1 deletion cpp/include/raft/matrix/detail/scatter_inplace.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,4 @@ void scatter(raft::resources const& handle,

} // end namespace detail
} // end namespace matrix
} // end namespace raft
} // end namespace raft
2 changes: 1 addition & 1 deletion cpp/include/raft/matrix/math.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@

#pragma once

#include "math.cuh"
#include "math.cuh"
2 changes: 1 addition & 1 deletion cpp/include/raft/matrix/norm.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ m_t l2_norm(raft::resources const& handle, raft::device_mdspan<const m_t, idx_t>

/** @} */ // end of group matrix_norm

} // namespace raft::matrix
} // namespace raft::matrix
2 changes: 1 addition & 1 deletion cpp/include/raft/matrix/reverse.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ void row_reverse(raft::resources const& handle,
}
/** @} */ // end group matrix_reverse

} // namespace raft::matrix
} // namespace raft::matrix
Loading

0 comments on commit ef4a7e1

Please sign in to comment.