fix gpu build error

cblas_new
qijun 8 years ago
parent ff594fac84
commit a71a9e6393

@ -117,7 +117,7 @@ class Tensor {
#ifdef PADDLE_ONLY_CPU
PADDLE_THROW("'GPUPlace' is not supported in CPU only device.");
#else
GpuMemcpySync(dst_ptr, src_ptr, size, cudaMemcpyDeviceToHost);
platform::GpuMemcpySync(dst_ptr, src_ptr, size, cudaMemcpyDeviceToHost);
#endif
}
}

@ -138,13 +138,12 @@ All parameter, weight, gradient are variables in Paddle.
})
#ifndef PADDLE_ONLY_CPU
.def_static("gpu_context",
[](paddle::platform::Place& place)
[](paddle::platform::GPUPlace& place)
-> paddle::platform::DeviceContext* {
return new paddle::platform::CUDADeviceContext(place);
})
return new paddle::platform::CUDADeviceContext(place);
})
#endif
;
; // NOLINT
py::class_<paddle::platform::Place>(m, "GPUPlace").def(py::init<int>());
py::class_<paddle::platform::Place>(m, "CPUPlace").def(py::init<>());

@ -102,7 +102,7 @@ void PyTensorSetFromArray(
#ifdef PADDLE_ONLY_CPU
PADDLE_THROW("'GPUPlace' is not supported in CPU only device.");
#else
GpuMemcpySync(
platform::GpuMemcpySync(
dst, array.data(), sizeof(T) * array.size(), cudaMemcpyHostToDevice);
#endif
}

Loading…
Cancel
Save