cu-packed-matrix-test.cc File Reference
#include <iostream>
#include <vector>
#include <cstdlib>
#include "base/kaldi-common.h"
#include "cudamatrix/cu-device.h"
#include "cudamatrix/cu-sp-matrix.h"
#include "cudamatrix/cu-vector.h"
#include "cudamatrix/cu-math.h"
Include dependency graph for cu-packed-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 AssertDiagEqual (const PackedMatrix< Real > &A, const CuPackedMatrix< Real > &B, float value, float tol=0.001)
 
template<typename Real >
static void AssertDiagEqual (const PackedMatrix< Real > &A, const PackedMatrix< Real > &B, float value, 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 bool ApproxEqual (const PackedMatrix< Real > &A, const PackedMatrix< Real > &B, Real tol=0.001)
 
template<typename Real >
static void UnitTestCuPackedMatrixConstructor ()
 
template<typename Real >
static void UnitTestCuPackedMatrixCopy ()
 
template<typename Real >
static void UnitTestCuPackedMatrixTrace ()
 
template<typename Real >
static void UnitTestCuPackedMatrixScale ()
 
template<typename Real >
static void UnitTestCuPackedMatrixScaleDiag ()
 
template<typename Real >
static void UnitTestCuPackedMatrixAddToDiag ()
 
template<typename Real >
static void UnitTestCuPackedMatrixSetUnit ()
 
template<typename Real >
void CudaPackedMatrixUnitTest ()
 
int main ()
 

Function Documentation

◆ main()

int main ( )

Definition at line 243 of file cu-packed-matrix-test.cc.

References KALDI_LOG, and KALDI_WARN.

243  {
244  using namespace kaldi;
245 #if HAVE_CUDA == 1
246  CuDevice::Instantiate().SetDebugStrideMode(true);
247  // Select the GPU
248  CuDevice::Instantiate().SelectGpuId("yes");
249 #endif
250  kaldi::CudaPackedMatrixUnitTest<float>();
251 #if HAVE_CUDA == 1
252  if (CuDevice::Instantiate().DoublePrecisionSupported()) {
253  kaldi::CudaPackedMatrixUnitTest<double>();
254  } else {
255  KALDI_WARN << "Double precision not supported";
256  }
257 #else
258  kaldi::CudaPackedMatrixUnitTest<double>();
259 #endif
260 
261  KALDI_LOG << "Tests succeeded";
262 #if HAVE_CUDA == 1
263  CuDevice::Instantiate().PrintProfile();
264 #endif
265  return 0;
266 }
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
Definition: chain.dox:20
#define KALDI_WARN
Definition: kaldi-error.h:150
#define KALDI_LOG
Definition: kaldi-error.h:153