Commit cdfbda34 authored by Swann Perarnau's avatar Swann Perarnau
Browse files

[fix] missing doc/name fixes

Missing commit from merge request !145.
parent 24fc700e
Pipeline #11045 passed with stages
in 3 minutes and 27 seconds
...@@ -458,14 +458,14 @@ struct aml_layout_ops { ...@@ -458,14 +458,14 @@ struct aml_layout_ops {
* If the layout relies on sublayouts (e.g. pad, reshape), those will be * If the layout relies on sublayouts (e.g. pad, reshape), those will be
* copied too. * copied too.
* @param[in] layout a non-NULL handle to a layout to copy. * @param[in] layout a non-NULL handle to a layout to copy.
* @param[out] dest a pointer to where to store the new layout. * @param[out] out a pointer to where to store the new layout.
* @return -AML_ENOTSUP if operation is not available. * @return -AML_ENOTSUP if operation is not available.
* @return -AML_ENOMEM if layout allocation failed. * @return -AML_ENOMEM if layout allocation failed.
* @return -AML_EINVAL if src or dest are NULL. * @return -AML_EINVAL if src or dest are NULL.
* @return AML_SUCCESS if copy succeeded. * @return AML_SUCCESS if copy succeeded.
**/ **/
int (*duplicate)(const struct aml_layout *layout, int (*duplicate)(const struct aml_layout *layout,
struct aml_layout **dest); struct aml_layout **out);
/** /**
* Destroys the layout and frees all associated memory. * Destroys the layout and frees all associated memory.
...@@ -641,13 +641,12 @@ int aml_layout_fprintf(FILE *stream, const char *prefix, ...@@ -641,13 +641,12 @@ int aml_layout_fprintf(FILE *stream, const char *prefix,
* Creates a duplicate of the layout (independent deep copy of all its metadata, * Creates a duplicate of the layout (independent deep copy of all its metadata,
* no user data is actually copied). * no user data is actually copied).
* @param[in] src the layout to duplicate * @param[in] src the layout to duplicate
* @param[out] dest a pointer to where to store the new layout * @param[out] out a pointer to where to store the new layout
* @return -AML_ENOMEM if layout allocation failed. * @return -AML_ENOMEM if layout allocation failed.
* @return -AML_EINVAL if src or dest are NULL. * @return -AML_EINVAL if src or dest are NULL.
* @return AML_SUCCESS if copy succeeded. * @return AML_SUCCESS if copy succeeded.
**/ **/
int aml_layout_duplicate(const struct aml_layout *src, int aml_layout_duplicate(const struct aml_layout *src, struct aml_layout **out);
struct aml_layout **dest);
/** /**
* Destroy (free) a layout, irrespective of its type. * Destroy (free) a layout, irrespective of its type.
......
...@@ -129,7 +129,7 @@ int aml_layout_dense_create(struct aml_layout **layout, ...@@ -129,7 +129,7 @@ int aml_layout_dense_create(struct aml_layout **layout,
} }
int aml_layout_dense_duplicate(const struct aml_layout *layout, int aml_layout_dense_duplicate(const struct aml_layout *layout,
struct aml_layout **dest) struct aml_layout **out)
{ {
const struct aml_layout_dense *data; const struct aml_layout_dense *data;
struct aml_layout_dense *dret; struct aml_layout_dense *dret;
...@@ -138,7 +138,7 @@ int aml_layout_dense_duplicate(const struct aml_layout *layout, ...@@ -138,7 +138,7 @@ int aml_layout_dense_duplicate(const struct aml_layout *layout,
data = (const struct aml_layout_dense *)layout->data; data = (const struct aml_layout_dense *)layout->data;
if (layout->data == NULL || dest == NULL) if (layout->data == NULL || out == NULL)
return -AML_EINVAL; return -AML_EINVAL;
err = aml_layout_dense_alloc(&ret, data->ndims); err = aml_layout_dense_alloc(&ret, data->ndims);
...@@ -153,7 +153,7 @@ int aml_layout_dense_duplicate(const struct aml_layout *layout, ...@@ -153,7 +153,7 @@ int aml_layout_dense_duplicate(const struct aml_layout *layout,
* single allocation (everything after the _data struct). * single allocation (everything after the _data struct).
*/ */
memcpy(dret->dims, data->dims, 3 * data->ndims * sizeof(size_t)); memcpy(dret->dims, data->dims, 3 * data->ndims * sizeof(size_t));
*dest = ret; *out = ret;
return AML_SUCCESS; return AML_SUCCESS;
} }
......
...@@ -107,7 +107,7 @@ int aml_layout_pad_create(struct aml_layout **layout, const int order, ...@@ -107,7 +107,7 @@ int aml_layout_pad_create(struct aml_layout **layout, const int order,
} }
int aml_layout_pad_duplicate(const struct aml_layout *layout, int aml_layout_pad_duplicate(const struct aml_layout *layout,
struct aml_layout **dest) struct aml_layout **out)
{ {
const struct aml_layout_pad *data; const struct aml_layout_pad *data;
struct aml_layout_pad *dret; struct aml_layout_pad *dret;
...@@ -117,7 +117,7 @@ int aml_layout_pad_duplicate(const struct aml_layout *layout, ...@@ -117,7 +117,7 @@ int aml_layout_pad_duplicate(const struct aml_layout *layout,
data = (const struct aml_layout_pad *)layout->data; data = (const struct aml_layout_pad *)layout->data;
if (layout->data == NULL || dest == NULL) if (layout->data == NULL || out == NULL)
return -AML_EINVAL; return -AML_EINVAL;
err = aml_layout_pad_alloc(&ret, data->ndims, data->element_size); err = aml_layout_pad_alloc(&ret, data->ndims, data->element_size);
...@@ -133,7 +133,7 @@ int aml_layout_pad_duplicate(const struct aml_layout *layout, ...@@ -133,7 +133,7 @@ int aml_layout_pad_duplicate(const struct aml_layout *layout,
**/ **/
sz = ((char *)dret->neutral - (char *)dret->dims) + data->element_size; sz = ((char *)dret->neutral - (char *)dret->dims) + data->element_size;
memcpy(dret->dims, data->dims, sz); memcpy(dret->dims, data->dims, sz);
*dest = ret; *out = ret;
return AML_SUCCESS; return AML_SUCCESS;
} }
......
...@@ -126,7 +126,7 @@ int aml_layout_reshape_create(struct aml_layout **layout, ...@@ -126,7 +126,7 @@ int aml_layout_reshape_create(struct aml_layout **layout,
} }
int aml_layout_reshape_duplicate(const struct aml_layout *layout, int aml_layout_reshape_duplicate(const struct aml_layout *layout,
struct aml_layout **dest) struct aml_layout **out)
{ {
const struct aml_layout_data_reshape *data; const struct aml_layout_data_reshape *data;
struct aml_layout_data_reshape *dret; struct aml_layout_data_reshape *dret;
...@@ -135,7 +135,7 @@ int aml_layout_reshape_duplicate(const struct aml_layout *layout, ...@@ -135,7 +135,7 @@ int aml_layout_reshape_duplicate(const struct aml_layout *layout,
data = (const struct aml_layout_data_reshape *)layout->data; data = (const struct aml_layout_data_reshape *)layout->data;
if (layout->data == NULL || dest == NULL) if (layout->data == NULL || out == NULL)
return -AML_EINVAL; return -AML_EINVAL;
err = aml_layout_reshape_alloc(&ret, data->ndims, data->target_ndims); err = aml_layout_reshape_alloc(&ret, data->ndims, data->target_ndims);
...@@ -148,7 +148,7 @@ int aml_layout_reshape_duplicate(const struct aml_layout *layout, ...@@ -148,7 +148,7 @@ int aml_layout_reshape_duplicate(const struct aml_layout *layout,
/* small optimization, copying all data at the end of the structure */ /* small optimization, copying all data at the end of the structure */
memcpy(dret->dims, data->dims, memcpy(dret->dims, data->dims,
(2 * data->ndims + data->target_ndims) * sizeof(size_t)); (2 * data->ndims + data->target_ndims) * sizeof(size_t));
*dest = ret; *out = ret;
return AML_SUCCESS; return AML_SUCCESS;
} }
......
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