Commit 9e827915 authored by Swann Perarnau's avatar Swann Perarnau

[refactor] move tilings to seperate headers

Same as the rest.
parent b51a996c
......@@ -10,6 +10,7 @@
#include "aml.h"
#include "aml/area/linux.h"
#include "aml/tiling/2d.h"
#include <assert.h>
#include <errno.h>
#include <mkl.h>
......
......@@ -12,6 +12,8 @@
#include "aml/area/linux.h"
#include "aml/dma/linux-seq.h"
#include "aml/scratch/par.h"
#include "aml/tiling/1d.h"
#include "aml/tiling/2d.h"
#include <assert.h>
#include <errno.h>
#include <mkl.h>
......
......@@ -12,6 +12,7 @@
#include "aml/area/linux.h"
#include "aml/dma/linux-par.h"
#include "aml/scratch/seq.h"
#include "aml/tiling/1d.h"
#include <assert.h>
#include <errno.h>
#include <omp.h>
......
......@@ -12,6 +12,7 @@
#include "aml/area/linux.h"
#include "aml/dma/linux-seq.h"
#include "aml/scratch/par.h"
#include "aml/tiling/1d.h"
#include <assert.h>
#include <errno.h>
#include <omp.h>
......
......@@ -18,6 +18,7 @@
#include "aml/area/linux.h"
#include "aml/dma/linux-seq.h"
#include "aml/scratch/par.h"
#include "aml/tiling/1d.h"
#include "utils.h"
#define ITER 10
......
......@@ -14,6 +14,11 @@ include_aml_scratch_HEADERS = \
aml/scratch/seq.h \
aml/scratch/par.h
include_aml_tilingdir=$(includedir)/aml/tiling
include_aml_tiling_HEADERS = \
aml/tiling/1d.h \
aml/tiling/2d.h
include_amlutilsdir=$(includedir)/aml/utils
include_amlutils_HEADERS = \
......
......@@ -332,92 +332,6 @@ int aml_tiling_vinit(struct aml_tiling *tiling, int type, va_list args);
*/
int aml_tiling_destroy(struct aml_tiling *tiling, int type);
/*******************************************************************************
* Tiling 1D:
******************************************************************************/
extern struct aml_tiling_ops aml_tiling_1d_ops;
extern struct aml_tiling_iterator_ops aml_tiling_iterator_1d_ops;
struct aml_tiling_1d_data {
size_t blocksize;
size_t totalsize;
};
struct aml_tiling_iterator_1d_data {
size_t i;
struct aml_tiling_1d_data *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, \
};
#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, \
};
#define AML_TILING_1D_ALLOCSIZE (sizeof(struct aml_tiling_1d_data) + \
sizeof(struct aml_tiling))
#define AML_TILING_ITERATOR_1D_ALLOCSIZE \
(sizeof(struct aml_tiling_iterator_1d_data) + \
sizeof(struct aml_tiling_iterator))
/*******************************************************************************
* Tiling 2D:
* a contiguous memory area composed of contiguous tiles arranged in 2D grid.
******************************************************************************/
extern struct aml_tiling_ops aml_tiling_2d_rowmajor_ops;
extern struct aml_tiling_ops aml_tiling_2d_colmajor_ops;
extern struct aml_tiling_iterator_ops aml_tiling_iterator_2d_ops;
struct aml_tiling_2d_data {
size_t blocksize;
size_t totalsize;
size_t ndims[2]; /* # number of rows, # number of cols (in tiles) */
};
struct aml_tiling_iterator_2d_data {
size_t i;
struct aml_tiling_2d_data *tiling;
};
#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, \
};
#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, \
};
#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, \
};
#define AML_TILING_2D_ALLOCSIZE (sizeof(struct aml_tiling_2d_data) + \
sizeof(struct aml_tiling))
#define AML_TILING_ITERATOR_2D_ALLOCSIZE \
(sizeof(struct aml_tiling_iterator_2d_data) + \
sizeof(struct aml_tiling_iterator))
/*******************************************************************************
* DMA:
* Management of low-level movement of memory.
......
/*******************************************************************************
* Copyright 2019 UChicago Argonne, LLC.
* (c.f. AUTHORS, LICENSE)
*
* This file is part of the AML project.
* For more info, see https://xgitlab.cels.anl.gov/argo/aml
*
* SPDX-License-Identifier: BSD-3-Clause
*******************************************************************************/
#ifndef AML_TILING_1D_H
#define AML_TILING_1D_H 1
/*******************************************************************************
* Tiling 1D:
******************************************************************************/
extern struct aml_tiling_ops aml_tiling_1d_ops;
extern struct aml_tiling_iterator_ops aml_tiling_iterator_1d_ops;
struct aml_tiling_1d_data {
size_t blocksize;
size_t totalsize;
};
struct aml_tiling_iterator_1d_data {
size_t i;
struct aml_tiling_1d_data *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, \
};
#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, \
};
#define AML_TILING_1D_ALLOCSIZE (sizeof(struct aml_tiling_1d_data) + \
sizeof(struct aml_tiling))
#define AML_TILING_ITERATOR_1D_ALLOCSIZE \
(sizeof(struct aml_tiling_iterator_1d_data) + \
sizeof(struct aml_tiling_iterator))
#endif /* AML_TILING_1D_H */
/*******************************************************************************
* Copyright 2019 UChicago Argonne, LLC.
* (c.f. AUTHORS, LICENSE)
*
* This file is part of the AML project.
* For more info, see https://xgitlab.cels.anl.gov/argo/aml
*
* SPDX-License-Identifier: BSD-3-Clause
*******************************************************************************/
#ifndef AML_TILING_2D_H
#define AML_TILING_2D_H 1
/*******************************************************************************
* Tiling 2D:
* a contiguous memory area composed of contiguous tiles arranged in 2D grid.
******************************************************************************/
extern struct aml_tiling_ops aml_tiling_2d_rowmajor_ops;
extern struct aml_tiling_ops aml_tiling_2d_colmajor_ops;
extern struct aml_tiling_iterator_ops aml_tiling_iterator_2d_ops;
struct aml_tiling_2d_data {
size_t blocksize;
size_t totalsize;
size_t ndims[2]; /* # number of rows, # number of cols (in tiles) */
};
struct aml_tiling_iterator_2d_data {
size_t i;
struct aml_tiling_2d_data *tiling;
};
#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, \
};
#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, \
};
#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, \
};
#define AML_TILING_2D_ALLOCSIZE (sizeof(struct aml_tiling_2d_data) + \
sizeof(struct aml_tiling))
#define AML_TILING_ITERATOR_2D_ALLOCSIZE \
(sizeof(struct aml_tiling_iterator_2d_data) + \
sizeof(struct aml_tiling_iterator))
#endif /* AML_TILING_2D_H */
......@@ -9,6 +9,8 @@
*******************************************************************************/
#include "aml.h"
#include "aml/tiling/1d.h"
#include "aml/tiling/2d.h"
#include <assert.h>
/*******************************************************************************
......
......@@ -9,6 +9,7 @@
*******************************************************************************/
#include "aml.h"
#include "aml/tiling/1d.h"
#include <assert.h>
/*******************************************************************************
......
......@@ -9,6 +9,7 @@
*******************************************************************************/
#include "aml.h"
#include "aml/tiling/2d.h"
#include <assert.h>
/*******************************************************************************
......
......@@ -11,6 +11,7 @@
#include "aml.h"
#include "aml/area/linux.h"
#include "aml/dma/linux-par.h"
#include "aml/tiling/1d.h"
#include <assert.h>
#define TILESIZE (2)
......
......@@ -11,6 +11,7 @@
#include "aml.h"
#include "aml/area/linux.h"
#include "aml/dma/linux-seq.h"
#include "aml/tiling/1d.h"
#include <assert.h>
#define TILESIZE (2)
......
......@@ -12,6 +12,7 @@
#include "aml/area/linux.h"
#include "aml/dma/linux-seq.h"
#include "aml/scratch/par.h"
#include "aml/tiling/1d.h"
#include <assert.h>
#define TILESIZE (2)
......
......@@ -12,6 +12,7 @@
#include "aml/area/linux.h"
#include "aml/dma/linux-par.h"
#include "aml/scratch/seq.h"
#include "aml/tiling/1d.h"
#include <assert.h>
#define TILESIZE (2)
......
......@@ -9,6 +9,8 @@
*******************************************************************************/
#include "aml.h"
#include "aml/tiling/1d.h"
#include "aml/tiling/2d.h"
#include <assert.h>
#define TILESIZE 8192
......
......@@ -9,6 +9,7 @@
*******************************************************************************/
#include "aml.h"
#include "aml/tiling/2d.h"
#include <assert.h>
#define N 2
......
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