-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add memref wrappers * Use common memref header * Clean up use of memrefs in main * Remove old comments
- Loading branch information
1 parent
e4655f6
commit 9a02735
Showing
4 changed files
with
63 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
#include "data.h" | ||
#include "memref.h" | ||
|
||
#include <snrt.h> | ||
|
||
#include <stdint.h> | ||
|
||
void simple_mult(const int32_t *A, const int32_t *B, int32_t *D) { | ||
void _mlir_ciface_simple_mult(OneDMemrefI32_t *A, OneDMemrefI32_t *B, | ||
OneDMemrefI32_t *D) { | ||
const uint32_t n = N; | ||
for (uint32_t i = 0; i < n; ++i) { | ||
D[i] = A[i] * B[i]; | ||
D->aligned_data[i] = A->aligned_data[i] * B->aligned_data[i]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#pragma once | ||
|
||
#include <stdint.h> | ||
|
||
struct OneDMemrefI32 { | ||
int32_t *data; // allocated pointer: Pointer to data buffer as allocated, | ||
// only used for deallocating the memref | ||
int32_t *aligned_data; // aligned pointer: Pointer to properly aligned data | ||
// that memref indexes | ||
uint32_t *offset; | ||
uint32_t *shape[1]; | ||
uint32_t *stride[1]; | ||
}; | ||
|
||
typedef struct OneDMemrefI32 OneDMemrefI32_t; |