static */
| 877 | } |
| 878 | |
| 879 | /* static */ port::Status GpuDriver::SynchronousMemcpyD2H( |
| 880 | GpuContext* context, void* host_dst, hipDeviceptr_t gpu_src, uint64 size) { |
| 881 | ScopedActivateContext activation{context}; |
| 882 | hipError_t res = tensorflow::wrap::hipMemcpyDtoH(host_dst, gpu_src, size); |
| 883 | if (res != hipSuccess) { |
| 884 | return port::InternalError( |
| 885 | absl::StrFormat("failed to synchronous memcpy from device to host: %s; " |
| 886 | "host dst: %p; Gpu src: %p; size: %llu=0x%llx", |
| 887 | ToString(res).c_str(), host_dst, |
| 888 | absl::bit_cast<void*>(gpu_src), size, size)); |
| 889 | } |
| 890 | VLOG(2) << "successfully sync memcpy'd d2h of " << size << " bytes to " |
| 891 | << host_dst; |
| 892 | return port::Status::OK(); |
| 893 | } |
| 894 | |
| 895 | /* static */ port::Status GpuDriver::SynchronousMemcpyH2D( |
| 896 | GpuContext* context, hipDeviceptr_t gpu_dst, const void* host_src, |