Commit a284482e authored by Swann Perarnau's avatar Swann Perarnau

[refactor] remove decl/init/fini for tilings

Same story. Changes a bit the ops table because of iterators.
parent 98414fb6
Pipeline #8028 failed with stages
in 3 minutes and 46 seconds
......@@ -265,16 +265,6 @@ struct aml_tiling_ops {
/**
* \todo Doc
**/
int (*init_iterator)(struct aml_tiling_data *tiling,
struct aml_tiling_iterator *iterator, int flags);
/**
* \todo Doc
**/
int (*fini_iterator)(struct aml_tiling_data *tiling,
struct aml_tiling_iterator *iterator);
/**
* \todo Doc
**/
int (*destroy_iterator)(struct aml_tiling_data *tiling,
struct aml_tiling_iterator **iterator);
/**
......@@ -396,23 +386,6 @@ struct aml_tiling_iterator {
int aml_tiling_create_iterator(struct aml_tiling *tiling,
struct aml_tiling_iterator **iterator,
int flags);
/**
* Initializes a tiling iterator.
* @param tiling: an initialized tiling structure.
* @param iterator: an allocated tiling iterator structure.
* @param flags: reserved for future use; pass 0 for now.
* @return 0 if successful; an error code otherwise.
**/
int aml_tiling_init_iterator(struct aml_tiling *tiling,
struct aml_tiling_iterator *iterator, int flags);
/**
* Finalize an initialized tiling iterator.
* @param tiling: an initialized tiling structure.
* @param iterator: an initialized tiling iterator structure.
**/
void aml_tiling_fini_iterator(struct aml_tiling *tiling,
struct aml_tiling_iterator *iterator);
/**
* Tears down an initialized tiling iterator.
* @param tiling: an initialized tiling structure.
......
......@@ -44,31 +44,6 @@ struct aml_tiling_iterator_1d_data {
struct aml_tiling_1d_data *tiling;
};
/** Static declaration of 1D tiling **/
#define AML_TILING_1D_DECL(name) \
struct aml_tiling_1d_data __ ##name## _inner_data; \
struct aml_tiling name = { \
&aml_tiling_1d_ops, \
(struct aml_tiling_data *)&__ ## name ## _inner_data, \
}
/** Static declaration of 1D tiling iterator **/
#define AML_TILING_ITERATOR_1D_DECL(name) \
struct aml_tiling_iterator_1d_data __ ##name## _inner_data; \
struct aml_tiling_iterator name = { \
&aml_tiling_iterator_1d_ops, \
(struct aml_tiling_iterator_data *)&__ ## name ## _inner_data, \
}
/** Static declaration of the size of a 1D tiling **/
#define AML_TILING_1D_ALLOCSIZE (sizeof(struct aml_tiling_1d_data) + \
sizeof(struct aml_tiling))
/** Static declaration of the size of a 1D tiling iterator **/
#define AML_TILING_ITERATOR_1D_ALLOCSIZE \
(sizeof(struct aml_tiling_iterator_1d_data) + \
sizeof(struct aml_tiling_iterator))
/**
* Allocates and initializes a new 1D tiling.
*
......@@ -81,20 +56,6 @@ struct aml_tiling_iterator_1d_data {
**/
int aml_tiling_1d_create(struct aml_tiling **tiling,
size_t tilesize, size_t totalsize);
/**
* Initializes a tiling. Similar to create.
*
* @param tiling a tiling declared with AML_TILING_1D_DECL.
* @param 0 if successful; an error code otherwise.
**/
int aml_tiling_1d_init(struct aml_tiling *tiling, size_t tilesize,
size_t totalsize);
/**
* Finalize a tiling.
**/
void aml_tiling_1d_fini(struct aml_tiling *tiling);
/**
* Tears down an initialized tiling.
*
......
......@@ -60,39 +60,6 @@ struct aml_tiling_iterator_2d_data {
struct aml_tiling_2d_data *tiling;
};
/** Static declaration of 2D tiling aranged in row major fashion **/
#define AML_TILING_2D_ROWMAJOR_DECL(name) \
struct aml_tiling_2d_data __ ##name## _inner_data; \
struct aml_tiling name = { \
&aml_tiling_2d_rowmajor_ops, \
(struct aml_tiling_data *)&__ ## name ## _inner_data, \
}
/** Static declaration of 2D tiling aranged in column major fashion **/
#define AML_TILING_2D_COLMAJOR_DECL(name) \
struct aml_tiling_2d_data __ ##name## _inner_data; \
struct aml_tiling name = { \
&aml_tiling_2d_colmajor_ops, \
(struct aml_tiling_data *)&__ ## name ## _inner_data, \
}
/** Static declaration of 2D tiling iterator **/
#define AML_TILING_ITERATOR_2D_DECL(name) \
struct aml_tiling_iterator_2d_data __ ##name## _inner_data; \
struct aml_tiling_iterator name = { \
&aml_tiling_iterator_2d_ops, \
(struct aml_tiling_iterator_data *)&__ ## name ## _inner_data, \
}
/** Static declaration of the size of a 2D tiling **/
#define AML_TILING_2D_ALLOCSIZE (sizeof(struct aml_tiling_2d_data) + \
sizeof(struct aml_tiling))
/** Static declaration of the size of a 2D tiling iterator **/
#define AML_TILING_ITERATOR_2D_ALLOCSIZE \
(sizeof(struct aml_tiling_iterator_2d_data) + \
sizeof(struct aml_tiling_iterator))
/**
* Allocates and initializes a new 2D tiling.
*
......@@ -109,20 +76,6 @@ struct aml_tiling_iterator_2d_data {
int aml_tiling_2d_create(struct aml_tiling **tiling, int type,
size_t tilesize, size_t totalsize,
size_t rowsize, size_t colsize);
/**
* Initializes a tiling. Similar to create.
*
* @param tiling a tiling declared with AML_TILING_2D_DECL.
* @param 0 if successful; an error code otherwise.
**/
int aml_tiling_2d_init(struct aml_tiling *tiling, int type,
size_t tilesize, size_t totalsize,
size_t rowsize, size_t colsize);
/**
* Finalize a tiling.
**/
void aml_tiling_2d_fini(struct aml_tiling *tiling);
/**
* Tears down an initialized tiling.
......
......@@ -100,22 +100,6 @@ int aml_tiling_create_iterator(struct aml_tiling *t,
return t->ops->create_iterator(t->data, it, flags);
}
int aml_tiling_init_iterator(struct aml_tiling *t,
struct aml_tiling_iterator *it, int flags)
{
assert(t != NULL);
assert(it != NULL);
return t->ops->init_iterator(t->data, it, flags);
}
void aml_tiling_fini_iterator(struct aml_tiling *t,
struct aml_tiling_iterator *it)
{
assert(t != NULL);
assert(it != NULL);
t->ops->fini_iterator(t->data, it);
}
void aml_tiling_destroy_iterator(struct aml_tiling *t,
struct aml_tiling_iterator **it)
{
......
......@@ -116,43 +116,55 @@ int aml_tiling_1d_init_iterator(struct aml_tiling_data *t,
return 0;
}
int aml_tiling_1d_create_iterator(struct aml_tiling_data *t,
int aml_tiling_1d_create_iterator(struct aml_tiling_data *tiling,
struct aml_tiling_iterator **it, int flags)
{
intptr_t baseptr, dataptr;
struct aml_tiling_iterator *ret;
struct aml_tiling_iterator_1d_data *data;
(void)flags;
baseptr = (intptr_t) calloc(1, AML_TILING_ITERATOR_1D_ALLOCSIZE);
dataptr = baseptr + sizeof(struct aml_tiling_iterator);
if (it == NULL)
return -AML_EINVAL;
ret = (struct aml_tiling_iterator *)baseptr;
ret->data = (struct aml_tiling_iterator_data *)dataptr;
*it = NULL;
aml_tiling_1d_init_iterator(t, ret, flags);
*it = ret;
return 0;
}
ret = calloc(1, sizeof(struct aml_tiling_iterator));
if (ret == NULL)
return -AML_ENOMEM;
int aml_tiling_1d_fini_iterator(struct aml_tiling_data *t,
struct aml_tiling_iterator *it)
{
(void)t;
(void)it;
return 0;
ret->ops = &aml_tiling_iterator_1d_ops;
ret->data = calloc(1, sizeof(struct aml_tiling_iterator_1d_data));
if (ret->data == NULL) {
free(ret);
return -AML_ENOMEM;
}
data = (struct aml_tiling_iterator_1d_data *)ret->data;
data->i = 0;
data->tiling = (struct aml_tiling_1d_data *)tiling;
*it = ret;
return AML_SUCCESS;
}
int aml_tiling_1d_destroy_iterator(struct aml_tiling_data *t,
struct aml_tiling_iterator **it)
struct aml_tiling_iterator **iter)
{
struct aml_tiling_iterator *it;
struct aml_tiling_iterator_1d_data *data;
(void)t;
free(*it);
return 0;
if (iter == NULL)
return -AML_EINVAL;
it = *iter;
if (it == NULL || it->data == NULL)
return -AML_EINVAL;
free(it->data);
free(it);
*iter = NULL;
return AML_SUCCESS;
}
struct aml_tiling_ops aml_tiling_1d_ops = {
aml_tiling_1d_create_iterator,
aml_tiling_1d_init_iterator,
aml_tiling_1d_fini_iterator,
aml_tiling_1d_destroy_iterator,
aml_tiling_1d_tileid,
aml_tiling_1d_tilesize,
......@@ -164,68 +176,48 @@ struct aml_tiling_ops aml_tiling_1d_ops = {
* 1D create/destroy
******************************************************************************/
int aml_tiling_1d_create(struct aml_tiling **t,
int aml_tiling_1d_create(struct aml_tiling **tiling,
size_t tilesize, size_t totalsize)
{
struct aml_tiling *ret = NULL;
intptr_t baseptr, dataptr;
int err;
struct aml_tiling_1d_data *t;
if (t == NULL)
if (tiling == NULL || tilesize > totalsize)
return -AML_EINVAL;
*tiling = NULL;
/* alloc */
baseptr = (intptr_t) calloc(1, AML_TILING_1D_ALLOCSIZE);
if (baseptr == 0) {
*t = NULL;
ret = calloc(1, sizeof(struct aml_tiling));
if (ret == NULL) {
return -AML_ENOMEM;
}
dataptr = baseptr + sizeof(struct aml_tiling);
ret = (struct aml_tiling *)baseptr;
ret->data = (struct aml_tiling_data *)dataptr;
ret->ops = &aml_tiling_1d_ops;
err = aml_tiling_1d_init(ret, tilesize, totalsize);
if (err) {
ret->data = calloc(1, sizeof(struct aml_tiling_1d_data));
if (ret->data == NULL) {
free(ret);
ret = NULL;
return -AML_ENOMEM;
}
t = (struct aml_tiling_1d_data *) ret->data;
*t = ret;
return err;
}
int aml_tiling_1d_init(struct aml_tiling *t,
size_t tilesize, size_t totalsize)
{
struct aml_tiling_1d_data *data;
if (t == NULL || t->data == NULL)
return -AML_EINVAL;
data = (struct aml_tiling_1d_data *)t->data;
t->blocksize = tilesize;
t->totalsize = totalsize;
if (tilesize > totalsize)
return -AML_EINVAL;
data->blocksize = tilesize;
data->totalsize = totalsize;
return 0;
*tiling = ret;
return AML_SUCCESS;
}
void aml_tiling_1d_fini(struct aml_tiling *t)
void aml_tiling_1d_destroy(struct aml_tiling **tiling)
{
/* nothing to do */
(void)t;
}
struct aml_tiling *t;
void aml_tiling_1d_destroy(struct aml_tiling **t)
{
if (t == NULL)
if (tiling == NULL)
return;
t = *tiling;
if (t == NULL || t->data == NULL)
return;
free(*t);
*t = NULL;
free(t->data);
free(t);
*tiling = NULL;
}
......@@ -124,56 +124,54 @@ int aml_tiling_2d_ndims(const struct aml_tiling_data *t, va_list ap)
return 0;
}
int aml_tiling_2d_init_iterator(struct aml_tiling_data *t,
struct aml_tiling_iterator *it, int flags)
{
assert(it->data != NULL);
(void)flags;
struct aml_tiling_iterator_2d_data *data =
(struct aml_tiling_iterator_2d_data *)it->data;
it->ops = &aml_tiling_iterator_2d_ops;
data->i = 0;
data->tiling = (struct aml_tiling_2d_data *)t;
return 0;
}
int aml_tiling_2d_create_iterator(struct aml_tiling_data *t,
int aml_tiling_2d_create_iterator(struct aml_tiling_data *tiling,
struct aml_tiling_iterator **it, int flags)
{
intptr_t baseptr, dataptr;
struct aml_tiling_iterator *ret;
struct aml_tiling_iterator_2d_data *data;
baseptr = (intptr_t) calloc(1, AML_TILING_ITERATOR_2D_ALLOCSIZE);
dataptr = baseptr + sizeof(struct aml_tiling_iterator);
if(it == NULL)
return -AML_EINVAL;
ret = (struct aml_tiling_iterator *)baseptr;
ret->data = (struct aml_tiling_iterator_data *)dataptr;
*it = NULL;
aml_tiling_2d_init_iterator(t, ret, flags);
*it = ret;
return 0;
}
ret = calloc(1, sizeof(struct aml_tiling_iterator));
if (ret == NULL)
return -AML_ENOMEM;
int aml_tiling_2d_fini_iterator(struct aml_tiling_data *t,
struct aml_tiling_iterator *it)
{
(void)t;
(void)it;
return 0;
ret->ops = &aml_tiling_iterator_2d_ops;
ret->data = calloc(1, sizeof(struct aml_tiling_iterator_2d_data));
if (ret->data == NULL) {
free(ret);
return -AML_ENOMEM;
}
data = (struct aml_tiling_iterator_2d_data *)ret->data;
data->i = 0;
data->tiling = (struct aml_tiling_2d_data *)tiling;
*it = ret;
return AML_SUCCESS;
}
int aml_tiling_2d_destroy_iterator(struct aml_tiling_data *t,
struct aml_tiling_iterator **it)
struct aml_tiling_iterator **iter)
{
struct aml_tiling_iterator *it;
struct aml_tiling_iterator_2d_data *data;
(void)t;
free(*it);
return 0;
if (iter == NULL)
return -AML_EINVAL;
it = *iter;
if (it == NULL || it->data == NULL)
return -AML_EINVAL;
free(it->data);
free(it);
*iter = NULL;
return AML_SUCCESS;
}
struct aml_tiling_ops aml_tiling_2d_rowmajor_ops = {
aml_tiling_2d_create_iterator,
aml_tiling_2d_init_iterator,
aml_tiling_2d_fini_iterator,
aml_tiling_2d_destroy_iterator,
aml_tiling_2d_rowmajor_tileid,
aml_tiling_2d_tilesize,
......@@ -183,8 +181,6 @@ struct aml_tiling_ops aml_tiling_2d_rowmajor_ops = {
struct aml_tiling_ops aml_tiling_2d_colmajor_ops = {
aml_tiling_2d_create_iterator,
aml_tiling_2d_init_iterator,
aml_tiling_2d_fini_iterator,
aml_tiling_2d_destroy_iterator,
aml_tiling_2d_colmajor_tileid,
aml_tiling_2d_tilesize,
......@@ -196,81 +192,63 @@ struct aml_tiling_ops aml_tiling_2d_colmajor_ops = {
* 2d create/destroy
******************************************************************************/
int aml_tiling_2d_create(struct aml_tiling **t, int type,
int aml_tiling_2d_create(struct aml_tiling **tiling, int type,
size_t tilesize, size_t totalsize,
size_t rowsize, size_t colsize)
{
struct aml_tiling *ret = NULL;
intptr_t baseptr, dataptr;
int err;
struct aml_tiling_2d_data *data;
if (t == NULL)
if (tiling == NULL)
return -AML_EINVAL;
if (type != AML_TILING_TYPE_2D_ROWMAJOR &&
type != AML_TILING_TYPE_2D_COLMAJOR)
return -AML_EINVAL;
if (tilesize > totalsize)
return -AML_EINVAL;
*tiling = NULL;
/* alloc */
baseptr = (intptr_t) calloc(1, AML_TILING_2D_ALLOCSIZE);
if (baseptr == 0) {
*t = NULL;
ret = calloc(1, sizeof(struct aml_tiling));
if (ret == NULL) {
return -AML_ENOMEM;
}
dataptr = baseptr + sizeof(struct aml_tiling);
ret = (struct aml_tiling *)baseptr;
ret->data = (struct aml_tiling_data *)dataptr;
if (type == AML_TILING_TYPE_2D_ROWMAJOR)
ret->ops = &aml_tiling_2d_rowmajor_ops;
else
ret->ops = &aml_tiling_2d_colmajor_ops;
err = aml_tiling_2d_init(ret, type, tilesize, totalsize,
rowsize, colsize);
if (err) {
ret->data = calloc(1, sizeof(struct aml_tiling_2d_data));
if (ret->data == NULL) {
free(ret);
ret = NULL;
return -AML_ENOMEM;
}
*t = ret;
return err;
}
int aml_tiling_2d_init(struct aml_tiling *t, int type,
size_t tilesize, size_t totalsize,
size_t rowsize, size_t colsize)
{
struct aml_tiling_2d_data *data;
(void)type;
if (t == NULL || t->data == NULL)
return -AML_EINVAL;
data = (struct aml_tiling_2d_data *)t->data;
if (tilesize > totalsize)
return -AML_EINVAL;
data = (struct aml_tiling_2d_data *)ret->data;
data->blocksize = tilesize;
data->totalsize = totalsize;
data->ndims[0] = rowsize;
data->ndims[1] = colsize;
return 0;
}
void aml_tiling_2d_fini(struct aml_tiling *t)
{
/* nothing to do */
(void)t;
*tiling = ret;
return AML_SUCCESS;
}
void aml_tiling_2d_destroy(struct aml_tiling **t)
void aml_tiling_2d_destroy(struct aml_tiling **tiling)
{
if (t == NULL)
struct aml_tiling *t;
if (tiling == NULL)
return;
t = *tiling;
if (t == NULL || t->data == NULL)
return;
free(*t);
*t = NULL;
free(t->data);
free(t);
*tiling = NULL;
}
......@@ -19,7 +19,7 @@
int main(int argc, char *argv[])
{
AML_TILING_1D_DECL(tiling);
struct aml_tiling *tiling;
struct aml_dma *dma;
void *dst, *src;
......@@ -27,8 +27,8 @@ int main(int argc, char *argv[])
aml_init(&argc, &argv);
/* initialize all the supporting struct */
assert(!aml_tiling_1d_init(&tiling, TILESIZE*_SC_PAGE_SIZE,
TILESIZE*_SC_PAGE_SIZE*NBTILES));
assert(!aml_tiling_1d_create(&tiling, TILESIZE*_SC_PAGE_SIZE,
TILESIZE*_SC_PAGE_SIZE*NBTILES));
size_t maxrequests = NBTILES;
size_t maxthreads = 4;
assert(!aml_dma_linux_par_create(&dma, maxrequests, maxthreads));
......@@ -44,7 +44,7 @@ int main(int argc, char *argv[])
/* move some stuff by copy */
for(int i = 0; i < NBTILES; i++)
aml_dma_copy(dma, &tiling, dst, i, &tiling, src, i);
aml_dma_copy(dma, tiling, dst, i, tiling, src, i);
assert(!memcmp(src, dst, TILESIZE*_SC_PAGE_SIZE*NBTILES));
......@@ -52,7 +52,7 @@ int main(int argc, char *argv[])
aml_dma_linux_par_destroy(&dma);
aml_area_munmap(&aml_area_linux, dst, TILESIZE*_SC_PAGE_SIZE*NBTILES);
aml_area_munmap(&aml_area_linux, src, TILESIZE*_SC_PAGE_SIZE*NBTILES);
aml_tiling_1d_fini(&tiling);
aml_tiling_1d_destroy(&tiling);
aml_finalize();
return 0;
......
......@@ -19,7 +19,7 @@
int main(int argc, char *argv[])
{
AML_TILING_1D_DECL(tiling);
struct aml_tiling *tiling;
struct aml_dma *dma;
void *dst, *src;
......@@ -27,8 +27,8 @@ int main(int argc, char *argv[])
aml_init(&argc, &argv);
/* initialize all the supporting struct */
assert(!aml_tiling_1d_init(&tiling, TILESIZE*_SC_PAGE_SIZE,
TILESIZE*_SC_PAGE_SIZE*NBTILES));
assert(!aml_tiling_1d_create(&tiling, TILESIZE*_SC_PAGE_SIZE,
TILESIZE*_SC_PAGE_SIZE*NBTILES));
size_t maxrequests = NBTILES;
assert(!aml_dma_linux_seq_create(&dma, maxrequests));
......@@ -43,7 +43,7 @@ int main(int argc, char *argv[])
/* move some stuff by copy */
for(int i = 0; i < NBTILES; i++)
aml_dma_copy(dma, &tiling, dst, i, &tiling, src, i);
aml_dma_copy(dma, tiling, dst, i, tiling, src, i);
assert(!memcmp(src, dst, TILESIZE*_SC_PAGE_SIZE*NBTILES));
......@@ -51,7 +51,7 @@ int main(int argc, char *argv[])
aml_dma_linux_seq_destroy(&dma);
aml_area_munmap(&aml_area_linux, dst, TILESIZE*_SC_PAGE_SIZE*NBTILES);
aml_area_munmap(&aml_area_linux, src, TILESIZE*_SC_PAGE_SIZE*NBTILES);
aml_tiling_1d_fini(&tiling);
aml_tiling_1d_destroy(&tiling);
aml_finalize();
return 0;
......
......@@ -20,7 +20,7 @@
int main(int argc, char *argv[])
{
AML_TILING_1D_DECL(tiling);
struct aml_tiling *tiling;
struct aml_dma *dma;
struct aml_scratch *scratch;
void *dst, *src;
......@@ -29,8 +29,8 @@ int main(int argc, char *argv[])
aml_init(&argc, &argv);
/* initialize all the supporting struct */
assert(!aml_tiling_1d_init(&tiling, TILESIZE*_SC_PAGE_SIZE,
TILESIZE*_SC_PAGE_SIZE*NBTILES));
assert(!aml_tiling_1d_create(&tiling, TILESIZE*_SC_PAGE_SIZE,
TILESIZE*_SC_PAGE_SIZE*NBTILES));
size_t maxrequests = NBTILES;
assert(!aml_dma_linux_seq_create(&dma, maxrequests));
......@@ -42,7 +42,7 @@ int main(int argc, char *argv[])
memset(src, 42, TILESIZE*_SC_PAGE_SIZE*NBTILES);
/* create scratchpad */
assert(!aml_scratch_par_create(&scratch, &aml_area_linux, &aml_area_linux, dma, &tiling,
assert(!aml_scratch_par_create(&scratch, &aml_area_linux, &aml_area_linux, dma, tiling,
(size_t)NBTILES, (size_t)NBTILES));
dst = aml_scratch_baseptr(scratch);
/* move some stuff */
......@@ -52,8 +52,8 @@ int main(int argc, char *argv[])
void *dp, *sp;
aml_scratch_pull(scratch, dst, &di, src, i);
dp = aml_tiling_tilestart(&tiling, dst, di);
sp = aml_tiling_tilestart(&tiling, src, i);
dp = aml_tiling_tilestart(tiling, dst, di);
sp = aml_tiling_tilestart(tiling, src, i);
assert(!memcmp(sp, dp, TILESIZE*_SC_PAGE_SIZE));
......@@ -62,7 +62,7 @@ int main(int argc, char *argv[])
aml_scratch_push(scratch, src, &si, dst, di);
assert(si == i);
sp = aml_tiling_tilestart(&tiling, src, si);
sp = aml_tiling_tilestart(tiling, src, si);
assert(!memcmp(sp, dp, TILESIZE*_SC_PAGE_SIZE));
}
......@@ -72,7 +72,7 @@ int main(int argc, char *argv[])
aml_dma_linux_seq_destroy(&dma);
aml_area_munmap(&aml_area_linux, dst, TILESIZE*_SC_PAGE_SIZE*NBTILES);
aml_area_munmap(&aml_area_linux, src, TILESIZE*_SC_PAGE_SIZE*NBTILES);
aml_tiling_1d_fini(&tiling);
aml_tiling_1d_destroy(&tiling);
aml_finalize();
return 0;
......
......@@ -20,7 +20,7 @@
int main(int argc, char *argv[])
{
AML_TILING_1D_DECL(tiling);
struct aml_tiling *tiling;
struct aml_dma *dma;
struct aml_scratch *scratch;
void *dst, *src;
......@@ -29,8 +29,8 @@ int main(int argc, char *argv[])
aml_init(&argc, &argv);
/* initialize all the supporting struct */
assert(!aml_tiling_1d_init(&tiling, TILESIZE*_SC_PAGE_SIZE,
TILESIZE*_SC_PAGE_SIZE*NBTILES));
assert(!aml_tiling_1d_create(&tiling, TILESIZE*_SC_PAGE_SIZE,
TILESIZE*_SC_PAGE_SIZE*NBTILES));
size_t maxrequests = NBTILES;
size_t maxthreads = 4;
......@@ -43,7 +43,7 @@ int main(int argc, char *argv[])
memset(src, 42, TILESIZE*_SC_PAGE_SIZE*NBTILES);
/* create scratchpad */
assert(!aml_scratch_seq_create(&scratch, &aml_area_linux, &aml_area_linux, dma, &tiling,
assert(!aml_scratch_seq_create(&scratch, &aml_area_linux, &aml_area_linux, dma, tiling,
(size_t)NBTILES, (size_t)NBTILES));
dst = aml_scratch_baseptr(scratch);
/* move some stuff */
......@@ -53,8 +53,8 @@ int main(int argc, char *argv[])
void *dp, *sp;
aml_scratch_pull(scratch, dst, &di, src, i);
dp = aml_tiling_tilestart(&tiling, dst, di);
sp = aml_tiling_tilestart(&tiling, src, i);
dp = aml_tiling_tilestart(tiling, dst, di);
sp = aml_tiling_tilestart(tiling, src, i);
assert(!memcmp(sp, dp, TILESIZE*_SC_PAGE_SIZE));
......@@ -63,7 +63,7 @@ int main(int argc, char *argv[])
aml_scratch_push(scratch, src, &si, dst, di);
assert(si == i);
sp = aml_tiling_tilestart(&tiling, src, si);
sp = aml_tiling_tilestart(tiling, src, si);
assert(!memcmp(sp, dp, TILESIZE*_SC_PAGE_SIZE));
}
......@@ -73,7 +73,7 @@ int main(int argc, char *argv[])
aml_dma_linux_par_destroy(&dma);
aml_area_munmap(&aml_area_linux, dst, TILESIZE*_SC_PAGE_SIZE*NBTILES);