cu-array-test.cc File Reference
#include <iostream>
#include <vector>
#include <cstdlib>
#include "base/kaldi-common.h"
#include "util/common-utils.h"
#include "cudamatrix/cu-array.h"
Include dependency graph for cu-array-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<class T >
void AssertEqual (const std::vector< T > &vec1, const std::vector< T > &vec2)
 
template<class T >
static void UnitTestCuArray ()
 
int main ()
 

Function Documentation

◆ main()

int main ( )

Definition at line 118 of file cu-array-test.cc.

References KALDI_LOG, and kaldi::SetVerboseLevel().

118  {
119  SetVerboseLevel(1);
120  int32 loop = 0;
121 #if HAVE_CUDA == 1
122  for (; loop < 2; loop++) {
123  CuDevice::Instantiate().SetDebugStrideMode(true);
124  if (loop == 0)
125  CuDevice::Instantiate().SelectGpuId("no");
126  else
127  CuDevice::Instantiate().SelectGpuId("yes");
128 #endif
129 
130  //kaldi::UnitTestCuArray<float>();
131  kaldi::UnitTestCuArray<double>();
132  kaldi::UnitTestCuArray<int32>();
133  kaldi::UnitTestCuArray<std::pair<int32, int32> >();
134 
135  if (loop == 0)
136  KALDI_LOG << "Tests without GPU use succeeded.";
137  else
138  KALDI_LOG << "Tests with GPU use (if available) succeeded.";
139 #if HAVE_CUDA == 1
140  }
141  CuDevice::Instantiate().PrintProfile();
142 #endif
143  return 0;
144 }
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_LOG
Definition: kaldi-error.h:153