Skip to content

Commit

Permalink
fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
benfred committed Feb 2, 2023
1 parent 3c39c62 commit a94ceb6
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 14 deletions.
3 changes: 1 addition & 2 deletions cpp/include/raft/distance/detail/distance.cuh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2022, NVIDIA CORPORATION.
* Copyright (c) 2018-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -225,7 +225,6 @@ struct DistanceImpl<raft::distance::DistanceType::InnerProduct,
}
};


template <typename InType,
typename AccType,
typename OutType,
Expand Down
11 changes: 5 additions & 6 deletions cpp/include/raft/distance/detail/inner_product.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,11 @@ static void innerProductImpl(const DataT* x,
auto core_lambda = [] __device__(AccT & acc, DataT & x, DataT & y) { acc += x * y; };

// epilogue lambda - (which is a no-op here)
auto epilog_lambda =
[] __device__(AccT acc[KPolicy::AccRowsPerTh][KPolicy::AccColsPerTh],
DataT * regxn,
DataT * regyn,
IdxT gridStrideX,
IdxT gridStrideY) {};
auto epilog_lambda = [] __device__(AccT acc[KPolicy::AccRowsPerTh][KPolicy::AccColsPerTh],
DataT * regxn,
DataT * regyn,
IdxT gridStrideX,
IdxT gridStrideY) {};

constexpr size_t shmemSize =
KPolicy::SmemSize + (2 * (KPolicy::Mblk + KPolicy::Nblk) * sizeof(DataT));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2022, NVIDIA CORPORATION.
* Copyright (c) 2021-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,8 +21,7 @@
namespace raft {
namespace distance {
namespace detail {
extern template void
distance<raft::distance::DistanceType::InnerProduct, float, float, float, int>(
extern template void distance<raft::distance::DistanceType::InnerProduct, float, float, float, int>(
const float* x,
const float* y,
float* dist,
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/raft/distance/specializations/distance.cuh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2022, NVIDIA CORPORATION.
* Copyright (c) 2021-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2022, NVIDIA CORPORATION.
* Copyright (c) 2021-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion python/pylibraft/pylibraft/test/test_distance.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def test_distance(n_rows, n_cols, inplace, metric, order, dtype):
if metric == "inner_product":
# scipy.spatial.distance.cdist doesn't have IP distance
# calculate ourselves with np
expected = np.matmul(input1, input1.T)
expected = np.matmul(input1, input1.T)
else:
expected = cdist(input1, input1, metric)

Expand Down

0 comments on commit a94ceb6

Please sign in to comment.