@@ -92,7 +92,7 @@ struct attr_t {
92
92
93
93
bool is_def () const {
94
94
return policy == COMMON && value == 0 && dt == dnnl_s32
95
- && groups.size () == 0 ;
95
+ && groups.empty () ;
96
96
}
97
97
98
98
policy_t policy = COMMON;
@@ -141,7 +141,6 @@ struct attr_t {
141
141
arg, e.policy , prim_kind, ndims, has_groups);
142
142
}
143
143
144
- zero_points_t () : points() {} // needed for debug icc190 build;
145
144
std::map<int , entry_t > points;
146
145
};
147
146
@@ -156,7 +155,7 @@ struct attr_t {
156
155
157
156
bool is_def () const {
158
157
return policy == COMMON && scale == 1 .f && dt == dnnl_f32
159
- && groups.size () == 0 ;
158
+ && groups.empty () ;
160
159
}
161
160
162
161
policy_t policy = COMMON;
@@ -165,7 +164,7 @@ struct attr_t {
165
164
std::vector<dnnl_dim_t > groups;
166
165
};
167
166
168
- void set (int arg, entry_t scale) { scales[arg] = scale; }
167
+ void set (int arg, const entry_t & scale) { scales[arg] = scale; }
169
168
170
169
entry_t get (int arg) const {
171
170
const auto &s = scales.find (arg);
@@ -194,8 +193,6 @@ struct attr_t {
194
193
}
195
194
int from_str (const std::string &s);
196
195
197
- arg_scales_t () : scales() {} // needed for debug icc190 build;
198
-
199
196
std::map<int , entry_t > scales;
200
197
};
201
198
@@ -339,7 +336,7 @@ struct attr_t {
339
336
bool is_prelu_kind () const ;
340
337
};
341
338
342
- post_ops_t () : entry() {}
339
+ post_ops_t () = default ;
343
340
344
341
int len () const { return (int )entry.size (); }
345
342
bool is_def () const { return len () == 0 ; }
@@ -460,7 +457,7 @@ struct isa_hints_t {
460
457
cpu_hints_t hints_;
461
458
isa_hints_t (cpu_hints_t hints) : hints_(hints) {}
462
459
463
- cpu_hints_t get () { return hints_; }
460
+ cpu_hints_t get () const { return hints_; }
464
461
465
462
static std::string hints2str (const isa_hints_t &isa_hints) {
466
463
switch (isa_hints.hints_ ) {
@@ -540,6 +537,7 @@ struct sparse_options_t {
540
537
541
538
std::vector<int > get_args () const {
542
539
std::vector<int > args;
540
+ args.reserve (options_.size ());
543
541
for (const auto &opt : options_) {
544
542
args.push_back (opt.first );
545
543
}
0 commit comments