This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
View | Details | Raw Unified | Return to bug 1530 | Differences between
and this patch

Collapse All | Expand All

(-)a/unsupported/Eigen/CXX11/src/Tensor/TensorForcedEval.h (+3 lines)
Lines 125-130 struct TensorEvaluator<const TensorForcedEvalOp<ArgType>, Device> Link Here
125
    return true;
125
    return true;
126
  }
126
  }
127
  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void cleanup() {
127
  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void cleanup() {
128
    const Index numValues = internal::array_prod(m_impl.dimensions());
129
    for (Index i = 0; i < numValues; ++i)
130
      m_buffer[i].~CoeffReturnType();
128
    m_device.deallocate(m_buffer);
131
    m_device.deallocate(m_buffer);
129
    m_buffer = NULL;
132
    m_buffer = NULL;
130
  }
133
  }
(-)a/unsupported/test/CMakeLists.txt (+2 lines)
Lines 144-149 ei_add_test(cxx11_tensor_sugar) Link Here
144
ei_add_test(cxx11_tensor_roundings)
144
ei_add_test(cxx11_tensor_roundings)
145
ei_add_test(cxx11_tensor_layout_swap)
145
ei_add_test(cxx11_tensor_layout_swap)
146
ei_add_test(cxx11_tensor_io)
146
ei_add_test(cxx11_tensor_io)
147
ei_add_test(cxx11_tensor_string_leak)
148
147
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
149
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
148
  # This test requires __uint128_t which is only available on 64bit systems
150
  # This test requires __uint128_t which is only available on 64bit systems
149
  ei_add_test(cxx11_tensor_uint128)
151
  ei_add_test(cxx11_tensor_uint128)
(-)a/unsupported/test/cxx11_tensor_string_leak.cpp (-1 / +24 lines)
Line 0 Link Here
0
- 
1
// This file is part of Eigen, a lightweight C++ template library
2
// for linear algebra.
3
//
4
// Copyright (C) 2014 Benoit Steiner <benoit.steiner.goog@gmail.com>
5
//
6
// This Source Code Form is subject to the terms of the Mozilla
7
// Public License v. 2.0. If a copy of the MPL was not distributed
8
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9
10
#include "main.h"
11
12
#include <Eigen/CXX11/Tensor>
13
#include <Eigen/Core>
14
15
using Eigen::Tensor;
16
17
static void test_simple() {
18
  std::string strs[2] = {"OK", "OK"};
19
20
  TensorMap<Tensor<std::string, 1> > str_tensor(strs, 2);
21
  std::cout << str_tensor;
22
}
23
24
void test_cxx11_tensor_string_leak() { CALL_SUBTEST(test_simple()); }

Return to bug 1530