2 #ifndef fake_variable_h_ 3 #define fake_variable_h_ 9 #define DECLARE_OPERATOR(op,CONST,REF) \ 10 template <class T, class U> \ 12 operator op(CONST Variable<T>& t, const U& u); \ 13 template <class T, class U> \ 15 operator op(CONST U& u, const Variable<T>& t); \ 16 template <class T, class U> \ 18 operator op(CONST Variable<T>& t, const Variable<U>& u); 20 #define FRIEND_OPERATOR(op,CONST,REF) \ 21 template <class T1, class U> \ 22 friend Variable<T1> REF \ 23 operator op(CONST Variable<T1>& t, const U& u); \ 24 template <class T1, class U> \ 26 operator op(CONST U& u, const Variable<T1>& t); \ 27 template <class T1, class U> \ 28 friend Variable<T1> REF \ 29 operator op(CONST Variable<T1>& t, const Variable<U>& u); 82 friend Variable<T>
sqrt<>(const Variable<T> &t);
83 friend Variable<T>
cbrt<>(const Variable<T> &t);
84 friend Variable<T>
fabs<>(const Variable<T> &t);
87 template <typename = std::enable_if<std::is_default_constructible<T>::value>>
89 :
nops(
sstmac::sw::operating_system::current_thread()
90 ->register_perf_ctr_variable<uint64_t>(this)),
96 typename = std::enable_if<std::is_convertible<T,U>::value>>
98 :
nops(
sstmac::sw::operating_system::current_thread()
99 ->register_perf_ctr_variable<uint64_t>(this)),
111 :
nops(
sstmac::sw::operating_system::current_thread()
112 ->register_perf_ctr_variable<uint64_t>(this)),
127 void*
operator new[](std::size_t count)
throw() {
140 constexpr
operator T()
const {
174 #define COMPARE(op) \ 175 template <class T, class U> \ 177 operator op(const Variable<T>& t, const U& u){ \ 180 template <class T, class U> \ 182 operator op(const U& u, const Variable<T>& t){ \ 185 template <class T, class U> \ 187 operator op(const Variable<T>& t, const Variable<U>& u){ \ 191 #define OPERATOR(op,CONST,REF) \ 192 template <class T, class U> \ 194 operator op(CONST Variable<T>& t, const U& u){ \ 198 template <class T, class U> \ 200 operator op(CONST U& u, const Variable<T>& t){ \ 204 template <class T, class U> \ 206 operator op(CONST Variable<T>& t, const Variable<U>& u){ \ 255 friend void* memset<>(
const VariablePtr<T>& t,
int value,
size_t size);
260 :
nops(
sstmac::sw::operating_system::current_thread()
261 ->register_perf_ctr_variable<uint64_t>(this)),
266 template <
typename U,
267 typename = std::enable_if<std::is_convertible<T*,U>::value>>
269 :
nops(
sstmac::sw::operating_system::current_thread()
270 ->register_perf_ctr_variable<uint64_t>(this)),
281 :
nops(
sstmac::sw::operating_system::current_thread()
282 ->register_perf_ctr_variable<uint64_t>(this)),
326 typename = std::enable_if<std::is_convertible<T*,U>::value>>
333 typename = std::enable_if<std::is_convertible<T*,U>::value>>
340 typename = std::enable_if<std::is_convertible<T*,U>::value>>
347 typename = std::enable_if<std::is_convertible<T*,U>::value>>
353 constexpr
operator void*()
const {
375 t.
nops += size /
sizeof(T);
382 dst.
nops += size /
sizeof(T);
Variable< T > & operator[](int idx)
const VariablePtr< T > & operator=(const U &ptr) const
#define FRIEND_OPERATOR(op, CONST, REF)
bool operator==(const U &ptr) const
Variable< T > & operator[](Variable< int > idx)
Variable operator-() const
VariablePtr(const VariablePtr &vp)
#define DECLARE_OPERATOR(op, CONST, REF)
void * memcpy(const VariablePtr< T > &dst, const VariablePtr< T > &src, size_t size)
VariablePtr< T > operator&()
friend void * memset(const VariablePtr< T > &t, int value, size_t size)
friend void * memcpy(const VariablePtr< T > &dst, const VariablePtr< T > &src, size_t size)
Variable & operator=(const Variable &v)
const Variable< T > & operator[](int idx) const
VariablePtr< double > DoublePtr
Variable operator--(int u)
VariablePtr< T > & operator+=(const ptrdiff_t &offset)
Variable< T > sqrt(const Variable< T > &t)
const Variable< T > & operator*() const
static thread * current_thread()
Variable(const Variable &v)
SUMI = Simulator unified messagine interface It is also the name for a solid ink in Japanese - i...
Variable operator++(int u)
Variable & operator=(const U &u)
Variable< T > fabs(const Variable< T > &t)
const Variable< T > & operator[](Variable< int > idx) const
VariablePtr< int > IntPtr
VariablePtr(uint64_t &nops_elem)
bool operator!=(const U &ptr) const
Variable< double > Double
Variable(uint64_t &nops_array)
Variable< T > & operator*()
VariablePtr< T > & operator-=(const ptrdiff_t &offset)
void * memset(const VariablePtr< T > &t, int value, size_t size)
VariablePtr< T > & operator=(const VariablePtr &ptr)
Variable< T > cbrt(const Variable< T > &t)
void remove_perf_ctr_variable(void *ptr)
VariablePtr< T > & operator=(const U &ptr)
#define OPERATOR(op, CONST, REF)