Skip to content

Commit

Permalink
dbscan: Remove naive versions of algorithms
Browse files Browse the repository at this point in the history
This fixes issue rapidsai#3414.
  • Loading branch information
ahendriksen committed Jul 25, 2022
1 parent 0b4142a commit 41405d5
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 217 deletions.
1 change: 0 additions & 1 deletion cpp/src/dbscan/adjgraph/algo.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include <thrust/device_ptr.h>
#include <thrust/scan.h>

#include "../common.cuh"
#include "pack.h"

#include <raft/cuda_utils.cuh>
Expand Down
65 changes: 0 additions & 65 deletions cpp/src/dbscan/adjgraph/naive.cuh

This file was deleted.

6 changes: 3 additions & 3 deletions cpp/src/dbscan/adjgraph/runner.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#pragma once

#include "algo.cuh"
#include "naive.cuh"
#include "pack.h"

namespace ML {
Expand All @@ -39,8 +38,9 @@ void run(const raft::handle_t& handle,
{
Pack<Index_> data = {vd, adj, adj_graph, adjnnz, ex_scan, N};
switch (algo) {
// TODO: deprecate naive runner. cf #3414
case 0: Naive::launcher<Index_>(handle, data, batch_size, stream); break;
case 0:
ASSERT(
false, "Incorrect algo '%d' passed! Naive version of adjgraph has been removed.", algo);
case 1: Algo::launcher<Index_>(handle, data, batch_size, row_counters, stream); break;
default: ASSERT(false, "Incorrect algo passed! '%d'", algo);
}
Expand Down
43 changes: 0 additions & 43 deletions cpp/src/dbscan/common.cuh

This file was deleted.

2 changes: 2 additions & 0 deletions cpp/src/dbscan/dbscan.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ void dbscanFitImpl(const raft::handle_t& handle,
{
raft::common::nvtx::range fun_scope("ML::Dbscan::Fit");
ML::Logger::get().setLevel(verbosity);
// XXX: for algo_vd and algo_adj, 0 (naive) is no longer an option and has
// been removed.
int algo_vd = (metric == raft::distance::Precomputed) ? 2 : 1;
int algo_adj = 1;
int algo_ccl = 2;
Expand Down
93 changes: 0 additions & 93 deletions cpp/src/dbscan/vertexdeg/naive.cuh

This file was deleted.

9 changes: 0 additions & 9 deletions cpp/src/dbscan/vertexdeg/precomputed.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,6 @@ namespace Dbscan {
namespace VertexDeg {
namespace Precomputed {

template <typename value_t, typename index_t>
__global__ void dist_to_adj_kernel(
const value_t* X, bool* adj, index_t N, index_t start_vertex_id, index_t batch_size, value_t eps)
{
for (index_t i = threadIdx.x; i < batch_size; i += blockDim.x) {
adj[batch_size * blockIdx.x + i] = X[N * blockIdx.x + start_vertex_id + i] <= eps;
}
}

/**
* Calculates the vertex degree array and the epsilon neighborhood adjacency matrix for the batch.
*/
Expand Down
6 changes: 3 additions & 3 deletions cpp/src/dbscan/vertexdeg/runner.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#pragma once

#include "algo.cuh"
#include "naive.cuh"
#include "pack.h"
#include "precomputed.cuh"

Expand All @@ -41,8 +40,9 @@ void run(const raft::handle_t& handle,
{
Pack<Type_f, Index_> data = {vd, adj, x, eps, N, D};
switch (algo) {
// TODO: deprecate naive runner. cf #3414
case 0: Naive::launcher<Type_f, Index_>(data, start_vertex_id, batch_size, stream); break;
case 0:
ASSERT(
false, "Incorrect algo '%d' passed! Naive version of vertexdeg has been removed.", algo);
case 1:
Algo::launcher<Type_f, Index_>(handle, data, start_vertex_id, batch_size, stream, metric);
break;
Expand Down

0 comments on commit 41405d5

Please sign in to comment.