提交 66cf21c8 编写于 作者: F fengjiayi

fix compile error

上级 68adb954
......@@ -2,7 +2,7 @@
cc_library(ddim SRCS ddim.cc)
cc_test(ddim_test SRCS ddim_test.cc DEPS ddim)
nv_test(dim_test SRCS dim_test.cu DEPS ddim)
cc_test(tensor_test SRCS tensor_test.cc DEPS ddim paddle_memory)
cc_test(tensor_test SRCS tensor_test.cc DEPS ddim place paddle_memory)
cc_test(variable_test SRCS variable_test.cc)
cc_test(scope_test SRCS scope_test.cc)
cc_test(enforce_test SRCS enforce_test.cc)
......
......@@ -72,7 +72,7 @@ TEST(Tensor, MutableData) {
p2 = src_tensor.mutable_data<float>(make_ddim({2, 2}), CPUPlace());
EXPECT_EQ(p1, p2);
}
/*
#ifdef __CUDACC__
{
Tensor src_tensor;
float* p1 = nullptr;
......@@ -94,7 +94,7 @@ TEST(Tensor, MutableData) {
p2 = src_tensor.mutable_data<float>(make_ddim({2, 2}), GPUPlace());
EXPECT_EQ(p1, p2);
}
*/
#endif
}
TEST(Tensor, ShareDataFrom) {
......@@ -123,7 +123,7 @@ TEST(Tensor, ShareDataFrom) {
ASSERT_EQ(src_tensor.data<int>(), dst_tensor.data<int>());
}
/*
#ifdef __CUDACC__
{
Tensor src_tensor;
Tensor dst_tensor;
......@@ -131,7 +131,7 @@ TEST(Tensor, ShareDataFrom) {
dst_tensor.ShareDataFrom<int>(src_tensor);
ASSERT_EQ(src_tensor.data<int>(), dst_tensor.data<int>());
}
*/
#endif
}
TEST(Tensor, Slice) {
......@@ -160,7 +160,7 @@ TEST(Tensor, Slice) {
EXPECT_EQ(src_data_address + 3 * 4 * 1 * sizeof(int), slice_data_address);
}
/*
#ifdef __CUDACC__
{
Tensor src_tensor;
src_tensor.mutable_data<double>(make_ddim({6, 9}), GPUPlace());
......@@ -182,7 +182,7 @@ TEST(Tensor, Slice) {
EXPECT_EQ(slice_data_address, slice_mutable_data_address);
EXPECT_EQ(src_data_address + 9 * 2 * sizeof(double), slice_data_address);
}
*/
#endif
}
TEST(Tensor, CopyFrom) {
......@@ -209,4 +209,4 @@ TEST(Tensor, CopyFrom) {
for (size_t i = 0; i < 3; ++i) {
EXPECT_EQ(dst_ptr[i], slice_ptr[i]);
}
}
\ No newline at end of file
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册