| 425 | } |
| 426 | |
| 427 | void CLGEMMDeconvolutionLayer::prepare() |
| 428 | { |
| 429 | if (!_is_prepared) |
| 430 | { |
| 431 | ARM_COMPUTE_ERROR_ON(!_original_weights->is_used()); |
| 432 | |
| 433 | if (_is_nchw) |
| 434 | { |
| 435 | _permuted_weights.allocator()->allocate(); |
| 436 | _permute_weights_to_nhwc.run(); |
| 437 | } |
| 438 | |
| 439 | _reshaped_weights.allocator()->allocate(); |
| 440 | _reshape_weights.run(); |
| 441 | |
| 442 | if (_is_nchw) |
| 443 | { |
| 444 | _permuted_weights.allocator()->free(); |
| 445 | } |
| 446 | |
| 447 | _reshaped_weights_t.allocator()->allocate(); |
| 448 | _transpose_weights.run(); |
| 449 | |
| 450 | // Prepare gemm |
| 451 | if (!_is_quantized) |
| 452 | { |
| 453 | _mm_gemm.prepare(); |
| 454 | } |
| 455 | else |
| 456 | { |
| 457 | _mm_gemmlowp.prepare(); |
| 458 | } |
| 459 | |
| 460 | // Free resources |
| 461 | if (!_reshaped_weights_t.is_used()) |
| 462 | { |
| 463 | _reshaped_weights_t.allocator()->free(); |
| 464 | } |
| 465 | |
| 466 | _original_weights->mark_as_unused(); |
| 467 | _is_prepared = true; |
| 468 | } |
| 469 | } |
| 470 | } // namespace arm_compute |