Commit ea73d4fe authored by Brice Videau's avatar Brice Videau
Browse files

Exposed layout column api.

parent 87e0c55f
......@@ -62,9 +62,12 @@ struct aml_layout {
void *aml_layout_deref(const struct aml_layout *l, ...);
void *aml_layout_aderef(const struct aml_layout *l, const size_t *coords);
void *aml_layout_aderef_column(const struct aml_layout *l,
const size_t *coords);
int aml_layout_order(const struct aml_layout *l);
int aml_layout_dims(const struct aml_layout *l, ...);
int aml_layout_adims(const struct aml_layout *l, size_t *dims);
int aml_layout_adims_column(const struct aml_layout *l, size_t *dims);
size_t aml_layout_ndims(const struct aml_layout *l);
size_t aml_layout_element_size(const struct aml_layout *l);
struct aml_layout * aml_layout_areshape(const struct aml_layout *l,
......@@ -75,5 +78,9 @@ struct aml_layout * aml_layout_slice(const struct aml_layout *l, ...);
struct aml_layout * aml_layout_aslice(const struct aml_layout *l,
const size_t *offsets, const size_t *dims,
const size_t *strides);
struct aml_layout * aml_layout_aslice_column(const struct aml_layout *l,
const size_t *offsets,
const size_t *dims,
const size_t *strides);
#endif
......@@ -23,6 +23,14 @@ void *aml_layout_aderef(const struct aml_layout *layout, const size_t *coords)
return layout->ops->aderef(layout->data, coords);
}
void *aml_layout_aderef_column(const struct aml_layout *layout,
const size_t *coords)
{
assert(layout != NULL);
assert(layout->ops != NULL);
return layout->ops->aderef_column(layout->data, coords);
}
int aml_layout_order(const struct aml_layout *layout)
{
assert(layout != NULL);
......@@ -49,6 +57,13 @@ int aml_layout_adims(const struct aml_layout *layout, size_t *dims)
return layout->ops->adims(layout->data, dims);
}
int aml_layout_adims_column(const struct aml_layout *layout, size_t *dims)
{
assert(layout != NULL);
assert(layout->ops != NULL);
return layout->ops->adims_column(layout->data, dims);
}
size_t aml_layout_ndims(const struct aml_layout *layout)
{
assert(layout != NULL);
......@@ -110,3 +125,14 @@ struct aml_layout * aml_layout_aslice(const struct aml_layout *layout,
assert(layout->ops->aslice != NULL);
return layout->ops->aslice(layout->data, offsets, dims, strides);
}
struct aml_layout * aml_layout_aslice_column(const struct aml_layout *layout,
const size_t *offsets,
const size_t *dims,
const size_t *strides)
{
assert(layout != NULL);
assert(layout->ops != NULL);
assert(layout->ops->aslice != NULL);
return layout->ops->aslice_column(layout->data, offsets, dims, strides);
}
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