@@ -69,8 +69,8 @@ void testConcat() {
69
69
}
70
70
71
71
if (paddle::platform::is_gpu_place (Place ())) {
72
- paddle::framework::TensorCopy (input_a_cpu, Place (), *context , &input_a);
73
- paddle::framework::TensorCopy (input_b_cpu, Place (), *context , &input_b);
72
+ paddle::framework::TensorCopySync (input_a_cpu, Place (), &input_a);
73
+ paddle::framework::TensorCopySync (input_b_cpu, Place (), &input_b);
74
74
}
75
75
76
76
std::vector<paddle::framework::Tensor> input;
@@ -86,8 +86,8 @@ void testConcat() {
86
86
87
87
int * out_ptr;
88
88
if (paddle::platform::is_gpu_place (Place ())) {
89
- paddle::framework::TensorCopy (out, paddle::platform::CPUPlace (), *context ,
90
- &out_cpu);
89
+ paddle::framework::TensorCopySync (out, paddle::platform::CPUPlace (),
90
+ &out_cpu);
91
91
out_ptr = out_cpu.data <int >();
92
92
} else {
93
93
out_ptr = out.data <int >();
@@ -142,8 +142,8 @@ void testConcat() {
142
142
}
143
143
144
144
if (paddle::platform::is_gpu_place (Place ())) {
145
- paddle::framework::TensorCopy (input_a_cpu, Place (), *context , &input_a);
146
- paddle::framework::TensorCopy (input_b_cpu, Place (), *context , &input_b);
145
+ paddle::framework::TensorCopySync (input_a_cpu, Place (), &input_a);
146
+ paddle::framework::TensorCopySync (input_b_cpu, Place (), &input_b);
147
147
}
148
148
149
149
input.clear ();
@@ -157,8 +157,8 @@ void testConcat() {
157
157
PADDLE_ENFORCE_EQ (input_b.dims (), dim_b);
158
158
159
159
if (paddle::platform::is_gpu_place (Place ())) {
160
- paddle::framework::TensorCopy (out, paddle::platform::CPUPlace (), *context ,
161
- &out_cpu);
160
+ paddle::framework::TensorCopySync (out, paddle::platform::CPUPlace (),
161
+ &out_cpu);
162
162
out_ptr = out_cpu.data <int >();
163
163
} else {
164
164
out_ptr = out.data <int >();
@@ -215,8 +215,8 @@ void testConcat() {
215
215
}
216
216
217
217
if (paddle::platform::is_gpu_place (Place ())) {
218
- paddle::framework::TensorCopy (input_a_cpu, Place (), *context , &input_a);
219
- paddle::framework::TensorCopy (input_b_cpu, Place (), *context , &input_b);
218
+ paddle::framework::TensorCopySync (input_a_cpu, Place (), &input_a);
219
+ paddle::framework::TensorCopySync (input_b_cpu, Place (), &input_b);
220
220
}
221
221
222
222
input.clear ();
@@ -230,8 +230,8 @@ void testConcat() {
230
230
PADDLE_ENFORCE_EQ (input_b.dims (), dim_b);
231
231
232
232
if (paddle::platform::is_gpu_place (Place ())) {
233
- paddle::framework::TensorCopy (out, paddle::platform::CPUPlace (), *context ,
234
- &out_cpu);
233
+ paddle::framework::TensorCopySync (out, paddle::platform::CPUPlace (),
234
+ &out_cpu);
235
235
out_ptr = out_cpu.data <int >();
236
236
} else {
237
237
out_ptr = out.data <int >();
@@ -290,8 +290,8 @@ void testConcat() {
290
290
}
291
291
292
292
if (paddle::platform::is_gpu_place (Place ())) {
293
- paddle::framework::TensorCopy (input_a_cpu, Place (), *context , &input_a);
294
- paddle::framework::TensorCopy (input_b_cpu, Place (), *context , &input_b);
293
+ paddle::framework::TensorCopySync (input_a_cpu, Place (), &input_a);
294
+ paddle::framework::TensorCopySync (input_b_cpu, Place (), &input_b);
295
295
}
296
296
297
297
input.clear ();
@@ -305,8 +305,8 @@ void testConcat() {
305
305
PADDLE_ENFORCE_EQ (input_b.dims (), dim_b);
306
306
307
307
if (paddle::platform::is_gpu_place (Place ())) {
308
- paddle::framework::TensorCopy (out, paddle::platform::CPUPlace (), *context ,
309
- &out_cpu);
308
+ paddle::framework::TensorCopySync (out, paddle::platform::CPUPlace (),
309
+ &out_cpu);
310
310
out_ptr = out_cpu.data <int >();
311
311
} else {
312
312
out_ptr = out.data <int >();
0 commit comments