LCOV - code coverage report
Current view: top level - elsa/storage/transforms - Cast.h (source / functions) Hit Total Coverage
Test: coverage-all.lcov Lines: 6 6 100.0 %
Date: 2024-05-16 04:22:26 Functions: 8 10 80.0 %

          Line data    Source code
       1             : #pragma once
       2             : 
       3             : #include <thrust/transform.h>
       4             : #include <thrust/iterator/iterator_traits.h>
       5             : 
       6             : namespace elsa
       7             : {
       8             :     /// @brief Cast input range to type from output range
       9             :     /// @ingroup transforms
      10             :     template <class InputIter, class OutIter>
      11             :     void cast(InputIter first, InputIter last, OutIter out)
      12         452 :     {
      13         452 :         using From = thrust::remove_cvref_t<thrust::iterator_value_t<InputIter>>;
      14         452 :         using To = thrust::remove_cvref_t<thrust::iterator_value_t<OutIter>>;
      15             : 
      16         452 :         thrust::transform(first, last, out,
      17       26834 :                           [] __host__ __device__(const From& val) { return To(val); });
      18         452 :     }
      19             : } // namespace elsa

Generated by: LCOV version 1.14