Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] [FINAL] Header structure: combine all PRs into one #1469

Merged
Merged
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
4dc403e
MV: add -inl suffix to header paths
ahendriksen Apr 20, 2023
6947ed2
MV: raft_runtime src files
ahendriksen Apr 13, 2023
0178c39
FIX: add missing includes
ahendriksen Apr 20, 2023
f04a2ea
FIX: getWorkspaceSize
ahendriksen Apr 20, 2023
c5509a7
PREP: Separate rbf_fin_op
ahendriksen Apr 20, 2023
d7e7479
PREP: registers: Add _types header
ahendriksen Apr 20, 2023
8d3f015
Change RAFT_COMPILED from INTERFACE to PUBLIC
ahendriksen Apr 20, 2023
e0ef4ba
Define RAFT_EXPLICIT and RAFT_EXPLICIT_INSTANTIATE_ONLY
ahendriksen Apr 20, 2023
8d4f526
Update docs
ahendriksen Apr 20, 2023
77a8bfe
Replace specializations by split headers
ahendriksen Apr 20, 2023
dbbbcef
Deprecate specialization headers
ahendriksen Apr 20, 2023
3845cd9
Add interleaved scan instances
ahendriksen Apr 20, 2023
10180b8
Separate fused_l2_nn_helpers
ahendriksen Apr 20, 2023
8dd3861
Remove pairwise_matrix_instantiation_point
ahendriksen Apr 20, 2023
d2ef3d6
Rename specialization => instantiation
ahendriksen Apr 20, 2023
c3a72b6
test/neighbors/selection.cu: Expose kFaissMaxK
ahendriksen Apr 20, 2023
8021304
Update docs/source/developer_guide.md
ahendriksen Apr 27, 2023
5bdc435
Update docs/source/developer_guide.md
ahendriksen Apr 27, 2023
e1c67d7
Update docs/source/using_libraft.md
ahendriksen Apr 27, 2023
4235ae0
Update docs/source/using_libraft.md
ahendriksen Apr 27, 2023
eca9128
dev guide: Point out to document correct header
ahendriksen Apr 27, 2023
7af7711
Replace !defined by ifndef for consistency
ahendriksen Apr 27, 2023
8174472
Remove includes of specialization headers
ahendriksen Apr 20, 2023
85e9109
test/distance/dist_adj.cu: Add instance
ahendriksen Apr 20, 2023
27c50fe
test/cluster/linkage.cu: Allow instance
ahendriksen Apr 20, 2023
d3dd7f0
test/sparse/neighbors/connect_components.cu: Allow instance
ahendriksen Apr 20, 2023
117f66e
test/neighbors/ann_ivf_pq/test_float_uint32_t.cu: Allow instance
ahendriksen Apr 20, 2023
e50ebd0
test/matrix/select_k.cu: Change index type
ahendriksen Apr 20, 2023
a65a8c8
test/neighbors/fused_l2_knn.cu: Change index type
ahendriksen Apr 20, 2023
7a4ffea
Force explicit instantiations in tests
ahendriksen Apr 27, 2023
12063c6
Force explicit instantiations in benchmarks
ahendriksen Apr 20, 2023
ca56e56
Test that headers are free standing
ahendriksen Apr 20, 2023
7d338b4
Update cpp/test/matrix/select_k.cu
ahendriksen Apr 27, 2023
3f55667
Split ivf-pq and ivf-flat search
ahendriksen Apr 20, 2023
522bd64
Make ivf_flat_search RAFT_EXPLICIT
ahendriksen Apr 26, 2023
9038e29
Isolate logger and memory pool
ahendriksen Apr 20, 2023
bc1e512
Add documentation to RAFT_INLINE_CONDITIONAL
ahendriksen Apr 26, 2023
2937ad6
logger: Do not include cudart_utils.hpp
ahendriksen Apr 27, 2023
7cdef04
Move RAFT_INLINE_CONDITIONAL to macros.hpp
ahendriksen Apr 27, 2023
0368286
Define RAFT_WEAK_FUNCTION
ahendriksen Apr 27, 2023
fd8386c
Run clang-format
ahendriksen Apr 27, 2023
6d8ec7b
cub_wrapper: Fix uninitialized worksize
ahendriksen Apr 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Separate fused_l2_nn_helpers
These types are not used in the ext header, but are useful to have.
ahendriksen committed Apr 27, 2023
commit 10180b8b9f41d018f542acab8a31f9cf037edae3
16 changes: 5 additions & 11 deletions cpp/include/raft/distance/fused_l2_nn-ext.cuh
Original file line number Diff line number Diff line change
@@ -16,23 +16,17 @@

#pragma once

#include <cstdint> // int64_t
#include <raft/core/device_resources.hpp> // raft::device_resources
#include <raft/core/kvp.hpp> // raft::KeyValuePair
#include <raft/util/raft_explicit.hpp> // RAFT_EXPLICIT
#include <cstdint> // int64_t
#include <raft/core/device_resources.hpp> // raft::device_resources
#include <raft/core/kvp.hpp> // raft::KeyValuePair
#include <raft/distance/fused_l2_nn_helpers.cuh> // include initialize and reduce operations
#include <raft/util/raft_explicit.hpp> // RAFT_EXPLICIT

#ifdef RAFT_EXPLICIT_INSTANTIATE_ONLY

namespace raft {
namespace distance {

template <typename DataT, typename OutT, typename IdxT, typename ReduceOpT>
void initialize(raft::device_resources const& handle,
OutT* min,
IdxT m,
DataT maxVal,
ReduceOpT redOp) RAFT_EXPLICIT;

template <typename DataT, typename OutT, typename IdxT>
void fusedL2NNMinReduce(OutT* min,
const DataT* x,
26 changes: 1 addition & 25 deletions cpp/include/raft/distance/fused_l2_nn-inl.cuh
Original file line number Diff line number Diff line change
@@ -23,38 +23,14 @@
#include <limits>
#include <raft/core/device_resources.hpp>
#include <raft/distance/detail/fused_l2_nn.cuh>
#include <raft/distance/fused_l2_nn_helpers.cuh>
#include <raft/linalg/contractions.cuh>
#include <raft/util/cuda_utils.cuh>
#include <stdint.h>
#include <type_traits>

namespace raft {
namespace distance {
/**
* \defgroup fused_l2_nn Fused 1-nearest neighbors
* @{
*/

template <typename LabelT, typename DataT>
using KVPMinReduce = detail::KVPMinReduceImpl<LabelT, DataT>;

template <typename LabelT, typename DataT>
using MinAndDistanceReduceOp = detail::MinAndDistanceReduceOpImpl<LabelT, DataT>;

template <typename LabelT, typename DataT>
using MinReduceOp = detail::MinReduceOpImpl<LabelT, DataT>;

/** @} */

/**
* Initialize array using init value from reduction op
*/
template <typename DataT, typename OutT, typename IdxT, typename ReduceOpT>
void initialize(
raft::device_resources const& handle, OutT* min, IdxT m, DataT maxVal, ReduceOpT redOp)
{
detail::initialize<DataT, OutT, IdxT, ReduceOpT>(min, m, maxVal, redOp, handle.get_stream());
}

/**
* \ingroup fused_l2_nn
49 changes: 49 additions & 0 deletions cpp/include/raft/distance/fused_l2_nn_helpers.cuh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* Copyright (c) 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.
* 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 the License.
*/

#pragma once

#include <raft/distance/detail/fused_l2_nn.cuh>

namespace raft::distance {

/**
* \defgroup fused_l2_nn Fused 1-nearest neighbors
* @{
*/

template <typename LabelT, typename DataT>
using KVPMinReduce = detail::KVPMinReduceImpl<LabelT, DataT>;

template <typename LabelT, typename DataT>
using MinAndDistanceReduceOp = detail::MinAndDistanceReduceOpImpl<LabelT, DataT>;

template <typename LabelT, typename DataT>
using MinReduceOp = detail::MinReduceOpImpl<LabelT, DataT>;

/** @} */

/**
* Initialize array using init value from reduction op
*/
template <typename DataT, typename OutT, typename IdxT, typename ReduceOpT>
void initialize(
raft::device_resources const& handle, OutT* min, IdxT m, DataT maxVal, ReduceOpT redOp)
{
detail::initialize<DataT, OutT, IdxT, ReduceOpT>(min, m, maxVal, redOp, handle.get_stream());
}

} // namespace raft::distance