From 498b7eed25bdb3b90f2fc45dd822c96aa08db2f8 Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Thu, 9 Oct 2014 15:39:13 -0700 Subject: [PATCH] Rewrote the TensorBase::random method to support the generation of random number on gpu. --- unsupported/Eigen/CXX11/src/Tensor/TensorBase.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h b/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h index 90a9cc2c4..d4b7846a0 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h @@ -39,9 +39,14 @@ class TensorBase } EIGEN_DEVICE_FUNC - EIGEN_STRONG_INLINE const TensorCwiseNullaryOp, const Derived> + EIGEN_STRONG_INLINE const TensorCwiseNullaryOp, const Derived> random() const { - return TensorCwiseNullaryOp, const Derived>(derived()); + return TensorCwiseNullaryOp, const Derived>(derived()); + } + template EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE const TensorCwiseNullaryOp + random() const { + return TensorCwiseNullaryOp(derived()); } // Coefficient-wise unary operators