863 uint64_t stride_offset[dims], tmp[dims];
866 for(
int i=0;i<dims;i++)
867 stride_offset[i] = array_info[i].stride * array_info[i].distance;
874 chunk_len = chunk_size / array_info[0].
distance;
875 for(
size_t i=0,
num=0;i<array_info[0].
length;i+=chunk_len){
876 addrs[
num++] = stride_offset[0] * i + base_addr;
880 if(array_info[0].distance > chunk_size){
881 chunk_len = chunk_size / array_info[1].
distance;
882 for(
size_t i=0,
num=0;i<array_info[0].
length;i++){
883 tmp[0] = stride_offset[0] * i;
884 for(
size_t j=0;j<array_info[1].
length;j+=chunk_len){
885 tmp[1] = stride_offset[1] * j;
886 addrs[
num++] = tmp[0] + tmp[1] + base_addr;
891 chunk_len = chunk_size / array_info[0].
distance;
892 for(
size_t i=0,
num=0;i<array_info[0].
length;i+=chunk_len){
893 addrs[
num++] = stride_offset[0] * i + base_addr;
898 if(array_info[1].distance > chunk_size){
899 chunk_len = chunk_size / array_info[2].
distance;
900 for(
size_t i=0,
num=0;i<array_info[0].
length;i++){
901 tmp[0] = stride_offset[0] * i;
902 for(
size_t j=0;j<array_info[1].
length;j++){
903 tmp[1] = stride_offset[1] * j;
904 for(
size_t k=0;k<array_info[2].
length;k+=chunk_len){
905 tmp[2] = stride_offset[2] * k;
906 addrs[
num++] = tmp[0] + tmp[1] + tmp[2] + base_addr;
911 else if(array_info[0].distance > chunk_size){
912 chunk_len = chunk_size / array_info[1].
distance;
913 for(
size_t i=0,
num=0;i<array_info[0].
length;i++){
914 tmp[0] = stride_offset[0] * i;
915 for(
size_t j=0;j<array_info[1].
length;j+=chunk_len){
916 tmp[1] = stride_offset[1] * j;
917 addrs[
num++] = tmp[0] + tmp[1] + base_addr;
922 chunk_len = chunk_size / array_info[0].
distance;
923 for(
size_t i=0,
num=0;i<array_info[0].
length;i+=chunk_len){
924 addrs[
num++] = stride_offset[0] * i + base_addr;
929 if(array_info[2].distance > chunk_size){
930 chunk_len = chunk_size / array_info[3].
distance;
931 for(
size_t i=0,
num=0;i<array_info[0].
length;i++){
932 tmp[0] = stride_offset[0] * i;
933 for(
size_t j=0;j<array_info[1].
length;j++){
934 tmp[1] = stride_offset[1] * j;
935 for(
size_t k=0;k<array_info[2].
length;k++){
936 tmp[2] = stride_offset[2] * k;
937 for(
size_t l=0;l<array_info[3].
length;l+=chunk_len){
938 tmp[3] = stride_offset[3] * l;
939 addrs[
num++] = tmp[0] + tmp[1] + tmp[2] + tmp[3] + base_addr;
945 else if(array_info[1].distance > chunk_size){
946 chunk_len = chunk_size / array_info[2].
distance;
947 for(
size_t i=0,
num=0;i<array_info[0].
length;i++){
948 tmp[0] = stride_offset[0] * i;
949 for(
size_t j=0;j<array_info[1].
length;j++){
950 tmp[1] = stride_offset[1] * j;
951 for(
size_t k=0;k<array_info[2].
length;k+=chunk_len){
952 tmp[2] = stride_offset[2] * k;
953 addrs[
num++] = tmp[0] + tmp[1] + tmp[2] + base_addr;
958 else if(array_info[0].distance > chunk_size){
959 chunk_len = chunk_size / array_info[1].
distance;
960 for(
size_t i=0,
num=0;i<array_info[0].
length;i++){
961 tmp[0] = stride_offset[0] * i;
962 for(
size_t j=0;j<array_info[1].
length;j+=chunk_len){
963 tmp[1] = stride_offset[1] * j;
964 addrs[
num++] = tmp[0] + tmp[1] + base_addr;
969 chunk_len = chunk_size / array_info[0].
distance;
970 for(
size_t i=0,
num=0;i<array_info[0].
length;i+=chunk_len){
971 addrs[
num++] = stride_offset[0] * i + base_addr;
976 if(array_info[3].distance > chunk_size){
977 chunk_len = chunk_size / array_info[4].
distance;
978 for(
size_t i=0,
num=0;i<array_info[0].
length;i++){
979 tmp[0] = stride_offset[0] * i;
980 for(
size_t j=0;j<array_info[1].
length;j++){
981 tmp[1] = stride_offset[1] * j;
982 for(
size_t k=0;k<array_info[2].
length;k++){
983 tmp[2] = stride_offset[2] * k;
984 for(
size_t l=0;l<array_info[3].
length;l++){
985 tmp[3] = stride_offset[3] * l;
986 for(
size_t m=0;m<array_info[4].
length;m+=chunk_len){
987 tmp[4] = stride_offset[4] * m;
988 addrs[
num++] = tmp[0] + tmp[1] + tmp[2] + tmp[3] + tmp[4] + base_addr;
995 else if(array_info[2].distance > chunk_size){
996 chunk_len = chunk_size / array_info[3].
distance;
997 for(
size_t i=0,
num=0;i<array_info[0].
length;i++){
998 tmp[0] = stride_offset[0] * i;
999 for(
size_t j=0;j<array_info[1].
length;j++){
1000 tmp[1] = stride_offset[1] * j;
1001 for(
size_t k=0;k<array_info[2].
length;k++){
1002 tmp[2] = stride_offset[2] * k;
1003 for(
size_t l=0;l<array_info[3].
length;l+=chunk_len){
1004 tmp[3] = stride_offset[3] * l;
1005 addrs[
num++] = tmp[0] + tmp[1] + tmp[2] + tmp[3] + base_addr;
1011 else if(array_info[1].distance > chunk_size){
1012 chunk_len = chunk_size / array_info[2].
distance;
1013 for(
size_t i=0,
num=0;i<array_info[0].
length;i++){
1014 tmp[0] = stride_offset[0] * i;
1015 for(
size_t j=0;j<array_info[1].
length;j++){
1016 tmp[1] = stride_offset[1] * j;
1017 for(
size_t k=0;k<array_info[2].
length;k+=chunk_len){
1018 tmp[2] = stride_offset[2] * k;
1019 addrs[
num++] = tmp[0] + tmp[1] + tmp[2] + base_addr;
1024 else if(array_info[0].distance > chunk_size){
1025 chunk_len = chunk_size / array_info[1].
distance;
1026 for(
size_t i=0,
num=0;i<array_info[0].
length;i++){
1027 tmp[0] = stride_offset[0] * i;
1028 for(
size_t j=0;j<array_info[1].
length;j+=chunk_len){
1029 tmp[1] = stride_offset[1] * j;
1030 addrs[
num++] = tmp[0] + tmp[1] + base_addr;
1035 chunk_len = chunk_size / array_info[0].
distance;
1036 for(
size_t i=0,
num=0;i<array_info[0].
length;i+=chunk_len){
1037 addrs[
num++] = stride_offset[0] * i + base_addr;
1042 if(array_info[4].distance > chunk_size){
1043 chunk_len = chunk_size / array_info[5].
distance;
1044 for(
size_t i=0,
num=0;i<array_info[0].
length;i++){
1045 tmp[0] = stride_offset[0] * i;
1046 for(
size_t j=0;j<array_info[1].
length;j++){
1047 tmp[1] = stride_offset[1] * j;
1048 for(
size_t k=0;k<array_info[2].
length;k++){
1049 tmp[2] = stride_offset[2] * k;
1050 for(
size_t l=0;l<array_info[3].
length;l++){
1051 tmp[3] = stride_offset[3] * l;
1052 for(
size_t m=0;m<array_info[4].
length;m++){
1053 tmp[4] = stride_offset[4] * m;
1054 for(
size_t n=0;n<array_info[5].
length;n+=chunk_len){
1055 tmp[5] = stride_offset[5] * n;
1056 addrs[
num++] = tmp[0] + tmp[1] + tmp[2] + tmp[3] + tmp[4] + tmp[5] + base_addr;
1064 else if(array_info[3].distance > chunk_size){
1065 chunk_len = chunk_size / array_info[4].
distance;
1066 for(
size_t i=0,
num=0;i<array_info[0].
length;i++){
1067 tmp[0] = stride_offset[0] * i;
1068 for(
size_t j=0;j<array_info[1].
length;j++){
1069 tmp[1] = stride_offset[1] * j;
1070 for(
size_t k=0;k<array_info[2].
length;k++){
1071 tmp[2] = stride_offset[2] * k;
1072 for(
size_t l=0;l<array_info[3].
length;l++){
1073 tmp[3] = stride_offset[3] * l;
1074 for(
size_t m=0;m<array_info[4].
length;m+=chunk_len){
1075 tmp[4] = stride_offset[4] * m;
1076 addrs[
num++] = tmp[0] + tmp[1] + tmp[2] + tmp[3] + tmp[4] + base_addr;
1083 else if(array_info[2].distance > chunk_size){
1084 chunk_len = chunk_size / array_info[3].
distance;
1085 for(
size_t i=0,
num=0;i<array_info[0].
length;i++){
1086 tmp[0] = stride_offset[0] * i;
1087 for(
size_t j=0;j<array_info[1].
length;j++){
1088 tmp[1] = stride_offset[1] * j;
1089 for(
size_t k=0;k<array_info[2].
length;k++){
1090 tmp[2] = stride_offset[2] * k;
1091 for(
size_t l=0;l<array_info[3].
length;l+=chunk_len){
1092 tmp[3] = stride_offset[3] * l;
1093 addrs[
num++] = tmp[0] + tmp[1] + tmp[2] + tmp[3] + base_addr;
1099 else if(array_info[1].distance > chunk_size){
1100 chunk_len = chunk_size / array_info[2].
distance;
1101 for(
size_t i=0,
num=0;i<array_info[0].
length;i++){
1102 tmp[0] = stride_offset[0] * i;
1103 for(
size_t j=0;j<array_info[1].
length;j++){
1104 tmp[1] = stride_offset[1] * j;
1105 for(
size_t k=0;k<array_info[2].
length;k+=chunk_len){
1106 tmp[2] = stride_offset[2] * k;
1107 addrs[
num++] = tmp[0] + tmp[1] + tmp[2] + base_addr;
1112 else if(array_info[0].distance > chunk_size){
1113 chunk_len = chunk_size / array_info[1].
distance;
1114 for(
size_t i=0,
num=0;i<array_info[0].
length;i++){
1115 tmp[0] = stride_offset[0] * i;
1116 for(
size_t j=0;j<array_info[1].
length;j+=chunk_len){
1117 tmp[1] = stride_offset[1] * j;
1118 addrs[
num++] = tmp[0] + tmp[1] + base_addr;
1123 chunk_len = chunk_size / array_info[0].
distance;
1124 for(
size_t i=0,
num=0;i<array_info[0].
length;i+=chunk_len){
1125 addrs[
num++] = stride_offset[0] * i + base_addr;
1130 if(array_info[5].distance > chunk_size){
1131 chunk_len = chunk_size / array_info[6].
distance;
1132 for(
size_t i=0,
num=0;i<array_info[0].
length;i++){
1133 tmp[0] = stride_offset[0] * i;
1134 for(
size_t j=0;j<array_info[1].
length;j++){
1135 tmp[1] = stride_offset[1] * j;
1136 for(
size_t k=0;k<array_info[2].
length;k++){
1137 tmp[2] = stride_offset[2] * k;
1138 for(
size_t l=0;l<array_info[3].
length;l++){
1139 tmp[3] = stride_offset[3] * l;
1140 for(
size_t m=0;m<array_info[4].
length;m++){
1141 tmp[4] = stride_offset[4] * m;
1142 for(
size_t n=0;n<array_info[5].
length;n++){
1143 tmp[5] = stride_offset[5] * n;
1144 for(
size_t p=0;p<array_info[6].
length;p+=chunk_len){
1145 tmp[6] = stride_offset[6] * p;
1146 addrs[
num++] = tmp[0] + tmp[1] + tmp[2] + tmp[3] + tmp[4] + tmp[5] + tmp[6] + base_addr;
1155 else if(array_info[4].distance > chunk_size){
1156 chunk_len = chunk_size / array_info[5].
distance;
1157 for(
size_t i=0,
num=0;i<array_info[0].
length;i++){
1158 tmp[0] = stride_offset[0] * i;
1159 for(
size_t j=0;j<array_info[1].
length;j++){
1160 tmp[1] = stride_offset[1] * j;
1161 for(
size_t k=0;k<array_info[2].
length;k++){
1162 tmp[2] = stride_offset[2] * k;
1163 for(
size_t l=0;l<array_info[3].
length;l++){
1164 tmp[3] = stride_offset[3] * l;
1165 for(
size_t m=0;m<array_info[4].
length;m++){
1166 tmp[4] = stride_offset[4] * m;
1167 for(
size_t n=0;n<array_info[5].
length;n+=chunk_len){
1168 tmp[5] = stride_offset[5] * n;
1169 addrs[
num++] = tmp[0] + tmp[1] + tmp[2] + tmp[3] + tmp[4] + tmp[5] + base_addr;
1177 else if(array_info[3].distance > chunk_size){
1178 chunk_len = chunk_size / array_info[4].
distance;
1179 for(
size_t i=0,
num=0;i<array_info[0].
length;i++){
1180 tmp[0] = stride_offset[0] * i;
1181 for(
size_t j=0;j<array_info[1].
length;j++){
1182 tmp[1] = stride_offset[1] * j;
1183 for(
size_t k=0;k<array_info[2].
length;k++){
1184 tmp[2] = stride_offset[2] * k;
1185 for(
size_t l=0;l<array_info[3].
length;l++){
1186 tmp[3] = stride_offset[3] * l;
1187 for(
size_t m=0;m<array_info[4].
length;m+=chunk_len){
1188 tmp[4] = stride_offset[4] * m;
1189 addrs[
num++] = tmp[0] + tmp[1] + tmp[2] + tmp[3] + tmp[4] + base_addr;
1196 else if(array_info[2].distance > chunk_size){
1197 chunk_len = chunk_size / array_info[3].
distance;
1198 for(
size_t i=0,
num=0;i<array_info[0].
length;i++){
1199 tmp[0] = stride_offset[0] * i;
1200 for(
size_t j=0;j<array_info[1].
length;j++){
1201 tmp[1] = stride_offset[1] * j;
1202 for(
size_t k=0;k<array_info[2].
length;k++){
1203 tmp[2] = stride_offset[2] * k;
1204 for(
size_t l=0;l<array_info[3].
length;l+=chunk_len){
1205 tmp[3] = stride_offset[3] * l;
1206 addrs[
num++] = tmp[0] + tmp[1] + tmp[2] + tmp[3] + base_addr;
1212 else if(array_info[1].distance > chunk_size){
1213 chunk_len = chunk_size / array_info[2].
distance;
1214 for(
size_t i=0,
num=0;i<array_info[0].
length;i++){
1215 tmp[0] = stride_offset[0] * i;
1216 for(
size_t j=0;j<array_info[1].
length;j++){
1217 tmp[1] = stride_offset[1] * j;
1218 for(
size_t k=0;k<array_info[2].
length;k+=chunk_len){
1219 tmp[2] = stride_offset[2] * k;
1220 addrs[
num++] = tmp[0] + tmp[1] + tmp[2] + base_addr;
1225 else if(array_info[0].distance > chunk_size){
1226 chunk_len = chunk_size / array_info[1].
distance;
1227 for(
size_t i=0,
num=0;i<array_info[0].
length;i++){
1228 tmp[0] = stride_offset[0] * i;
1229 for(
size_t j=0;j<array_info[1].
length;j+=chunk_len){
1230 tmp[1] = stride_offset[1] * j;
1231 addrs[
num++] = tmp[0] + tmp[1] + base_addr;
1236 chunk_len = chunk_size / array_info[0].
distance;
1237 for(
size_t i=0,
num=0;i<array_info[0].
length;i+=chunk_len){
1238 addrs[
num++] = stride_offset[0] * i + base_addr;