File tree Expand file tree Collapse file tree 1 file changed +1
-13
lines changed
paddle/fluid/distributed/service Expand file tree Collapse file tree 1 file changed +1
-13
lines changed Original file line number Diff line number Diff line change @@ -138,23 +138,11 @@ void SerializeSelectedRows(framework::Variable* var,
138138 var_data->clear ();
139139 var_data->resize (rows->size () * sizeof (int64_t ));
140140 char * data_ptr = const_cast <char *>(var_data->data ());
141-
142- if (platform::is_cpu_place (tensor->place ())) {
143- memcpy (data_ptr, &(*rows)[0 ], rows->size () * sizeof (int64_t ));
144- } else {
145- #ifdef PADDLE_WITH_CUDA
146- auto stream =
147- reinterpret_cast <const platform::CUDADeviceContext&>(ctx).stream ();
148- memory::Copy (platform::CPUPlace (), data_ptr,
149- BOOST_GET_CONST (platform::CUDAPlace, tensor->place ()),
150- &(*rows)[0 ], rows->size () * sizeof (int64_t ), stream);
151- #endif
152- }
141+ memcpy (data_ptr, &((*rows)[0 ]), rows->size () * sizeof (int64_t ));
153142 var_msg->set_data_type (static_cast <VarMsg::Type>(tensor->type ()));
154143 for (auto & dim : framework::vectorize (tensor->dims ())) {
155144 var_msg->add_dims (dim);
156145 }
157-
158146 // IO Buffer
159147 if (platform::is_cpu_place (tensor->place ())) {
160148 auto data_len = tensor->numel () * framework::SizeOfType (tensor->type ());
You can’t perform that action at this time.
0 commit comments