TODO(pbar) Checksum is called from places without a valid device context.
| 438 | |
| 439 | // TODO(pbar) Checksum is called from places without a valid device context. |
| 440 | uint64 GPUUtil::Checksum(Device* gpu_device, |
| 441 | const DeviceContext* device_context, |
| 442 | const Tensor& tensor) { |
| 443 | Tensor copy(tensor.dtype(), tensor.shape()); |
| 444 | Status s; |
| 445 | Notification n; |
| 446 | CopyGPUTensorToCPU(gpu_device, device_context, &tensor, ©, |
| 447 | [&s, &n](Status status) { |
| 448 | s.Update(status); |
| 449 | n.Notify(); |
| 450 | }); |
| 451 | n.WaitForNotification(); |
| 452 | CHECK(s.ok()) << s; |
| 453 | return Checksum(copy); |
| 454 | } |
| 455 | |
| 456 | uint64 GPUUtil::Checksum(const Tensor& tensor) { |
| 457 | const float* fptr = reinterpret_cast<const float*>(GetBase(&tensor)); |
nothing calls this directly
no test coverage detected