Unverified Commit bcd37684 authored by Hongzhi (Steve), Chen's avatar Hongzhi (Steve), Chen Committed by GitHub
Browse files

[Misc] Replace /*! with /**. (#4823)



* replace

* blabla

* balbla

* blabla
Co-authored-by: default avatarSteve <ubuntu@ip-172-31-34-29.ap-northeast-1.compute.internal>
parent 619d735d
/*!
/**
* Copyright 2019-2021 Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
......
/*!
/**
* Copyright 2021 Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
......
/*!
/**
* Copyright (c) 2021 by Contributors
* @file graph/transform/cpu/kdtree_ndarray_adapter.h
* @brief NDArray adapter for nanoflann, without
......@@ -18,7 +18,7 @@ namespace dgl {
namespace transform {
namespace knn_utils {
/*!
/**
* @brief A simple 2D NDArray adapter for nanoflann, without duplicating the
* storage.
*
......@@ -65,7 +65,7 @@ class KDTreeNDArrayAdapter {
index_type* GetIndex() { return index_; }
/*!
/**
* @brief Query for the \a num_closest points to a given point
* Note that this is a short-cut method for GetIndex()->findNeighbors().
*/
......@@ -77,19 +77,19 @@ class KDTreeNDArrayAdapter {
index_->findNeighbors(resultSet, query_pt, nanoflann::SearchParams());
}
/*! @brief Interface expected by KDTreeSingleIndexAdaptor */
/** @brief Interface expected by KDTreeSingleIndexAdaptor */
const self_type& derived() const { return *this; }
/*! @brief Interface expected by KDTreeSingleIndexAdaptor */
/** @brief Interface expected by KDTreeSingleIndexAdaptor */
self_type& derived() { return *this; }
/*!
/**
* @brief Interface expected by KDTreeSingleIndexAdaptor,
* return the number of data points
*/
size_t kdtree_get_point_count() const { return data_->shape[0]; }
/*!
/**
* @brief Interface expected by KDTreeSingleIndexAdaptor,
* return the dim'th component of the idx'th point
*/
......@@ -97,7 +97,7 @@ class KDTreeNDArrayAdapter {
return data_.Ptr<FloatType>()[idx * data_->shape[1] + dim];
}
/*!
/**
* @brief Interface expected by KDTreeSingleIndexAdaptor.
* Optional bounding-box computation: return false to
* default to a standard bbox computation loop.
......
/*!
/**
* Copyright (c) 2019 by Contributors
* @file graph/transform/cpu/knn.cc
* @brief k-nearest-neighbor (KNN) implementation
......@@ -27,7 +27,7 @@ namespace impl {
// This value is directly from pynndescent
static constexpr int NN_DESCENT_BLOCK_SIZE = 16384;
/*!
/**
* @brief Compute Euclidean distance between two vectors, return positive
* infinite value if the intermediate distance is greater than the worst
* distance.
......@@ -54,7 +54,7 @@ FloatType EuclideanDistWithCheck(
}
}
/*! @brief Compute Euclidean distance between two vectors */
/** @brief Compute Euclidean distance between two vectors */
template <typename FloatType, typename IdType>
FloatType EuclideanDist(
const FloatType* vec1, const FloatType* vec2, int64_t dim) {
......@@ -67,7 +67,7 @@ FloatType EuclideanDist(
return dist;
}
/*! @brief Insert a new element into a heap */
/** @brief Insert a new element into a heap */
template <typename FloatType, typename IdType>
void HeapInsert(
IdType* out, FloatType* dist, IdType new_id, FloatType new_dist, int k,
......@@ -104,7 +104,7 @@ void HeapInsert(
}
}
/*! @brief Insert a new element and its flag into heap, return 1 if insert
/** @brief Insert a new element and its flag into heap, return 1 if insert
* successfully */
template <typename FloatType, typename IdType>
int FlaggedHeapInsert(
......@@ -144,7 +144,7 @@ int FlaggedHeapInsert(
return 1;
}
/*! @brief Build heap for each point. Used by NN-descent */
/** @brief Build heap for each point. Used by NN-descent */
template <typename FloatType, typename IdType>
void BuildHeap(IdType* index, FloatType* dist, int k) {
for (int i = k / 2 - 1; i >= 0; --i) {
......@@ -170,7 +170,7 @@ void BuildHeap(IdType* index, FloatType* dist, int k) {
}
}
/*!
/**
* @brief Neighbor update process in NN-descent. The distance between
* two points are computed. If this new distance is less than any worst
* distance of these two points, we update the neighborhood of that point.
......@@ -208,7 +208,7 @@ int UpdateNeighbors(
return num_updates;
}
/*! @brief The kd-tree implementation of K-Nearest Neighbors */
/** @brief The kd-tree implementation of K-Nearest Neighbors */
template <typename FloatType, typename IdType>
void KdTreeKNN(
const NDArray& data_points, const IdArray& data_offsets,
......
/*!
/**
* Copyright 2021 Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
......
/*!
/**
* Copyright 2020-2021 Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
......
/*!
/**
* Copyright 2020-2021 Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
......
/*!
/**
* Copyright (c) 2020 by Contributors
* @file graph/transform/cuda/knn.cu
* @brief k-nearest-neighbor (KNN) implementation (cuda)
......@@ -22,7 +22,7 @@
namespace dgl {
namespace transform {
namespace impl {
/*!
/**
* @brief Utility class used to avoid linker errors with extern
* unsized shared memory arrays with templated type
*/
......@@ -54,7 +54,7 @@ struct SharedMemory<double> {
}
};
/*! @brief Compute Euclidean distance between two vectors in a cuda kernel */
/** @brief Compute Euclidean distance between two vectors in a cuda kernel */
template <typename FloatType, typename IdType>
__device__ FloatType
EuclideanDist(const FloatType* vec1, const FloatType* vec2, const int64_t dim) {
......@@ -77,7 +77,7 @@ EuclideanDist(const FloatType* vec1, const FloatType* vec2, const int64_t dim) {
return dist;
}
/*!
/**
* @brief Compute Euclidean distance between two vectors in a cuda kernel,
* return positive infinite value if the intermediate distance is greater
* than the worst distance.
......@@ -238,7 +238,7 @@ __device__ bool FlaggedHeapInsert(
return true;
}
/*!
/**
* @brief Brute force kNN kernel. Compute distance for each pair of input points
* and get the result directly (without a distance matrix).
*/
......@@ -278,7 +278,7 @@ __global__ void BruteforceKnnKernel(
}
}
/*!
/**
* @brief Same as BruteforceKnnKernel, but use shared memory as buffer.
* This kernel divides query points and data points into blocks. For each
* query block, it will make a loop over all data blocks and compute distances.
......@@ -400,7 +400,7 @@ __global__ void BruteforceKnnShareKernel(
}
}
/*! @brief determine the number of blocks for each segment */
/** @brief determine the number of blocks for each segment */
template <typename IdType>
__global__ void GetNumBlockPerSegment(
const IdType* offsets, IdType* out, const int64_t batch_size,
......@@ -411,7 +411,7 @@ __global__ void GetNumBlockPerSegment(
}
}
/*! @brief Get the batch index and local index in segment for each block */
/** @brief Get the batch index and local index in segment for each block */
template <typename IdType>
__global__ void GetBlockInfo(
const IdType* num_block_prefixsum, IdType* block_batch_id,
......@@ -429,7 +429,7 @@ __global__ void GetBlockInfo(
}
}
/*!
/**
* @brief Brute force kNN. Compute distance for each pair of input points and
* get the result directly (without a distance matrix).
*
......@@ -472,7 +472,7 @@ void BruteForceKNNCuda(
device->FreeWorkspace(ctx, dists);
}
/*!
/**
* @brief Brute force kNN with shared memory.
* This function divides query points and data points into blocks. For each
* query block, it will make a loop over all data blocks and compute distances.
......@@ -575,7 +575,7 @@ void BruteForceKNNSharedCuda(
device->FreeWorkspace(ctx, block_batch_id);
}
/*! @brief Setup rng state for nn-descent */
/** @brief Setup rng state for nn-descent */
__global__ void SetupRngKernel(
curandState* states, const uint64_t seed, const size_t n) {
size_t id = blockIdx.x * blockDim.x + threadIdx.x;
......@@ -584,7 +584,7 @@ __global__ void SetupRngKernel(
}
}
/*!
/**
* @brief Randomly initialize neighbors (sampling without replacement)
* for each nodes
*/
......@@ -636,7 +636,7 @@ __global__ void RandomInitNeighborsKernel(
BuildHeap<FloatType, IdType>(neighbors + point_idx * k, current_dists, k);
}
/*!
/**
* @brief Randomly select candidates from current knn and reverse-knn graph for
* nn-descent.
*/
......@@ -735,7 +735,7 @@ __global__ void FindCandidatesKernel(
}
}
/*! @brief Update knn graph according to selected candidates for nn-descent */
/** @brief Update knn graph according to selected candidates for nn-descent */
template <typename FloatType, typename IdType>
__global__ void UpdateNeighborsKernel(
const FloatType* points, const IdType* offsets, IdType* neighbors,
......
/*!
/**
* Copyright (c) 2019 by Contributors
* @file graph/transform/knn.cc
* @brief k-nearest-neighbor (KNN) interface
......
/*!
/**
* Copyright (c) 2021 by Contributors
* @file graph/transform/knn.h
* @brief k-nearest-neighbor (KNN) implementation
......@@ -14,7 +14,7 @@
namespace dgl {
namespace transform {
/*!
/**
* @brief For each point in each segment in \a query_points, find \a k nearest
* points in the same segment in \a data_points. \a data_offsets and \a
* query_offsets determine the start index of each segment in \a
......@@ -35,7 +35,7 @@ void KNN(
const NDArray& query_points, const IdArray& query_offsets, const int k,
IdArray result, const std::string& algorithm);
/*!
/**
* @brief For each input point, find \a k approximate nearest points in the same
* segment using NN-descent algorithm.
*
......
/*!
/**
* Copyright (c) 2020 by Contributors
* @file graph/transform/line_graph.cc
* @brief Line graph implementation
......@@ -22,7 +22,7 @@ using namespace dgl::aten;
namespace transform {
/*!
/**
* @brief Create Line Graph.
* @param hg Graph.
* @param backtracking whether the pair of (v, u) (u, v) edges are treated as
......
/*!
/**
* Copyright (c) 2020 by Contributors
* @file graph/metis_partition.cc
* @brief Call Metis partitioning
......
/*!
/**
* Copyright (c) 2020 by Contributors
* @file graph/metis_partition.cc
* @brief Call Metis partitioning
......
/*!
/**
* Copyright (c) 2019 by Contributors
* @file graph/transform/remove_edges.cc
* @brief Remove edges.
......
/*!
/**
* Copyright 2019-2021 Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
......
/*!
/**
* Copyright 2021 Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
......
/*!
/**
* Copyright (c) 2019 by Contributors
* @file graph/transform/to_simple.cc
* @brief Convert multigraphs to simple graphs
......
/*!
/**
* Copyright (c) 2020 by Contributors
* @file graph/transform/union_partition.cc
* @brief Functions for partition, union multiple graphs.
......
/*!
/**
* Copyright (c) 2018 by Contributors
* @file graph/traversal.cc
* @brief Graph traversal implementation
......@@ -88,7 +88,7 @@ IdArray ComputeMergedSections(const std::vector<std::vector<DType>>& traces) {
} // namespace
/*!
/**
* @brief Class for representing frontiers.
*
* Each frontier is a list of nodes/edges (specified by their ids).
......@@ -96,13 +96,13 @@ IdArray ComputeMergedSections(const std::vector<std::vector<DType>>& traces) {
* value).
*/
struct Frontiers {
/*!\brief a vector store for the nodes/edges in all the frontiers */
/** @brief a vector store for the nodes/edges in all the frontiers */
std::vector<dgl_id_t> ids;
/*!\brief a vector store for node/edge tags. Empty if no tags are requested */
/** @brief a vector store for node/edge tags. Empty if no tags are requested */
std::vector<int64_t> tags;
/*!\brief a section vector to indicate each frontier */
/** @brief a section vector to indicate each frontier */
std::vector<int64_t> sections;
};
......
/*!
/**
* Copyright (c) 2018 by Contributors
* @file graph/traversal.h
* @brief Graph traversal routines.
......@@ -20,7 +20,7 @@
namespace dgl {
namespace traverse {
/*!
/**
* @brief Traverse the graph in a breadth-first-search (BFS) order.
*
* The queue object must suffice following interface:
......@@ -81,7 +81,7 @@ void BFSNodes(
}
}
/*!
/**
* @brief Traverse the graph in a breadth-first-search (BFS) order, returning
* the edges of the BFS tree.
*
......@@ -145,7 +145,7 @@ void BFSEdges(
}
}
/*!
/**
* @brief Traverse the graph in topological order.
*
* The queue object must suffice following interface:
......@@ -212,13 +212,13 @@ void TopologicalNodes(
}
}
/*!\brief Tags for ``DFSEdges``. */
/** @brief Tags for ``DFSEdges``. */
enum DFSEdgeTag {
kForward = 0,
kReverse,
kNonTree,
};
/*!
/**
* @brief Traverse the graph in a depth-first-search (DFS) order.
*
* The traversal visit edges in its DFS order. Edges have three tags:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment