Compare commits
13 Commits
484d2461b6
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| e9d90cef43 | |||
| a2d44bd71d | |||
| 5713f1fe20 | |||
| 01255cc741 | |||
| f7de1c1af9 | |||
| abeb649386 | |||
| e4c2f1b950 | |||
| fd0f0e7684 | |||
| 3b5185c201 | |||
| 7581a2612a | |||
| 654ad1fa9c | |||
| 8bcc6177ea | |||
| 858fc6722e |
@@ -1,2 +1,5 @@
|
|||||||
**.swp
|
**.swp
|
||||||
**is_good*
|
**is_good*
|
||||||
|
**.ff*
|
||||||
|
**xtest*
|
||||||
|
|
||||||
|
|||||||
Symlink
+1
@@ -0,0 +1 @@
|
|||||||
|
../onefileheader_test
|
||||||
+10
-7
@@ -70,6 +70,9 @@ GENERATE_LIST_ALL(TYPE_PTR)
|
|||||||
#define FOR_LIST_FORM_END(type, var_list)\
|
#define FOR_LIST_FORM_END(type, var_list)\
|
||||||
for(move_current_to_end_list_##type(var_list); var_list->current_list; decrement_list_##type(var_list))
|
for(move_current_to_end_list_##type(var_list); var_list->current_list; decrement_list_##type(var_list))
|
||||||
|
|
||||||
|
#define ABS(x) ((x)>0) ? (x) : (-1*(x))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define IMPLEMENTATION_LIST(type)\
|
#define IMPLEMENTATION_LIST(type)\
|
||||||
\
|
\
|
||||||
@@ -146,20 +149,20 @@ GENERATE_LIST_ALL(TYPE_PTR)
|
|||||||
var_list->current_index = var_list->size - 1;\
|
var_list->current_index = var_list->size - 1;\
|
||||||
}*/\
|
}*/\
|
||||||
long from_current_index = var_list->current_list->index - index; \
|
long from_current_index = var_list->current_list->index - index; \
|
||||||
size_t abs_cur_diff = abs(from_current_index); \
|
long abs_cur_diff = ABS(from_current_index); \
|
||||||
size_t array_diff_index[3] = {index, abs_cur_diff , var_list->size - 1 - index}; \
|
long array_diff_index[3] = {index, abs_cur_diff , var_list->size - 1 - index}; \
|
||||||
size_t index_nearest = ARG_MIN_ARRAY_TYPE_SIZE_T(array_diff_index, 3);\
|
long index_nearest = ARG_MIN_ARRAY_TYPE_SIZE_T(array_diff_index, 3);\
|
||||||
if(index_nearest == 0){\
|
if(index_nearest == 0){\
|
||||||
var_list->current_list = var_list->begin_list;\
|
var_list->current_list = var_list->begin_list;\
|
||||||
for(size_t i=0; i<array_diff_index[0]; ++i) var_list->current_list = (var_list->current_list)->next; \
|
for(long i=0; i<array_diff_index[0]; ++i) var_list->current_list = (var_list->current_list)->next; \
|
||||||
}\
|
}\
|
||||||
else if(index_nearest == 2){\
|
else if(index_nearest == 2){\
|
||||||
var_list->current_list = var_list->end_list;\
|
var_list->current_list = var_list->end_list;\
|
||||||
for(size_t i=0; i < array_diff_index[2]; ++i) var_list->current_list = (var_list->current_list)->preview; \
|
for(long i=0; i < array_diff_index[2]; ++i) var_list->current_list = (var_list->current_list)->preview; \
|
||||||
}else if(from_current_index >= 0) \
|
}else if(from_current_index >= 0) \
|
||||||
for(size_t i=0; i < array_diff_index[1]; ++i) var_list->current_list = (var_list->current_list)->preview; \
|
for(long i=0; i < array_diff_index[1]; ++i) var_list->current_list = (var_list->current_list)->preview; \
|
||||||
else \
|
else \
|
||||||
for(size_t i=0; i < array_diff_index[1]; ++i) var_list->current_list = (var_list->current_list)->next; \
|
for(long i=0; i < array_diff_index[1]; ++i) var_list->current_list = (var_list->current_list)->next; \
|
||||||
\
|
\
|
||||||
var_list->current_index = index;\
|
var_list->current_index = index;\
|
||||||
if(list_in_index) *list_in_index = var_list->current_list;\
|
if(list_in_index) *list_in_index = var_list->current_list;\
|
||||||
|
|||||||
Executable
+17
@@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ "$#" -le 0 ] ; then
|
||||||
|
echo "Usage: $0 fileSrc"
|
||||||
|
echo "for example: $0 tesTensor.c" >&2
|
||||||
|
else
|
||||||
|
foo=$1
|
||||||
|
path=${foo%/*}
|
||||||
|
#To get: /tmp/my.dir (like dirname)
|
||||||
|
file=${foo##*/}
|
||||||
|
#To get: filename.tar.gz (like basename)
|
||||||
|
base=${file%%.*}
|
||||||
|
echo "base = $base"
|
||||||
|
#To get: filename
|
||||||
|
ext=${file#*.}
|
||||||
|
gcc -o xtest_$base $1 -W -I../link_repo_ytest
|
||||||
|
fi
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
[6,8,1]
|
||||||
|
((0,0,0)(8,8)(8,8),(1,2)
|
||||||
|
((0,0,0)(8,8)(8,8),(1,2)
|
||||||
|
((0,0,0)(8,8)(8,8),(1,2)
|
||||||
|
((0,0,0)(8,8)(8,8),(1,2)
|
||||||
|
((0,0,0)(8,8)(8,8),(1,2)
|
||||||
|
((0,0,0)(8,8)(8,8),(1,2)
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load Diff
+26
-20
@@ -38,7 +38,7 @@ TEST(size){
|
|||||||
D->shape[2]=5;
|
D->shape[2]=5;
|
||||||
D->shape[3]=6;
|
D->shape[3]=6;
|
||||||
|
|
||||||
updateRankDim(D);
|
updateDim(D);
|
||||||
EXPECT_EQ(D->size, 180);
|
EXPECT_EQ(D->size, 180);
|
||||||
|
|
||||||
free_dimension(D);
|
free_dimension(D);
|
||||||
@@ -50,7 +50,7 @@ TEST(SplitDim){
|
|||||||
D->shape[2]=5;
|
D->shape[2]=5;
|
||||||
D->shape[3]=6;
|
D->shape[3]=6;
|
||||||
|
|
||||||
updateRankDim(D);
|
updateDim(D);
|
||||||
printDebug_dimension(D," D root");
|
printDebug_dimension(D," D root");
|
||||||
|
|
||||||
dimension *d_part1 = NULL,*d_part2=NULL;
|
dimension *d_part1 = NULL,*d_part2=NULL;
|
||||||
@@ -80,7 +80,7 @@ TEST(SplitDim_2){
|
|||||||
D->shape[2]=5;
|
D->shape[2]=5;
|
||||||
D->shape[3]=6;
|
D->shape[3]=6;
|
||||||
|
|
||||||
updateRankDim(D);
|
updateDim(D);
|
||||||
printDebug_dimension(D," D root");
|
printDebug_dimension(D," D root");
|
||||||
|
|
||||||
dimension *d_part1 = NULL,*d_part2=NULL;
|
dimension *d_part1 = NULL,*d_part2=NULL;
|
||||||
@@ -122,8 +122,10 @@ TEST(SubDimB){
|
|||||||
EXPECT_EQ(d_tail2->size, 15*26);
|
EXPECT_EQ(d_tail2->size, 15*26);
|
||||||
|
|
||||||
free_dimension(D);
|
free_dimension(D);
|
||||||
free(d_tail2);
|
d_tail2->shape=NULL;
|
||||||
free(d_head2);
|
d_head2->shape=NULL;
|
||||||
|
free_dimension(d_tail2);
|
||||||
|
free_dimension(d_head2);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(SubDim){
|
TEST(SubDim){
|
||||||
@@ -143,8 +145,12 @@ TEST(SubDim){
|
|||||||
EXPECT_EQ(d_tail2->size, 5*6);
|
EXPECT_EQ(d_tail2->size, 5*6);
|
||||||
|
|
||||||
free_dimension(D);
|
free_dimension(D);
|
||||||
free(d_tail2);
|
d_tail2->shape=NULL;
|
||||||
free(d_head2);
|
d_head2->shape=NULL;
|
||||||
|
free_dimension(d_tail2);
|
||||||
|
free_dimension(d_head2);
|
||||||
|
//free(d_tail2);
|
||||||
|
//free(d_head2);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(Coord_linear){
|
TEST(Coord_linear){
|
||||||
@@ -154,12 +160,12 @@ TEST(Coord_linear){
|
|||||||
D->shape[2]=5;
|
D->shape[2]=5;
|
||||||
D->shape[3]=6;
|
D->shape[3]=6;
|
||||||
|
|
||||||
updateRankDim(D);
|
updateDim(D);
|
||||||
|
|
||||||
size_t line=255;
|
long line=255;
|
||||||
size_t *coord = CoordFromLin(line,D);
|
long *coord = CoordFromLin(line,D);
|
||||||
|
|
||||||
for(size_t i=0; i<D->rank; ++i){
|
for(long i=0; i<D->rank; ++i){
|
||||||
LOG("coo[%ld]=%ld\n",i,coord[i]);
|
LOG("coo[%ld]=%ld\n",i,coord[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -175,12 +181,12 @@ TEST(signedCoord_linear){
|
|||||||
D->shape[2]=5;
|
D->shape[2]=5;
|
||||||
D->shape[3]=6;
|
D->shape[3]=6;
|
||||||
|
|
||||||
updateRankDim(D);
|
updateDim(D);
|
||||||
|
|
||||||
long line=-255;
|
long line=-255;
|
||||||
long *coord = signedCoordFromLin(line,D);
|
long *coord = signedCoordFromLin(line,D);
|
||||||
|
|
||||||
for(size_t i=0; i<D->rank; ++i){
|
for(long i=0; i<D->rank; ++i){
|
||||||
LOG("coo[%ld]=%ld\n",i,coord[i]);
|
LOG("coo[%ld]=%ld\n",i,coord[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -195,12 +201,12 @@ TEST(signedCoord_linearSuccessif){
|
|||||||
D->shape[1]=3;
|
D->shape[1]=3;
|
||||||
D->shape[2]=2;
|
D->shape[2]=2;
|
||||||
|
|
||||||
updateRankDim(D);
|
updateDim(D);
|
||||||
|
|
||||||
for(long line=-4; line < 4; ++line){
|
for(long line=-4; line < 4; ++line){
|
||||||
long *coord = signedCoordFromLin(line,D);
|
long *coord = signedCoordFromLin(line,D);
|
||||||
|
|
||||||
for(size_t i=0; i<D->rank; ++i){
|
for(long i=0; i<D->rank; ++i){
|
||||||
LOG("coo[%ld]=%ld\n",i,coord[i]);
|
LOG("coo[%ld]=%ld\n",i,coord[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -217,10 +223,10 @@ TEST(sprint_dim){
|
|||||||
D->shape[2]=5;
|
D->shape[2]=5;
|
||||||
D->shape[3]=6;
|
D->shape[3]=6;
|
||||||
|
|
||||||
updateRankDim(D);
|
updateDim(D);
|
||||||
|
|
||||||
char *dimSTR =NULL;
|
char *dimSTR =NULL;
|
||||||
size_t nb=sprint_dimension(&dimSTR, D);
|
long nb=sprint_dimension(&dimSTR, D);
|
||||||
|
|
||||||
LOG(" nb char : %ld\n, dim print:\n%s\n",nb, dimSTR);
|
LOG(" nb char : %ld\n, dim print:\n%s\n",nb, dimSTR);
|
||||||
|
|
||||||
@@ -236,10 +242,10 @@ TEST(incrment_dim){
|
|||||||
D->shape[2]=5;
|
D->shape[2]=5;
|
||||||
D->shape[3]=6;
|
D->shape[3]=6;
|
||||||
|
|
||||||
updateRankDim(D);
|
updateDim(D);
|
||||||
|
|
||||||
char *dimSTR =NULL;
|
char *dimSTR =NULL;
|
||||||
size_t nb=sprint_dimension(&dimSTR, D);
|
long nb=sprint_dimension(&dimSTR, D);
|
||||||
|
|
||||||
LOG(" nb char : %ld\n, dim print:\n%s\n",nb, dimSTR);
|
LOG(" nb char : %ld\n, dim print:\n%s\n",nb, dimSTR);
|
||||||
|
|
||||||
@@ -257,7 +263,7 @@ TEST(incrment_dim){
|
|||||||
TEST(list_shape_in_dim){
|
TEST(list_shape_in_dim){
|
||||||
list_shape_in_dim *l_p=NULL;
|
list_shape_in_dim *l_p=NULL;
|
||||||
|
|
||||||
for(size_t i=1;i<5; ++i){
|
for(long i=1;i<5; ++i){
|
||||||
append_in_list_shape(&l_p, i);
|
append_in_list_shape(&l_p, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
[*,7,2]
|
||||||
|
((0,0,0)(8,8)(8,8),(1,2)
|
||||||
|
((0,0,0)(8,8)(8,8),(1,2)
|
||||||
|
((0,0,0)(8,8)(8,8),(1,2)
|
||||||
|
((0,0,0)(8,8)(8,8),(1,2)
|
||||||
|
((0,0,0)(8,8)(8,8),(1,2)
|
||||||
|
((0,0,0)(8,8)(5,9),(1,2)
|
||||||
|
((0,0,0)(8,8)(8,8),(1,2)
|
||||||
|
((0,0,0)(8,8)(8,8),(1,2)
|
||||||
|
((0,0,0)(8,8)(8,8),(1,2)
|
||||||
|
((0,0,0)(8,8)(5,9),(1,2)
|
||||||
|
((0,0,0)(8,8)(8,8),(1,2)
|
||||||
|
((0,0,0)(8,8)(8,8),(1,2)
|
||||||
|
((0,0,0)(8,8)(8,8),(1,2)
|
||||||
|
((0,0,0)(8,8)(5,9),(1,2)
|
||||||
+469
-655
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user