cu-tp-matrix-test.cc File Reference
#include <iostream>
#include <vector>
#include <cstdlib>
#include "base/kaldi-common.h"
#include "cudamatrix/cu-device.h"
#include "cudamatrix/cu-tp-matrix.h"
#include "cudamatrix/cu-vector.h"
#include "cudamatrix/cu-math.h"
#include "cudamatrix/cu-sp-matrix.h"
Include dependency graph for cu-tp-matrix-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 >
static void AssertEqual (const CuPackedMatrix< Real > &A, const CuPackedMatrix< Real > &B, float tol=0.001)
 
template<typename Real >
static void AssertEqual (const PackedMatrix< Real > &A, const PackedMatrix< Real > &B, float tol=0.001)
 
template<typename Real >
static void AssertEqual (const PackedMatrix< Real > &A, const CuPackedMatrix< Real > &B, float tol=0.001)
 
template<typename Real >
static void UnitTestCuTpMatrixInvert ()
 
template<typename Real >
static void UnitTestCuTpMatrixCopyFromTp ()
 
template<typename Real >
static void UnitTestCuTpMatrixCopyFromMat ()
 
template<typename Real >
static void UnitTestCuTpMatrixCholesky ()
 
template<class Real >
static void UnitTestCuTpMatrixIO ()
 
template<typename Real >
void CudaTpMatrixUnitTest ()
 
int main ()
 

Function Documentation

◆ main()

int main ( )

Definition at line 187 of file cu-tp-matrix-test.cc.

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

187  {
188  using namespace kaldi;
189  SetVerboseLevel(1);
190 
191  int32 loop = 0;
192 #if HAVE_CUDA == 1
193  for (; loop < 2; loop++) {
194  CuDevice::Instantiate().SetDebugStrideMode(true);
195  if (loop == 0)
196  CuDevice::Instantiate().SelectGpuId("no"); // -1 means no GPU
197  else
198  CuDevice::Instantiate().SelectGpuId("yes"); // -2 .. automatic selection
199 #endif
200  kaldi::CudaTpMatrixUnitTest<float>();
201 #if HAVE_CUDA == 1
202  if (CuDevice::Instantiate().DoublePrecisionSupported()) {
203  kaldi::CudaTpMatrixUnitTest<double>();
204  } else {
205  KALDI_WARN << "Double precision not supported";
206  }
207 #else
208  kaldi::CudaTpMatrixUnitTest<double>();
209 #endif
210 
211  if (loop == 0)
212  KALDI_LOG << "Tests without GPU use succeeded.";
213  else
214  KALDI_LOG << "Tests with GPU use (if available) succeeded.";
215 #if HAVE_CUDA == 1
216  }
217  CuDevice::Instantiate().PrintProfile();
218 #endif
219  return 0;
220 }
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
Definition: chain.dox:20
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