35 GENERIC const T& max2(
const T& a,
const T& b){
40 template<
class Param1,
class Param2 >
67 template<
class log_t,
class Monitor1,
class Monitor2 >
70 typedef Monitor1 monitor1_t;
71 typedef Monitor2 monitor2_t;
88 return max2(monitor1_t::thread_per_system(compile_time_param)
89 ,monitor2_t::thread_per_system(compile_time_param));
95 return max2(monitor1_t::shmem_per_system(compile_time_param)
96 ,monitor2_t::shmem_per_system(compile_time_param));
98 GPUAPI
bool is_deactivate_on() {
return _monitor1.is_deactivate_on() || _monitor2.is_deactivate_on(); }
99 GPUAPI
bool is_log_on() {
return _monitor1.is_log_on() || _monitor2.is_log_on(); }
100 GPUAPI
bool is_verbose_on() {
return _monitor1.is_verbose_on() || _monitor2.is_verbose_on(); };
101 GPUAPI
bool is_any_on() {
return is_deactivate_on() || is_log_on() || is_verbose_on() ; }
102 GPUAPI
bool is_condition_met () {
return _monitor1.is_condition_met() || _monitor2.is_condition_met(); }
104 GPUAPI
bool need_to_log_system ()
105 {
return (_monitor1.need_to_log_system() || _monitor2.need_to_log_system() ); }
106 GPUAPI
bool need_to_deactivate ()
107 {
return (_monitor1.need_to_deactivate() || _monitor2.need_to_deactivate() ); }
111 {
return _monitor1.pass_one(thread_in_system) || _monitor2.pass_one(thread_in_system); }
114 GPUAPI
int pass_two (
int thread_in_system)
116 int s1 = _monitor1.pass_two(thread_in_system);
117 int s2 = _monitor2.pass_two(thread_in_system);
118 if((s1==0)&&(s1==0))
return 0;
119 else if((s1<0)||(s2<0))
return (s1<s2) ? s1 : s2;
120 else return (s1>s2) ? s1 : s2;
123 GPUAPI
void operator () () {
129 GPUAPI
void operator () (
const int thread_in_system) {
130 _monitor1(thread_in_system);
131 _monitor2(thread_in_system);
134 GPUAPI
void operator () (
const int thread_in_system)
136 pass_one(thread_in_system);
137 pass_two(thread_in_system);
138 if(need_to_log_system() && (thread_in_system==0) )
139 _monitor1.log_system();
142 GPUAPI combine(
const params& p,ensemble::SystemRef& s,log_t& l)
143 :_params(p),_monitor1(p.p1,s,l),_monitor2(p.p2,s,l){}