LCOV - code coverage report
Current view: top level - include/Runtime/Task - Task.hxx (source / functions) Hit Total Coverage
Test: streampu_clean.info Lines: 16 22 72.7 %
Date: 2024-07-31 15:48:41 Functions: 8 10 80.0 %

          Line data    Source code
       1             : #include <algorithm>
       2             : #include <cassert>
       3             : #include <sstream>
       4             : 
       5             : #include "Runtime/Task/Task.hpp"
       6             : 
       7             : namespace spu
       8             : {
       9             : namespace runtime
      10             : {
      11             : bool
      12      243338 : Task::is_autoalloc() const
      13             : {
      14      243338 :     return this->autoalloc;
      15             : }
      16             : 
      17             : bool
      18     3099534 : Task::is_stats() const
      19             : {
      20     3099534 :     return this->stats;
      21             : }
      22             : 
      23             : bool
      24     3112757 : Task::is_fast() const
      25             : {
      26             : #ifndef SPU_FAST
      27     3112757 :     return this->fast;
      28             : #else
      29             :     return true;
      30             : #endif
      31             : }
      32             : 
      33             : bool
      34     3100544 : Task::is_debug() const
      35             : {
      36     3100544 :     return this->debug;
      37             : }
      38             : 
      39             : bool
      40             : Task::is_debug_hex() const
      41             : {
      42             :     return this->debug_hex;
      43             : }
      44             : 
      45             : bool
      46         736 : Task::is_last_input_socket(const Socket& s_in) const
      47             : {
      48         736 :     return last_input_socket == &s_in;
      49             : }
      50             : 
      51             : module::Module&
      52    13099354 : Task::get_module() const
      53             : {
      54    13099354 :     return *this->module;
      55             : }
      56             : 
      57             : std::string
      58           0 : Task::get_name() const
      59             : {
      60           0 :     return this->name;
      61             : }
      62             : 
      63             : uint32_t
      64        2084 : Task::get_n_calls() const
      65             : {
      66        2084 :     return this->n_calls;
      67             : }
      68             : 
      69             : Socket&
      70           0 : Task::operator[](const size_t id)
      71             : {
      72           0 :     assert((size_t)id < this->sockets.size());
      73           0 :     assert(this->sockets[id] != nullptr);
      74             : 
      75           0 :     return *this->sockets[id];
      76             : }
      77             : 
      78             : void
      79             : Task::update_timer(const size_t id, const std::chrono::nanoseconds& duration)
      80             : {
      81             :     if (this->is_stats())
      82             :     {
      83             :         this->timers_n_calls[id]++;
      84             :         this->timers_total[id] += duration;
      85             :         if (this->n_calls)
      86             :         {
      87             :             this->timers_max[id] = std::max(this->timers_max[id], duration);
      88             :             this->timers_min[id] = std::min(this->timers_min[id], duration);
      89             :         }
      90             :         else
      91             :         {
      92             :             this->timers_max[id] = duration;
      93             :             this->timers_min[id] = duration;
      94             :         }
      95             :     }
      96             : }
      97             : 
      98             : const std::vector<int>&
      99     3065571 : Task::get_status() const
     100             : {
     101     3065571 :     return this->status;
     102             : }
     103             : }
     104             : }

Generated by: LCOV version 1.14