Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: redesign the declarative layout APIs #102

Open
wants to merge 47 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
bf5f319
[feature] Add layout building block
perarnau Nov 7, 2018
6ee737b
[feature] Add copy/transform utilities
perarnau Nov 7, 2018
a821c11
[wip/feature] add new layout design
perarnau Dec 7, 2018
5b9b77e
Bugfix for layout.
Kerilk Dec 8, 2018
01ed44a
Adapted copy operators. For now transforms are expressed in row major…
Kerilk Dec 8, 2018
163ddf9
[refactor] use a bitfield to add type information
perarnau Dec 10, 2018
ab9d661
[refactor] better names for copy_layout functions
perarnau Dec 10, 2018
55de883
Change arguments of transform (transpose) to match those of Python an…
Kerilk Dec 10, 2018
bc47647
Swapped column and row to match the classical notations.
Kerilk Dec 10, 2018
9c05ce6
[feature] implement layout dense internals
perarnau Dec 13, 2018
9238feb
Added tests for column and row major layouts.
Kerilk Dec 13, 2018
b3596fb
Store the pittch given by the user.
Kerilk Dec 13, 2018
ae1bdaf
Replaced copy operators by generated ones and added the generator.
Kerilk Dec 20, 2018
29bbe34
Removed useless curly braces also.
Kerilk Dec 20, 2018
18906d9
Fix naming inconsistencies.
Kerilk Jan 4, 2019
f9c8c2d
Automatic enumeration of design space.
Kerilk Jan 4, 2019
fea8a1e
Starting adding support for generic copy operators of layout.
Kerilk Jan 4, 2019
35420d1
Added ndims and element_size methods to layouts.
Kerilk Jan 7, 2019
5033fe9
Added generic copy operators.
Kerilk Jan 7, 2019
0d35405
Refactoring.
Kerilk Jan 11, 2019
afd21ac
Corrected (I hope) the bit set macro...
Kerilk Jan 11, 2019
6ed9d36
Added a padding layout.
Kerilk Jan 11, 2019
8da06a1
Bugfix.
Kerilk Jan 12, 2019
997b420
More rigorous asserts.
Kerilk Jan 12, 2019
a249a8e
Added reshape operation for dense layouts.
Kerilk Jan 15, 2019
3d4fdf0
Bugfix
Kerilk Jan 15, 2019
9d72fde
Added a reshaping layout to be used on padding layouts or as a fallba…
Kerilk Jan 16, 2019
5e6148d
Bugfix
Kerilk Jan 16, 2019
a670594
Added dims accessor in column order for layout.
Kerilk Jan 26, 2019
695d641
WIP
Kerilk Jan 26, 2019
58a8b88
[build] add libexcit as build dependency
perarnau Jan 28, 2019
03db551
[fix] try to fix CI
perarnau Jan 28, 2019
e8e71d0
[ci] fix knl ci for excit
perarnau Jan 28, 2019
93ba5f0
Added slice operation to dense layouts.
Kerilk Jan 28, 2019
efbc93b
[fix] various typos on new tilings
perarnau Jan 28, 2019
0134a28
Added native (column) version of some functions.
Kerilk Jan 28, 2019
a4facf5
Working version of resizing tiling with tests.
Kerilk Jan 28, 2019
4863232
[feature] add layout-aware dma
perarnau Jan 29, 2019
8aefa5e
[feature] add dma operator to the layout dma
perarnau Jan 29, 2019
323fe9e
[fix] add tests for the new dma, make it work
perarnau Jan 29, 2019
87e0c55
Added padding tiling and corrected tests.
Kerilk Jan 29, 2019
ea73d4f
Exposed layout column api.
Kerilk Jan 29, 2019
dccfebe
Use column api for copy operators and better checks of compatibility.
Kerilk Jan 29, 2019
ff26f8c
Test mixing row and column layout/tiling/copy.
Kerilk Jan 29, 2019
0a4a5bf
[feature] double dma/layout scratch
perarnau Jan 30, 2019
a7b9a10
Added tiling collapsing unused dimensions.
Kerilk Feb 4, 2019
af6da1a
Bugfix and associated test.
Kerilk Feb 4, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[feature] add dma operator to the layout dma
Now the user can specify which of the aml_copy operator to use for dma.
perarnau committed Jan 29, 2019
commit 8aefa5e2d508a154ca9cfa20a51d072f7d187128
4 changes: 3 additions & 1 deletion src/aml-dma-layout.h
Original file line number Diff line number Diff line change
@@ -12,12 +12,14 @@ struct aml_dma_request_layout {
int type;
struct aml_layout *dest;
struct aml_layout *src;
void *arg;
};

typedef int (*aml_dma_operator)(struct aml_layout *, struct aml_layout *, void*);
struct aml_dma_layout {
struct aml_vector requests;
pthread_mutex_t lock;
int (*do_work)(struct aml_layout *dest, struct aml_layout *src);
aml_dma_operator do_work;
};

#define AML_DMA_LAYOUT_DECL(name) \
23 changes: 7 additions & 16 deletions src/dma_layout.c
Original file line number Diff line number Diff line change
@@ -9,13 +9,14 @@

int aml_dma_request_layout_init(struct aml_dma_request_layout *req,
struct aml_layout *dl,
struct aml_layout *sl)
struct aml_layout *sl, void *arg)
{
assert(req != NULL);
req->type = AML_DMA_REQUEST_TYPE_COPY;
/* figure out pointers */
req->dest = dl;
req->src = sl;
req->arg = arg;
return 0;
}

@@ -25,19 +26,6 @@ int aml_dma_request_layout_destroy(struct aml_dma_request_layout *r)
return 0;
}

/*******************************************************************************
* Internal functions
******************************************************************************/
int aml_dma_layout_do_work(struct aml_dma_layout *dma,
struct aml_dma_request_layout *req)
{
assert(dma != NULL);
assert(req != NULL);
//memcpy(req->dest, req->src, req->size);
return 0;
}


/*******************************************************************************
* Public API
******************************************************************************/
@@ -59,9 +47,11 @@ int aml_dma_layout_create_request(struct aml_dma_data *d,
/* we don't support move at this time */
assert(type == AML_DMA_REQUEST_TYPE_COPY);
struct aml_layout *dl, *sl;
void *arg;
dl = va_arg(ap, struct aml_layout *);
sl = va_arg(ap, struct aml_layout *);
aml_dma_request_layout_init(req, dl, sl);
arg = va_arg(ap, void *);
aml_dma_request_layout_init(req, dl, sl, arg);

pthread_mutex_unlock(&dma->lock);
*r = (struct aml_dma_request *)req;
@@ -100,7 +90,7 @@ int aml_dma_layout_wait_request(struct aml_dma_data *d,

/* execute */
assert(req->type == AML_DMA_REQUEST_TYPE_COPY);
dma->do_work(dma, req);
dma->do_work(req->dest, req->src, req->arg);

/* destroy a completed request */
aml_dma_layout_destroy_request(d, r);
@@ -144,6 +134,7 @@ int aml_dma_layout_vinit(struct aml_dma *d, va_list ap)

/* request vector */
size_t nbreqs = va_arg(ap, size_t);
dma->do_work = va_arg(ap, aml_dma_operator);
aml_vector_init(&dma->requests, nbreqs,
sizeof(struct aml_dma_request_layout),
offsetof(struct aml_dma_request_layout, type),