cu-matrix-speed-test.cc File Reference
#include <iostream>
#include <vector>
#include <cstdlib>
#include "base/kaldi-common.h"
#include "util/common-utils.h"
#include "cudamatrix/cu-matrix.h"
#include "cudamatrix/cu-vector.h"
#include "cudamatrix/cu-math.h"
#include "cudamatrix/cu-tp-matrix.h"
#include "cudamatrix/cu-sp-matrix.h"
#include "cudamatrix/cu-sparse-matrix.h"
Include dependency graph for cu-matrix-speed-test.cc:

Go to the source code of this file.

Namespaces

 kaldi
 This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for mispronunciations detection tasks, the reference:
 

Functions

template<typename Real >
std::string NameOf ()
 
template<typename Real >
void TestCuMatrixSum (int32 dim)
 
template<typename Real >
void TestCuMatrixMax (int32 dim)
 
template<typename Real >
void TestCuMatrixMin (int32 dim)
 
template<typename Real >
void TestCuMatrixDivRowsVec (int32 dim)
 
template<typename Real >
void TestCuMatrixTransposeNS (int32 dim)
 
template<typename Real >
void TestCuMatrixTransposeS (int32 dim)
 
template<typename Real >
void TestCuMatrixTransposeCross (int32 dim)
 
template<typename Real >
void TestCuMatrixAddMat (int32 dim, int32 num_row_blocks, int32 num_col_blocks)
 
template<typename Real >
void TestCuMatrixAddMatBlocks (int32 dim, int32 num_row_blocks, int32 num_col_blocks)
 
template<typename Real >
void TestCuMatrixMatMat (int32 dim)
 
template<typename Real >
void TestCuMatrixMatMatBatched (int32 dim, int32 batchCount)
 
template<typename Real >
void TestCuMatrixAddDiagVecMat (int32 dim, MatrixTransposeType trans)
 
template<typename Real >
void TestSymInvertPosDef (int32 dim)
 
template<typename Real >
static void TestCuMatrixCompObjfAndDeriv (int32 dim)
 
template<typename Real >
static void TestCuFindRowMaxId (int32 dim)
 
template<typename Real >
void TestCuMatrixSigmoid (int32 dim)
 
template<typename Real >
void TestCuMatrixHeaviside (int32 dim)
 
template<typename Real >
void TestCuMatrixMulRowsGroupMat (int32 dim)
 
template<typename Real >
void TestCuMatrixDiffSoftmax (int32 dim)
 
template<typename Real >
void TestCuMatrixDiffLogSoftmax (int32 dim)
 
template<typename Real >
void TestCuMatrixSoftmax (int32 dim)
 
template<typename Real >
void TestCuMatrixLogSoftmax (int32 dim)
 
template<typename Real >
void TestCuMatrixGroupPnorm (int32 dim)
 
template<typename Real >
void TestCuMatrixDiffGroupPnorm (int32 dim)
 
template<typename Real >
void TestCuMatrixGroupMax (int32 dim)
 
template<typename Real >
void TestCuMatrixGroupMaxAllGroupSizes (int32 dim)
 
template<typename Real >
void TestCuMatrixGroupMaxDeriv (int32 dim)
 
template<typename Real >
void TestCuMatrixTraceMatMat (int32 dim)
 
template<typename Real >
void TestCuMatrixCholesky (int32 dim)
 
template<typename Real >
void TestCuMatrixCopyLowerToUpper (int32 dim)
 
template<typename Real >
void TestCuMatrixCopyFromTp (int32 dim, MatrixTransposeType trans)
 
template<typename Real >
void TestCuMatrixCopyFromSp (int32 dim)
 
template<typename Real >
void TestCuMatrixCopyUpperToLower (int32 dim)
 
template<typename Real >
void TestCuMatrixResize (int32 size_multiple)
 
template<typename Real >
void TestCuMatrixSetZeroAboveDiag (int32 dim)
 
template<typename Real >
void TestCuMatrixLookup (int32 dim)
 
template<typename Real >
void TestCuMatrixCopyRows1 (int32 dim)
 
template<typename Real >
void TestCuMatrixCopyRows2 (int32 dim)
 
template<typename Real >
void TestCuMatrixCopyToRows (int32 dim)
 
template<typename Real >
void TestCuMatrixAddRows1 (int32 dim)
 
template<typename Real >
void TestCuMatrixAddRows2 (int32 dim)
 
template<typename Real >
void TestCuMatrixAddToRows (int32 dim)
 
template<typename Real >
void TestCuMatrixAddRowRanges (int32 dim)
 
template<typename Real >
void TestCuSparseMatrixTraceMatSmat (int32 dim)
 
template<typename Real >
void CudaMatrixSpeedTest ()
 
int main ()
 

Function Documentation

◆ main()

int main ( )

Definition at line 1120 of file cu-matrix-speed-test.cc.

References KALDI_LOG, KALDI_WARN, and kaldi::SetVerboseLevel().

1120  {
1121  SetVerboseLevel(1);
1122 #if HAVE_CUDA == 1
1123  int32 loop = 0;
1124  for (loop = 0; loop < 2; loop++) {
1125  if (loop == 0)
1126  CuDevice::Instantiate().SelectGpuId("no");
1127  else
1128  CuDevice::Instantiate().SelectGpuId("yes");
1129 #endif
1130 
1131  kaldi::CudaMatrixSpeedTest<float>();
1132 #if HAVE_CUDA == 1
1133  if (CuDevice::Instantiate().DoublePrecisionSupported()) {
1134  kaldi::CudaMatrixSpeedTest<double>();
1135  } else {
1136  KALDI_WARN << "Double precision not supported";
1137  }
1138 #else
1139  kaldi::CudaMatrixSpeedTest<double>();
1140 #endif
1141 #if HAVE_CUDA == 1
1142  } // No for loop if 'HAVE_CUDA != 1',
1143  CuDevice::Instantiate().PrintProfile();
1144 #endif
1145  KALDI_LOG << "Tests succeeded.";
1146 }
kaldi::int32 int32
void SetVerboseLevel(int32 i)
This should be rarely used, except by programs using Kaldi as library; command-line programs set the ...
Definition: kaldi-error.h:64
#define KALDI_WARN
Definition: kaldi-error.h:150
#define KALDI_LOG
Definition: kaldi-error.h:153