SST/macro
compute_event.h
Go to the documentation of this file.
1 /*
2  * This file is part of SST/macroscale:
3  * The macroscale architecture simulator from the SST suite.
4  * Copyright (c) 2009 Sandia Corporation.
5  * This software is distributed under the BSD License.
6  * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
7  * the U.S. Government retains certain rights in this software.
8  * For more information, see the LICENSE file in the top
9  * SST/macroscale directory.
10  */
11 
12 #ifndef SSTMAC_HARDWARE_PROCESSOR_EVENTDATA_H_INCLUDED
13 #define SSTMAC_HARDWARE_PROCESSOR_EVENTDATA_H_INCLUDED
14 
18 #include <type_traits>
19 #include <sprockit/debug.h>
20 #include <sprockit/typedefs.h>
21 #include <stdint.h>
22 
23 DeclareDebugSlot(compute_intensity);
24 
25 namespace sstmac {
26 namespace sw {
27 
28 /**
29  * Input for processor models that use
30  * performance counter data. Is basically just a map
31  * that maps std::string keys to integer values.
32  * Keys are defined in the libraries that use them.
33  */
35  public event
36 {
37  public:
38  virtual bool
39  is_timed_compute() const = 0;
40 
41  void
42  set_core(int core){
43  core_ = core;
44  }
45 
46  std::string
47  to_string() const {
48  return "compute event";
49  }
50 
51  int
52  core() const {
53  return core_;
54  }
55 
57  access_id() const {
58  return unique_id_;
59  }
60 
61  void
63  unique_id_ = id;
64  }
65 
66  uint64_t
67  unique_id() const {
68  return uint64_t(unique_id_);
69  }
70 
71  private:
72  int core_;
73 
75 
76 };
77 
78 template <class T>
80  public compute_event
81 {
83 
84  public:
85  bool
86  is_timed_compute() const {
87  return std::is_same<T,timestamp>::value;
88  }
89 
90  T& data() {
91  return t_;
92  }
93 
94 
95  private:
96  T t_;
97 
98 };
99 
101 {
102  uint64_t mem_random = 0ULL;
103  uint64_t mem_sequential = 0ULL;
104  uint64_t flops = 0ULL;
105  uint64_t intops = 0ULL;
106 };
107 
110 
111 }
112 } // end of namespace sstmac
113 
114 #endif
uint64_t unique_id() const
Definition: compute_event.h:67
Input for processor models that use performance counter data.
Definition: compute_event.h:34
std::string to_string() const
Definition: compute_event.h:47
compute_event_impl< timestamp > timed_compute_event
virtual bool is_timed_compute() const =0
NotSerializable(compute_event_impl) public
Definition: compute_event.h:82
SUMI = Simulator unified messagine interface It is also the name for a solid ink in Japanese - i...
DeclareDebugSlot(compute_intensity)
compute_event_impl< basic_instructions_st > basic_compute_event
void set_access_id(hw::memory_access_id id)
Definition: compute_event.h:62
hw::memory_access_id access_id() const
Definition: compute_event.h:57
hw::memory_access_id unique_id_
Definition: compute_event.h:74