cu-device-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 dependency graph for cu-device-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 TestCuMatrixResize (int32 size_multiple)
 
template<typename Real >
void CudaMatrixResizeTest ()
 
int main ()
 

Function Documentation

◆ main()

int main ( )

Definition at line 101 of file cu-device-test.cc.

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

101  {
102  SetVerboseLevel(1);
103 #if HAVE_CUDA == 1
104  for (int32 loop = 0; loop < 2; loop++) {
105  CuDevice::Instantiate().SetDebugStrideMode(true);
106  if (loop == 0)
107  CuDevice::Instantiate().SelectGpuId("no");
108  else
109  CuDevice::Instantiate().SelectGpuId("yes");
110 #endif
111 
112  kaldi::CudaMatrixResizeTest<float>();
113 #if HAVE_CUDA == 1
114  if (CuDevice::Instantiate().DoublePrecisionSupported()) {
115  kaldi::CudaMatrixResizeTest<double>();
116  } else {
117  KALDI_WARN << "Double precision not supported";
118  }
119 #else
120  kaldi::CudaMatrixResizeTest<double>();
121 #endif
122 
123 #if HAVE_CUDA == 1
124  }
125  CuDevice::Instantiate().PrintProfile();
126 #endif
127  KALDI_LOG << "Tests succeeded.";
128 }
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