| 63 | |
| 64 | template<typename T> |
| 65 | void fill_tensor(nvcv::Tensor &tensor, const std::vector<T> &vec) |
| 66 | { |
| 67 | auto tensorData = tensor.exportData<nvcv::TensorDataStridedCuda>(); |
| 68 | CVCUDA_CHECK_DATA(tensorData); |
| 69 | |
| 70 | long3 strides{tensorData->stride(0), tensorData->stride(1)}; |
| 71 | long3 shape{tensorData->shape(0), tensorData->shape(1)}; |
| 72 | long bufSize{nvcv::cuda::GetElement(strides, 0) * nvcv::cuda::GetElement(shape, 0)}; |
| 73 | CVCUDA_CHECK_DATA(bufSize == vec.size()); |
| 74 | |
| 75 | CUDA_CHECK_ERROR(cudaMemcpy(tensorData->basePtr(), vec.data(), bufSize, cudaMemcpyHostToDevice)); |
| 76 | } |
| 77 | |
| 78 | template<typename T> |
| 79 | inline void FindHomography(nvbench::state &state, nvbench::type_list<T>) |