[fix] debug tensor func, [update] gitignore
This commit is contained in:
+15
-14
@@ -876,7 +876,7 @@ void append_array_chainlist_##type(array_chainlist_##type **list_a, type x);\
|
||||
tensor_##type * create_tensor_from_list_array_##type( array_chainlist_##type *l_a, dimension *part_dim);\
|
||||
void free_array_chainlist_##type(array_chainlist_##type *l_a);\
|
||||
tensor_##type * transpose_notOpt_tensor_##type(tensor_##type *org);\
|
||||
tensor_##type * shapeute_notOpt_tensor_##type(tensor_##type *org, dimension *dshape);\
|
||||
tensor_##type * permute_notOpt_tensor_##type(tensor_##type *org, dimension *dshape);\
|
||||
void update_1tensor_func_##type(tensor_##type *M0, \
|
||||
type (*func)(type), size_t nbthread);\
|
||||
void update_2tensor_func_##type(tensor_##type *M0, tensor_##type *M1, \
|
||||
@@ -1576,7 +1576,7 @@ void tensorContractnProd_##type(tensor_##type** MM, tensor_##type *M0, tensor_##
|
||||
printf("checkContractProdTensorDim %ld contractionNumber\n", contractionNumber);\
|
||||
printDebug_dimension(M0->dim, "M0 dim");\
|
||||
printDebug_dimension(M1->dim, "M1 dim");\
|
||||
getchar();\
|
||||
/*getchar();*/\
|
||||
}\
|
||||
\
|
||||
size_t len0 = M0->dim->rank - contractionNumber;\
|
||||
@@ -1654,7 +1654,7 @@ void tensorContractnProdOpt0_##type(tensor_##type** MM, tensor_##type *M0, tenso
|
||||
printf("checkContractProdTensorDim %ld contractionNumber\n", contractionNumber);\
|
||||
printDebug_dimension(M0->dim, "M0 dim");\
|
||||
printDebug_dimension(M1->dim, "M1 dim");\
|
||||
getchar();\
|
||||
/*getchar();*/\
|
||||
}\
|
||||
\
|
||||
size_t len0 = M0->dim->rank - contractionNumber;\
|
||||
@@ -1897,7 +1897,7 @@ void tensorContractnProdThread_##type(tensor_##type** MM, tensor_##type *M0, ten
|
||||
printf("checkContractProdTensorDim %ld contractionNumber\n", contractionNumber);\
|
||||
printDebug_dimension(M0->dim, "M0 dim");\
|
||||
printDebug_dimension(M1->dim, "M1 dim");\
|
||||
getchar();\
|
||||
/*getchar();*/\
|
||||
}\
|
||||
size_t len0 = M0->dim->rank - contractionNumber;\
|
||||
size_t len1 = M1->dim->rank - contractionNumber;\
|
||||
@@ -1994,7 +1994,7 @@ void tensorContractnProdThreadOpt0_##type(tensor_##type** MM, tensor_##type *M0,
|
||||
printf("checkContractProdTensorDim %ld contractionNumber\n", contractionNumber);\
|
||||
printDebug_dimension(M0->dim, "M0 dim");\
|
||||
printDebug_dimension(M1->dim, "M1 dim");\
|
||||
getchar();\
|
||||
/*getchar();*/\
|
||||
}\
|
||||
size_t len0 = M0->dim->rank - contractionNumber;\
|
||||
size_t len1 = M1->dim->rank - contractionNumber;\
|
||||
@@ -2101,7 +2101,7 @@ void tensorContractnPro2dThread_##type(tensor_##type** MM, tensor_##type *M0, te
|
||||
printf("checkContractProdTensorDim %ld contractionNumber\n", contractionNumber);\
|
||||
printDebug_dimension(M0->dim, "M0 dim");\
|
||||
printDebug_dimension(M1->dim, "M1 dim");\
|
||||
getchar();\
|
||||
/*getchar();*/\
|
||||
}\
|
||||
\
|
||||
size_t len0 = M0->dim->rank - contractionNumber;\
|
||||
@@ -2201,7 +2201,7 @@ void tensorContractnPro2dThreadOpt0_##type(tensor_##type** MM, tensor_##type *M0
|
||||
printf("checkContractProdTensorDim %ld contractionNumber\n", contractionNumber);\
|
||||
printDebug_dimension(M0->dim, "M0 dim");\
|
||||
printDebug_dimension(M1->dim, "M1 dim");\
|
||||
getchar();\
|
||||
/*getchar();*/\
|
||||
}\
|
||||
\
|
||||
size_t len0 = M0->dim->rank - contractionNumber;\
|
||||
@@ -2260,7 +2260,7 @@ void tensorContractnProdNotOpt_##type(tensor_##type** MM, tensor_##type *M0, ten
|
||||
printf("error Deep = %ld\n", contractionNumber);\
|
||||
printDebug_dimension(M0->dim, "M0 dim");\
|
||||
printDebug_dimension(M1->dim, "M1 dim");\
|
||||
getchar();\
|
||||
/*getchar();*/\
|
||||
}\
|
||||
size_t len0 = M0->dim->rank - contractionNumber;\
|
||||
size_t len1 = M1->dim->rank - contractionNumber;\
|
||||
@@ -2883,33 +2883,34 @@ tensor_##type * transpose_notOpt_tensor_##type(tensor_##type *org){\
|
||||
}\
|
||||
\
|
||||
tensor_##type * transpose_Opt0_tensor_##type(tensor_##type *org){\
|
||||
size_t dimrnk = org->rank;\
|
||||
size_t dimrnk = org->dim->rank;\
|
||||
dimension *dim_tr=create_dim(dimrnk);\
|
||||
for(size_t i=0; i<dimrnk; ++i) dim_tr->shape[i]=(org->dim)->shape[(dimrnk-1)-i];\
|
||||
updateDim(dim_tr);\
|
||||
printDebug_dimension(dim_tr,"dim_trOpt");\
|
||||
tensor_##type *tens_tr = CREATE_TENSOR_##type(dim_tr);\
|
||||
tensor_##type *tens_tr = create_tensor_##type(dim_tr);\
|
||||
/*tensor_##type *tens_tr = CREATE_TENSOR_##type(dim_tr);*/\
|
||||
long int cur_tr=0, add_tr=0, minus_tr=0;\
|
||||
tens_tr->x[cur_tr] = org->x[cur_tr];\
|
||||
for(size_t i=1; i<dim_tr->size; ++i){\
|
||||
minus_tr =0;\
|
||||
/*printf("DEBUG: cur_tr=%ld\n",cur_tr);*/\
|
||||
for(size_t l=0; l<dimrnk; ++l){ \
|
||||
add_tr = minus_tr + dim_tr->base[l+1];\
|
||||
if(cur_tr + add_tr < dim_tr->base[l]){\
|
||||
add_tr = minus_tr + dim_tr->basis[l+1];\
|
||||
if(cur_tr + add_tr < dim_tr->basis[l]){\
|
||||
cur_tr += add_tr;\
|
||||
/*tens_tr->x[cur_tr] = org->x[i]*/;\
|
||||
tens_tr->x[i] = org->x[cur_tr];\
|
||||
break;\
|
||||
}\
|
||||
minus_tr -= (dim_tr->base[l]-dim_tr->base[l+1]);\
|
||||
minus_tr -= (dim_tr->basis[l]-dim_tr->basis[l+1]);\
|
||||
}\
|
||||
/*printf("DEBUG: after cur_tr=%ld\n",cur_tr);*/\
|
||||
}\
|
||||
return tens_tr;\
|
||||
}\
|
||||
\
|
||||
tensor_##type * shapeute_notOpt_tensor_##type(tensor_##type *org, dimension *dshape){\
|
||||
tensor_##type * permute_notOpt_tensor_##type(tensor_##type *org, dimension *dshape){\
|
||||
size_t dimrnk = (org->dim)->rank; \
|
||||
dimension *dim_tr=create_dim(dimrnk);\
|
||||
for(size_t i=0; i<dimrnk; ++i) dim_tr->shape[i]=(org->dim)->shape[(dimrnk-1)-i];\
|
||||
|
||||
Reference in New Issue
Block a user