|
1 | | -# <div align="left"><img src="https://rapids.ai/assets/images/rapids_logo.png" width="90px"/> RAFT: Reusable Accelerated Functions and Tools for Vector Search and More</div> |
| 1 | +# <div align="left"><img src="https://rapids.ai/assets/images/rapids_logo.png" width="90px"/> RAFT: Reusable Accelerated Functions and Tools</div> |
2 | 2 |
|
3 | 3 | <p align="center"> |
4 | 4 | <img src="https://raw.githubusercontent.com/rapidsai/raft/HEAD/img/raft-tech-stack.svg" alt="RAFT tech stack" width="100%"> |
@@ -96,29 +96,7 @@ auto matrix = raft::make_device_matrix<float>(handle, n_rows, n_cols); |
96 | 96 | Most of the primitives in RAFT accept a `raft::device_resources` object for the management of resources which are expensive to create, such CUDA streams, stream pools, and handles to other CUDA libraries like `cublas` and `cusolver`. |
97 | 97 |
|
98 | 98 | The example below demonstrates creating a RAFT handle and using it with `device_matrix` and `device_vector` to allocate memory, generating random clusters, and computing |
99 | | -pairwise Euclidean distances: |
100 | | -```c++ |
101 | | -#include <raft/core/device_resources.hpp> |
102 | | -#include <raft/core/device_mdarray.hpp> |
103 | | -#include <raft/random/make_blobs.cuh> |
104 | | -#include <raft/distance/distance.cuh> |
105 | | - |
106 | | -raft::device_resources handle; |
107 | | - |
108 | | -int n_samples = 5000; |
109 | | -int n_features = 50; |
110 | | - |
111 | | -auto input = raft::make_device_matrix<float, int>(handle, n_samples, n_features); |
112 | | -auto labels = raft::make_device_vector<int, int>(handle, n_samples); |
113 | | -auto output = raft::make_device_matrix<float, int>(handle, n_samples, n_samples); |
114 | | - |
115 | | -raft::random::make_blobs(handle, input.view(), labels.view()); |
116 | | - |
117 | | -auto metric = raft::distance::DistanceType::L2SqrtExpanded; |
118 | | -raft::distance::pairwise_distance(handle, input.view(), input.view(), output.view(), metric); |
119 | | -``` |
120 | | -
|
121 | | -It's also possible to create `raft::device_mdspan` views to invoke the same API with raw pointers and shape information. Take this example from the [NVIDIA cuVS](https://github.com/rapidsai/cuvs) library: |
| 99 | +pairwise Euclidean distances with the [NVIDIA cuVS](https://github.com/rapidsai/cuvs) library: |
122 | 100 |
|
123 | 101 | ```c++ |
124 | 102 | #include <raft/core/device_resources.hpp> |
|
0 commit comments