imate
C++/CUDA Reference
cu_orthogonalization.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright 2021, Siavash Ameli <sameli@berkeley.edu>
3  * SPDX-License-Identifier: BSD-3-Clause
4  * SPDX-FileType: SOURCE
5  *
6  * This program is free software: you can redistribute it and/or modify it
7  * under the terms of the license found in the LICENSE.txt file in the root
8  * directory of this source tree.
9  */
10 
11 
12 #ifndef _CU_TRACE_ESTIMATOR_CU_ORTHOGONALIZATION_H_
13 #define _CU_TRACE_ESTIMATOR_CU_ORTHOGONALIZATION_H_
14 
15 // =======
16 // Imports
17 // =======
18 
19 #include <cublas_v2.h> // cublasHandle_t
20 #include "../_definitions/types.h" // IndexType, LongIndexType, FlagType
21 
22 
23 // ====================
24 // cu Orthogonalization
25 // ====================
26 
34 
35 template <typename DataType>
37 {
38  public:
39 
40  // Gram-Schmidt Process
41  static void gram_schmidt_process(
42  cublasHandle_t cublas_handle,
43  const DataType* V,
44  const LongIndexType vector_size,
45  const IndexType num_vectors,
46  const IndexType last_vector,
47  const FlagType num_ortho,
48  DataType* r);
49 
50  // Orthogonalize Vectors
51  static void orthogonalize_vectors(
52  cublasHandle_t cublas_handle,
53  DataType* vectors,
54  const LongIndexType vector_size,
55  const IndexType num_vectors);
56 };
57 
58 #endif // _CU_TRACE_ESTIMATOR_CU_ORTHOGONALIZATION_H_
A static class for orthogonalization of vector bases. This class acts as a templated namespace,...
static void gram_schmidt_process(cublasHandle_t cublas_handle, const DataType *V, const LongIndexType vector_size, const IndexType num_vectors, const IndexType last_vector, const FlagType num_ortho, DataType *r)
Modified Gram-Schmidt orthogonalization process to orthogonalize the vector v against a subset of the...
static void orthogonalize_vectors(cublasHandle_t cublas_handle, DataType *vectors, const LongIndexType vector_size, const IndexType num_vectors)
Orthogonalizes set of vectors mutually using modified Gram-Schmidt process.
int LongIndexType
Definition: types.h:60
int FlagType
Definition: types.h:68
int IndexType
Definition: types.h:65