#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
Go to the source code of this file.
|
#define | idx5(a, i, j, k, l, m) a.data[(i)*a.offsets[0] + (j)*a.offsets[1] + (k)*a.offsets[2] + (l)*a.ld_ + m] |
|
#define | idx4(a, i, j, k, l) a.data[(i)*a.offsets[0] + (j)*a.offsets[1] + (k)*a.ld_ + (l)] |
|
#define | idx3(a, i, j, k) a.data[(i)*a.offsets[0] + (j)*a.ld_ + (k)] |
|
#define | idx2(a, i, j) a.data[(i)*a.ld_ + (j)] |
|
|
void | tensor_copy (tensor *const b, const tensor *const a) |
|
static void | initialize_tensor (struct tensor_ *a, const int dim, const int *const sizes) |
|
static void | initialize_tensor_2 (struct tensor_ *a, int n1, int n2) |
|
static void | initialize_tensor_3 (struct tensor_ *a, int n1, int n2, int n3) |
|
static void | initialize_tensor_4 (struct tensor_ *a, int n1, int n2, int n3, int n4) |
|
static tensor * | create_tensor (const int dim, const int *sizes) |
|
static void | destroy_tensor (tensor *a) |
|
static size_t | tensor_return_memory_size (const struct tensor_ *const a) |
|
static void | tensor_assign_memory (struct tensor_ *a, void *data) |
|
static int | tensor_get_leading_dimension (struct tensor_ *a) |
|
static void | tensor_set_leading_dimension (struct tensor_ *a, const int ld) |
|
static void | recompute_tensor_offsets (struct tensor_ *a) |
|
static size_t | compute_memory_space_tensor_3 (const int n1, const int n2, const int n3) |
|
static size_t | compute_memory_space_tensor_4 (const int n1, const int n2, const int n3, const int n4) |
|
static void | setup_global_grid_size (tensor *const grid, const int *const full_size) |
|
static void | setup_grid_window (tensor *const grid, const int *const shift_local, const int *const border_width, const int border_mask) |
|
size_t | realloc_tensor (tensor *t) |
|
void | alloc_tensor (tensor *t) |
|
◆ idx5
#define idx5 |
( |
|
a, |
|
|
|
i, |
|
|
|
j, |
|
|
|
k, |
|
|
|
l, |
|
|
|
m |
|
) |
| a.data[(i)*a.offsets[0] + (j)*a.offsets[1] + (k)*a.offsets[2] + (l)*a.ld_ + m] |
◆ idx4
#define idx4 |
( |
|
a, |
|
|
|
i, |
|
|
|
j, |
|
|
|
k, |
|
|
|
l |
|
) |
| a.data[(i)*a.offsets[0] + (j)*a.offsets[1] + (k)*a.ld_ + (l)] |
◆ idx3
#define idx3 |
( |
|
a, |
|
|
|
i, |
|
|
|
j, |
|
|
|
k |
|
) |
| a.data[(i)*a.offsets[0] + (j)*a.ld_ + (k)] |
◆ idx2
#define idx2 |
( |
|
a, |
|
|
|
i, |
|
|
|
j |
|
) |
| a.data[(i)*a.ld_ + (j)] |
◆ tensor
◆ tensor_copy()
◆ initialize_tensor()
static void initialize_tensor |
( |
struct tensor_ * |
a, |
|
|
const int |
dim, |
|
|
const int *const |
sizes |
|
) |
| |
|
inlinestatic |
◆ initialize_tensor_2()
static void initialize_tensor_2 |
( |
struct tensor_ * |
a, |
|
|
int |
n1, |
|
|
int |
n2 |
|
) |
| |
|
inlinestatic |
◆ initialize_tensor_3()
static void initialize_tensor_3 |
( |
struct tensor_ * |
a, |
|
|
int |
n1, |
|
|
int |
n2, |
|
|
int |
n3 |
|
) |
| |
|
inlinestatic |
◆ initialize_tensor_4()
static void initialize_tensor_4 |
( |
struct tensor_ * |
a, |
|
|
int |
n1, |
|
|
int |
n2, |
|
|
int |
n3, |
|
|
int |
n4 |
|
) |
| |
|
inlinestatic |
◆ create_tensor()
static tensor* create_tensor |
( |
const int |
dim, |
|
|
const int * |
sizes |
|
) |
| |
|
inlinestatic |
◆ destroy_tensor()
static void destroy_tensor |
( |
tensor * |
a | ) |
|
|
inlinestatic |
◆ tensor_return_memory_size()
static size_t tensor_return_memory_size |
( |
const struct tensor_ *const |
a | ) |
|
|
inlinestatic |
◆ tensor_assign_memory()
static void tensor_assign_memory |
( |
struct tensor_ * |
a, |
|
|
void * |
data |
|
) |
| |
|
inlinestatic |
◆ tensor_get_leading_dimension()
static int tensor_get_leading_dimension |
( |
struct tensor_ * |
a | ) |
|
|
inlinestatic |
◆ tensor_set_leading_dimension()
static void tensor_set_leading_dimension |
( |
struct tensor_ * |
a, |
|
|
const int |
ld |
|
) |
| |
|
inlinestatic |
◆ recompute_tensor_offsets()
static void recompute_tensor_offsets |
( |
struct tensor_ * |
a | ) |
|
|
inlinestatic |
◆ compute_memory_space_tensor_3()
static size_t compute_memory_space_tensor_3 |
( |
const int |
n1, |
|
|
const int |
n2, |
|
|
const int |
n3 |
|
) |
| |
|
inlinestatic |
◆ compute_memory_space_tensor_4()
static size_t compute_memory_space_tensor_4 |
( |
const int |
n1, |
|
|
const int |
n2, |
|
|
const int |
n3, |
|
|
const int |
n4 |
|
) |
| |
|
inlinestatic |
◆ setup_global_grid_size()
static void setup_global_grid_size |
( |
tensor *const |
grid, |
|
|
const int *const |
full_size |
|
) |
| |
|
inlinestatic |
◆ setup_grid_window()
static void setup_grid_window |
( |
tensor *const |
grid, |
|
|
const int *const |
shift_local, |
|
|
const int *const |
border_width, |
|
|
const int |
border_mask |
|
) |
| |
|
inlinestatic |
◆ realloc_tensor()
size_t realloc_tensor |
( |
tensor * |
t | ) |
|
◆ alloc_tensor()
void alloc_tensor |
( |
tensor * |
t | ) |
|