cu-sp-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-sp-matrix.h"
Include dependency graph for cu-sp-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 >
static void UnitTestCuSpMatrixInvert (int32 dim)
 
template<typename Real >
static void UnitTestCuSpMatrixCopyFromMat (int32 dim, SpCopyType copy_type)
 
template<typename Real >
void CuSpMatrixSpeedTest ()
 
int main ()
 

Function Documentation

◆ main()

int main ( )

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

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

130  {
131  SetVerboseLevel(1);
132  //Select the GPU
133 #if HAVE_CUDA == 1
134  CuDevice::Instantiate().SelectGpuId("yes"); //-2 .. automatic selection
135 #endif
136 
137  kaldi::CuSpMatrixSpeedTest<float>();
138 #if HAVE_CUDA == 1
139  if (CuDevice::Instantiate().DoublePrecisionSupported()) {
140  kaldi::CuSpMatrixSpeedTest<double>();
141  } else {
142  KALDI_WARN << "Double precision not supported";
143  }
144 #else
145  kaldi::CuSpMatrixSpeedTest<double>();
146 #endif
147 #if HAVE_CUDA == 1
148  CuDevice::Instantiate().PrintProfile();
149 #endif
150  KALDI_LOG << "Tests succeeded.";
151 }
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