From 1918ad875980a7b5fb54c207e56d86b4376e2505 Mon Sep 17 00:00:00 2001 From: qijun Date: Tue, 22 Aug 2017 12:16:30 +0800 Subject: [PATCH] fix gpu build error --- paddle/operators/math/CMakeLists.txt | 4 ++-- paddle/operators/math/math_function.cc | 9 --------- paddle/operators/math/math_function.cu | 13 ------------- paddle/operators/math/math_function.h | 5 ----- paddle/platform/device_context_test.cc | 2 -- 5 files changed, 2 insertions(+), 31 deletions(-) diff --git a/paddle/operators/math/CMakeLists.txt b/paddle/operators/math/CMakeLists.txt index 228f463f2b..ed51d416ed 100644 --- a/paddle/operators/math/CMakeLists.txt +++ b/paddle/operators/math/CMakeLists.txt @@ -1,8 +1,8 @@ if(WITH_GPU) - nv_library(math_function SRCS math_function.cc math_function.cu DEPS cblas device_context eigen3) + nv_library(math_function SRCS math_function.cc math_function.cu DEPS cblas device_context) else() - cc_library(math_function SRCS math_function.cc DEPS cblas device_context eigen3) + cc_library(math_function SRCS math_function.cc DEPS cblas device_context) endif() nv_test(math_function_test SRCS math_function_test.cc DEPS math_function tensor) diff --git a/paddle/operators/math/math_function.cc b/paddle/operators/math/math_function.cc index d9824e5f96..1e86fc3d16 100644 --- a/paddle/operators/math/math_function.cc +++ b/paddle/operators/math/math_function.cc @@ -109,15 +109,6 @@ void matmul(const framework::Tensor& matrix_a, matrix_b.data(), beta, matrix_out->data(), context); } -template <> -void Set(const int n, const float alpha, - float* output, - platform::DeviceContext* context) { - auto* cpu_context = reinterpret_cast(context); - framework::EigenVector::Type out(output, n); - out.device(*(cpu_context->eigen_device())) = out.constant(float(alpha)); -} - } // namespace math } // namespace operators } // namespace paddle diff --git a/paddle/operators/math/math_function.cu b/paddle/operators/math/math_function.cu index 9dff6f05fb..da40b27c94 100644 --- a/paddle/operators/math/math_function.cu +++ b/paddle/operators/math/math_function.cu @@ -12,10 +12,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include -#include -#include -#include #include "paddle/operators/math/math_function.h" namespace paddle { @@ -126,15 +122,6 @@ void matmul(const framework::Tensor& matrix_a, matrix_b.data(), beta, matrix_out->data(), context); } -template <> -void Set(const int n, const float alpha, - float* output, - platform::DeviceContext* context) { - auto* cuda_context = reinterpret_cast(context); - framework::EigenVector::Type out(output, n); - out.device(*(cuda_context->eigen_device())) = out.constant(float(alpha)); -} - } // namespace math } // namespace operators } // namespace paddle diff --git a/paddle/operators/math/math_function.h b/paddle/operators/math/math_function.h index a0e9660564..155589fadb 100644 --- a/paddle/operators/math/math_function.h +++ b/paddle/operators/math/math_function.h @@ -52,7 +52,6 @@ int LAPACKE_dgetri(int matrix_layout, int n, double* a, int lda, #include -#include "paddle/framework/eigen.h" #include "paddle/framework/tensor.h" #include "paddle/platform/device_context.h" #include "paddle/platform/enforce.h" @@ -78,10 +77,6 @@ void matmul(const framework::Tensor& matrix_a, bool trans_a, framework::Tensor* matrix_out, T beta, platform::DeviceContext* context); -template -void Set(const int n, const T alpha, T* output, - platform::DeviceContext* context); - } // namespace math } // namespace operators } // namespace paddle diff --git a/paddle/platform/device_context_test.cc b/paddle/platform/device_context_test.cc index 8b764bdcd9..5883a55272 100644 --- a/paddle/platform/device_context_test.cc +++ b/paddle/platform/device_context_test.cc @@ -43,8 +43,6 @@ TEST(Device, CUDADeviceContext) { ASSERT_NE(nullptr, cudnn_handle); cublasHandle_t cublas_handle = device_context->cublas_handle(); ASSERT_NE(nullptr, cublas_handle); - curandGenerator_t curand_handle = device_context->curand_generator(); - ASSERT_NE(nullptr, curand_handle); ASSERT_NE(nullptr, device_context->stream()); delete device_context; } -- GitLab