summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 683e3b5)
raw | patch | inline | side by side (parent: 683e3b5)
author | Daniel Galvez <galv@users.noreply.github.com> | |
Sat, 2 Sep 2017 04:19:20 +0000 (21:19 -0700) | ||
committer | Daniel Povey <dpovey@gmail.com> | |
Sat, 2 Sep 2017 04:19:20 +0000 (21:19 -0700) |
Note that the memory leaks were incredibly unlikely to be encountered
anyway.
anyway.
index 99f7d7911ff02f377bd242daec44d61fcd0b96ce..fb302666437fe815ca3b0227d5e22c14ff4ea324 100644 (file)
int main() {
SetVerboseLevel(1);
- int32 loop = 0;
#if HAVE_CUDA == 1
+ int32 loop = 0;
for (loop = 0; loop < 2; loop++) {
if (loop == 0)
CuDevice::Instantiate().SelectGpuId("no");
index 50c23a7be63ed94b99be490de6cb386821624f22..cb291a2b50eb3c3f819cded7b7705384e9bbdb03 100644 (file)
Real *p_work;
void *temp;
if ((p_work = static_cast<Real*>(
- KALDI_MEMALIGN(16, sizeof(Real)*l_work, &temp))) == NULL)
+ KALDI_MEMALIGN(16, sizeof(Real)*l_work, &temp))) == NULL) {
+ delete[] pivot;
throw std::bad_alloc();
+ }
clapack_Xgetrf2(&M, &N, data_, &LDA, pivot, &result);
const int pivot_offset = 1;
index 70efc9b46eada337f42d9d86791493ff27ad1c54..bd1f62e2b22716c2c7466f409125012465bdaece 100644 (file)
--- a/src/matrix/sp-matrix.cc
+++ b/src/matrix/sp-matrix.cc
Real *p_work; // workspace for the lapack function
void *temp;
if ((p_work = static_cast<Real*>(
- KALDI_MEMALIGN(16, sizeof(Real) * rows, &temp))) == NULL)
+ KALDI_MEMALIGN(16, sizeof(Real) * rows, &temp))) == NULL) {
+ delete[] p_ipiv;
throw std::bad_alloc();
+ }
#ifdef HAVE_OPENBLAS
memset(p_work, 0, sizeof(Real) * rows); // gets rid of a probably
// spurious Valgrind warning about jumps depending upon uninitialized values.
index 651c3a82f2917e619efea1c089197fa6a1a0022e..e5345b5c7a2c3af02da07ac015046d649a2596ef 100644 (file)
int main() {
using namespace kaldi;
using namespace kaldi::nnet3;
- kaldi::int32 loop = 0;
SetVerboseLevel(3);
#if HAVE_CUDA == 1
+ int32 loop = 0;
for (loop = 0; loop < 2; loop++) {
CuDevice::Instantiate().SetDebugStrideMode(true);
if (loop == 0)