Loading [MathJax]/extensions/tex2jax.js
cuML C++ API  23.12
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
pack.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018-2023, NVIDIA CORPORATION.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 namespace ML {
20 namespace Dbscan {
21 namespace VertexDeg {
22 
23 template <typename Type, typename Index_>
24 struct Pack {
30  Index_* vd;
32  Type* weight_sum;
34  bool* adj;
36  const Type* x;
38  const Type* sample_weight;
40  Type eps;
42  Index_ N;
44  Index_ D;
45 
51  void resetArray(cudaStream_t stream, Index_ vdlen)
52  {
53  RAFT_CUDA_TRY(cudaMemsetAsync(vd, 0, sizeof(Index_) * vdlen, stream));
54  }
55 };
56 
57 } // namespace VertexDeg
58 } // namespace Dbscan
59 } // namespace ML
Definition: dbscan.hpp:27
Definition: pack.h:24
Index_ N
Definition: pack.h:42
bool * adj
Definition: pack.h:34
Index_ * vd
Definition: pack.h:30
const Type * sample_weight
Definition: pack.h:38
Type eps
Definition: pack.h:40
const Type * x
Definition: pack.h:36
Index_ D
Definition: pack.h:44
Type * weight_sum
Definition: pack.h:32
void resetArray(cudaStream_t stream, Index_ vdlen)
reset the output array before calling the actual kernel
Definition: pack.h:51