diff --git a/paddle/fluid/memory/CMakeLists.txt b/paddle/fluid/memory/CMakeLists.txt index 66e4f8cdd024805ea17c0a0605d0cdf5151a4bb8..8b3043af7a18787a08583d47b76da679ccb63740 100644 --- a/paddle/fluid/memory/CMakeLists.txt +++ b/paddle/fluid/memory/CMakeLists.txt @@ -15,6 +15,6 @@ cc_library(paddle_memory cc_test(memory_test SRCS memory_test.cc DEPS place paddle_memory) -# if (WITH_GPU) -# nv_test(pinned_memory_test SRCS pinned_memory_test.cu DEPS place paddle_memory) -# endif() +#if (WITH_GPU) +# nv_test(pinned_memory_test SRCS pinned_memory_test.cu DEPS place paddle_memory) +#endif() diff --git a/paddle/fluid/memory/pinned_memory_test.cu b/paddle/fluid/memory/pinned_memory_test.cu index 926a5b265bb4179444f9d3259ba77dfb7241fe3f..a000001f41788fb16ac075426f06357cbe42d642 100644 --- a/paddle/fluid/memory/pinned_memory_test.cu +++ b/paddle/fluid/memory/pinned_memory_test.cu @@ -11,6 +11,8 @@ 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 +#include #include "paddle/fluid/memory/detail/memory_block.h" #include "paddle/fluid/memory/detail/meta_data.h" @@ -21,9 +23,6 @@ limitations under the License. */ #include "paddle/fluid/platform/gpu_info.h" #include "paddle/fluid/platform/place.h" -#include -#include - // This unit test is an example comparing the performance between using pinned // memory and not. In general, using pinned memory will be faster. template @@ -114,8 +113,8 @@ float test_pinned_memory() { cudaEventSynchronize(stop_e); cudaEventElapsedTime(&elapsedTime, start_e, stop_e); - std::cout << cpu_place << " " - << "time consume:" << elapsedTime / 30 << std::endl; + // std::cout << cpu_place << " " + // << "time consume:" << elapsedTime / 30 << std::endl; for (int l = 0; l < iteration; ++l) { for (int k = 0; k < data_size; ++k) { @@ -144,5 +143,5 @@ TEST(CPUANDCUDAPinned, CPUAllocatorAndCUDAPinnedAllocator) { // test for the time being. float time1 = test_pinned_memory(); float time2 = test_pinned_memory(); - EXPECT_GT(time1, time2) + EXPECT_GT(time1, time2); }