本文整理汇总了C++中type::get_data_alignment方法的典型用法代码示例。如果您正苦于以下问题:C++ type::get_data_alignment方法的具体用法?C++ type::get_data_alignment怎么用?C++ type::get_data_alignment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类type
的用法示例。
在下文中一共展示了type::get_data_alignment方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: make_blockref_bytes_assignment_kernel
intptr_t ndt::bytes_type::make_assignment_kernel(void *ckb, intptr_t ckb_offset, const type &dst_tp,
const char *dst_arrmeta, const type &src_tp, const char *src_arrmeta,
kernel_request_t kernreq, const eval::eval_context *ectx) const
{
if (this == dst_tp.extended()) {
switch (src_tp.get_type_id()) {
case bytes_type_id: {
return make_blockref_bytes_assignment_kernel(ckb, ckb_offset, get_data_alignment(), dst_arrmeta,
src_tp.get_data_alignment(), src_arrmeta, kernreq, ectx);
}
case fixed_bytes_type_id: {
return make_fixed_bytes_to_blockref_bytes_assignment_kernel(ckb, ckb_offset, get_data_alignment(), dst_arrmeta,
src_tp.get_data_size(), src_tp.get_data_alignment(),
kernreq, ectx);
}
default: {
if (!src_tp.is_builtin()) {
src_tp.extended()->make_assignment_kernel(ckb, ckb_offset, dst_tp, dst_arrmeta, src_tp, src_arrmeta, kernreq,
ectx);
}
break;
}
}
}
stringstream ss;
ss << "Cannot assign from " << src_tp << " to " << dst_tp;
throw runtime_error(ss.str());
}
示例2: type_error
ndt::byteswap_type::byteswap_type(const type &value_type)
: base_expr_type(byteswap_type_id, expr_kind, value_type.get_data_size(),
value_type.get_data_alignment(), type_flag_scalar, 0),
m_value_type(value_type),
m_operand_type(make_fixed_bytes(value_type.get_data_size(),
value_type.get_data_alignment()))
{
if (!value_type.is_builtin()) {
throw dynd::type_error(
"byteswap_type: Only built-in types are supported presently");
}
}
示例3: sizeof
ndt::fixed_dim_kind_type::fixed_dim_kind_type(const type &element_tp)
: base_dim_type(fixed_dim_type_id, kind_kind, element_tp, 0, element_tp.get_data_alignment(), sizeof(size_stride_t),
type_flag_symbolic, true)
{
// Propagate the inherited flags from the element
m_members.flags |= (element_tp.get_flags() & (type_flags_operand_inherited | type_flags_value_inherited));
}
示例4: sizeof
ndt::fixed_dim_type::fixed_dim_type(intptr_t dim_size, const type &element_tp)
: base_fixed_dim_type(fixed_dim_id, element_tp, 0, element_tp.get_data_alignment(), sizeof(fixed_dim_type_arrmeta),
type_flag_none, true),
m_dim_size(dim_size)
{
// Propagate the inherited flags from the element
this->flags |= (element_tp.get_flags() & (type_flags_operand_inherited | type_flags_value_inherited));
}
示例5: sizeof
ndt::fixed_dim_type::fixed_dim_type(intptr_t dim_size, const type &element_tp)
: base_dim_type(fixed_dim_type_id, element_tp, 0, element_tp.get_data_alignment(), sizeof(fixed_dim_type_arrmeta),
type_flag_none, true),
m_dim_size(dim_size)
{
// Propagate the inherited flags from the element
m_members.flags |= (element_tp.get_flags() & (type_flags_operand_inherited | type_flags_value_inherited));
// Copy nd::array properties and functions from the first non-array dimension
get_scalar_properties_and_functions(m_array_properties, m_array_functions);
}
示例6: type_error
ndt::option_type::option_type(const type &value_tp)
: base_type(option_id, value_tp.get_data_size(), value_tp.get_data_alignment(),
value_tp.get_flags() & (type_flags_value_inherited | type_flags_operand_inherited),
value_tp.get_arrmeta_size(), value_tp.get_ndim(), 0),
m_value_tp(value_tp)
{
if (value_tp.get_id() == option_id) {
stringstream ss;
ss << "Cannot construct an option type out of " << value_tp << ", it is already an option type";
throw type_error(ss.str());
}
}