| 472 | |
| 473 | |
| 474 | inline auto CreateTensor(daliBufferPlacement_t placement) { |
| 475 | daliTensor_h handle; |
| 476 | auto err = daliTensorCreate(&handle, placement); |
| 477 | switch (err) { |
| 478 | case DALI_SUCCESS: |
| 479 | break; |
| 480 | case DALI_ERROR_OUT_OF_MEMORY: |
| 481 | throw std::bad_alloc(); |
| 482 | case DALI_ERROR_INVALID_ARGUMENT: |
| 483 | throw std::invalid_argument(daliGetLastErrorMessage()); |
| 484 | default: |
| 485 | throw std::runtime_error(daliGetLastErrorMessage()); |
| 486 | } |
| 487 | return dali::c_api::TensorHandle(handle); |
| 488 | } |
| 489 | |
| 490 | void TestTensorResize(daliStorageDevice_t storage_device) { |
| 491 | daliBufferPlacement_t placement{}; |
no test coverage detected