Commit 836efeb3 authored by umangyadav's avatar umangyadav
Browse files

formatting

parent 2ecf0dd2
...@@ -879,10 +879,7 @@ struct value : MIGRAPHX_HANDLE_BASE(value) ...@@ -879,10 +879,7 @@ struct value : MIGRAPHX_HANDLE_BASE(value)
return {str_array.data()}; return {str_array.data()};
} }
std::string if_string() const std::string if_string() const { return this->is_string() ? this->get_string() : ""; }
{
return this->is_string() ? this->get_string() : "";
}
#define MIGRAPHX_VISIT_VALUE_TYPES(m) \ #define MIGRAPHX_VISIT_VALUE_TYPES(m) \
m(int64, std::int64_t) m(uint64, std::uint64_t) m(float, double) m(bool, bool) m(int64, std::int64_t) m(uint64, std::uint64_t) m(float, double) m(bool, bool)
...@@ -905,10 +902,7 @@ struct value : MIGRAPHX_HANDLE_BASE(value) ...@@ -905,10 +902,7 @@ struct value : MIGRAPHX_HANDLE_BASE(value)
call(&migraphx_value_get_##vt, &get_value, this->get_handle_ptr()); \ call(&migraphx_value_get_##vt, &get_value, this->get_handle_ptr()); \
return get_value; \ return get_value; \
} \ } \
const cpp_type* if_##vt() const \ const cpp_type* if_##vt() const { return this->is_##vt() ? &(this->get_##vt()) : nullptr; }
{ \
return this->is_##vt() ? &(this->get_##vt()) : nullptr; \
}
MIGRAPHX_VISIT_VALUE_TYPES(MIGRAPHX_VALUE_GENERATE_DEFINE_METHODS) MIGRAPHX_VISIT_VALUE_TYPES(MIGRAPHX_VALUE_GENERATE_DEFINE_METHODS)
}; };
......
...@@ -233,8 +233,10 @@ def value(h): ...@@ -233,8 +233,10 @@ def value(h):
for vt, cpp_type in zip(vt, cpp_types): for vt, cpp_type in zip(vt, cpp_types):
h.constructor('create_{}'.format(vt), api.params(i=cpp_type)) h.constructor('create_{}'.format(vt), api.params(i=cpp_type))
h.constructor('create_{}_with_key'.format(vt), h.constructor('create_{}_with_key'.format(vt),
api.params(pkey='const char*', i=cpp_type)) api.params(pkey='const char*', i=cpp_type))
h.method('if_{}'.format(vt), returns='const ' + cpp_type + '*', const=True) h.method('if_{}'.format(vt),
returns='const ' + cpp_type + '*',
const=True)
h.method('is_{}'.format(vt), returns='bool', const=True) h.method('is_{}'.format(vt), returns='bool', const=True)
h.method('get_{}'.format(vt), returns=cpp_type, const=True) h.method('get_{}'.format(vt), returns=cpp_type, const=True)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment