cu-test.cc File Reference
#include <iostream>
#include <vector>
#include <cstdlib>
#include <ctime>
#include "base/kaldi-common.h"
#include "cudamatrix/cu-device.h"
#include "cudamatrix/cu-sp-matrix.h"
#include "cudamatrix/cu-tp-matrix.h"
#include "cudamatrix/cu-packed-matrix.h"
#include "cudamatrix/cu-vector.h"
#include <numeric>
#include <time.h>
Include dependency graph for cu-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 InitRand (SpMatrix< Real > *M)
 
template<typename Real >
static void InitRand (VectorBase< Real > *v)
 
template<typename Real >
static void UnitTestSetZeroAboveDiag ()
 
template<typename Real >
static void UnitTestCholesky ()
 
template<typename Real >
static void UnitTestTrace ()
 
template<typename Real >
static void UnitInvert ()
 
template<typename Real >
static void UnitTestInvert ()
 
template<typename Real >
static void UnitTestConstructor ()
 
template<typename Real >
static void UnitTestCopySp ()
 
template<typename Real >
static void UnitTestCopyFromMat ()
 
template<typename Real >
static void UnitTestMatrix ()
 
template<typename Real >
static void UnitTestMulTp ()
 
template<typename Real >
static void UnitTestVector ()
 
template<typename Real >
static void CuMatrixUnitTest ()
 
int main ()
 

Function Documentation

◆ main()

int main ( )

Definition at line 576 of file cu-test.cc.

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

576  {
577  using namespace kaldi;
578  SetVerboseLevel(1);
579 #if HAVE_CUDA == 1
580  for (int32 loop = 0; loop < 2; loop++) {
581  if (loop == 0)
582  CuDevice::Instantiate().SelectGpuId("no");
583  else
584  CuDevice::Instantiate().SelectGpuId("yes");
585 #endif
586  kaldi::CuMatrixUnitTest<float>();
587 
588 #if HAVE_CUDA == 1
589  if (!kaldi::CuDevice::Instantiate().DoublePrecisionSupported()) {
590  KALDI_WARN << "Double precision not supported, not testing that code";
591  } else
592 #endif
593  {
594  kaldi::CuMatrixUnitTest<double>();
595  }
596 #if HAVE_CUDA == 1
597  }
598  kaldi::CuDevice::Instantiate().PrintProfile();
599 #endif
600 
601  KALDI_LOG << "Tests succeeded.";
602  return 0;
603 }
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