| 47 | } |
| 48 | |
| 49 | size_t LocalBackwardDataImpl::get_workspace_in_bytes( |
| 50 | const TensorLayout& filter, const TensorLayout& diff, |
| 51 | const TensorLayout& grad) { |
| 52 | auto N = grad.shape[0], IC = grad.shape[1], IH = grad.shape[2], IW = grad.shape[3], |
| 53 | OC = diff.shape[1], OH = diff.shape[2], OW = diff.shape[3], |
| 54 | FH = filter.shape[3], FW = filter.shape[4]; |
| 55 | auto PH = param().pad_h, PW = param().pad_w, SH = param().stride_h, |
| 56 | SW = param().stride_w; |
| 57 | size_t res = 0u; |
| 58 | if (use_cuda_convnet(filter, diff, grad)) { |
| 59 | res = local::get_workspace_in_floats_backward_data_proxy_convnet( |
| 60 | N, IC, IH, IW, OC, OH, OW, FH, FW, IC * IH * IW, OC * OH * OW, PH, |
| 61 | PW, SH, SW) * |
| 62 | sizeof(dt_float32); |
| 63 | } else { |
| 64 | local::boom_backward_data(); |
| 65 | } |
| 66 | return res; |
| 67 | } |
| 68 | |
| 69 | bool LocalBackwardDataImpl::use_cuda_convnet( |
| 70 | const TensorLayout& filter, const TensorLayout& diff, |
nothing calls this directly
no test coverage detected