diff --git a/paddle/platform/CMakeLists.txt b/paddle/platform/CMakeLists.txt index 9a3ad8eb642052a848ce5dc895005cf8c597dc7c..17bdac8749e31565b119b2cb84aed199fac0f441 100644 --- a/paddle/platform/CMakeLists.txt +++ b/paddle/platform/CMakeLists.txt @@ -23,5 +23,4 @@ cc_library(device_context SRCS device_context.cc DEPS memory buddy_allocator system_allocator memory_block meta_data meta_cache place eigen3 ${GPU_CTX_DEPS}) nv_test(device_context_test SRCS device_context_test.cc DEPS device_context gpu_info) -nv_library(cudnn_helper SRCS cudnn_helper.cc DEPS dynload_cuda) nv_test(cudnn_helper_test SRCS cudnn_helper_test.cc DEPS dynload_cuda) diff --git a/paddle/platform/cudnn_helper.cc b/paddle/platform/cudnn_helper.cc deleted file mode 100644 index 764285e2ba040e7dedf5dccf0365c1a099d719d0..0000000000000000000000000000000000000000 --- a/paddle/platform/cudnn_helper.cc +++ /dev/null @@ -1,15 +0,0 @@ -/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -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 "paddle/platform/cudnn_helper.h" diff --git a/paddle/platform/cudnn_helper.h b/paddle/platform/cudnn_helper.h index 6a43f49cfc3fbfd786017889fd00232446961c0b..24ddf3441caa6e5f45a7b96af26a23ed324dc1b6 100644 --- a/paddle/platform/cudnn_helper.h +++ b/paddle/platform/cudnn_helper.h @@ -14,9 +14,6 @@ limitations under the License. */ #pragma once -#ifndef PADDLE_ONLY_CPU -#include -#include "glog/logging.h" #include "paddle/platform/dynload/cudnn.h" #include "paddle/platform/enforce.h" #include "paddle/platform/macros.h" @@ -42,30 +39,12 @@ template <> class CudnnDataType { public: static const cudnnDataType_t type = CUDNN_DATA_FLOAT; - typedef const float ScalingParamType; - static ScalingParamType* kOne() { - static ScalingParamType v = 1.0; - return &v; - } - static const ScalingParamType* kZero() { - static ScalingParamType v = 0.0; - return &v; - } }; template <> class CudnnDataType { public: static const cudnnDataType_t type = CUDNN_DATA_DOUBLE; - typedef const double ScalingParamType; - static ScalingParamType* kOne() { - static ScalingParamType v = 1.0; - return &v; - } - static ScalingParamType* kZero() { - static ScalingParamType v = 0.0; - return &v; - } }; inline cudnnTensorFormat_t GetCudnnTensorFormat(const DataLayout& order) { @@ -219,4 +198,3 @@ class ScopedPoolingDescriptor { } // namespace platform } // namespace paddle -#endif diff --git a/paddle/platform/cudnn_helper_test.cc b/paddle/platform/cudnn_helper_test.cc index 729f2f8a10fcb1dac5c9510cb1cf0345dc8f542f..6bd85ae1ca8b47b203e0321e9d9224d5cfd3a586 100644 --- a/paddle/platform/cudnn_helper_test.cc +++ b/paddle/platform/cudnn_helper_test.cc @@ -13,8 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #include "paddle/platform/cudnn_helper.h" -#include "glog/logging.h" -#include "gtest/gtest.h" +#include TEST(CudnnHelper, ScopedTensorDescriptor) { using paddle::platform::ScopedTensorDescriptor;