Skip to content

Commit 6cd5ff7

Browse files
committed
1. fix warning
1 parent 76018dc commit 6cd5ff7

17 files changed

+55
-65
lines changed

include/RI/ri/LRI-cal_loop3.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ void LRI<TA,Tcell,Ndim,Tdata>::cal_loop3(
3838
{
3939
case Label::ab_ab::a0b0_a1b2: case Label::ab_ab::a0b0_a2b2: case Label::ab_ab::a1b2_a2b1:
4040
return true;
41+
default: ;
4142
}
4243
return false;
4344
}();
@@ -48,6 +49,7 @@ void LRI<TA,Tcell,Ndim,Tdata>::cal_loop3(
4849
{
4950
case Label::ab_ab::a0b0_a2b1: case Label::ab_ab::a0b0_a2b2:
5051
return true;
52+
default: ;
5153
}
5254
return false;
5355
}();

include/RI/ri/LRI_Cal_Tools.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class LRI_Cal_Tools
7070
return this->Ds_result[icoef][Aa.first][TAC{Ab.first, (Ab.second-Aa.second)%period}];
7171
}
7272

73-
inline static std::vector<Label::ab> split_b01(const Label::ab_ab &label)
73+
inline std::vector<Label::ab> split_b01(const Label::ab_ab &label) const
7474
{
7575
switch(label)
7676
{
@@ -96,7 +96,7 @@ class LRI_Cal_Tools
9696
{
9797
const auto judge_label = [this, &Aa01, &Aa2, &Ab01](const Label::ab_ab &label_ab_ab) -> bool
9898
{
99-
const std::vector<Label::ab> &labels_ab = split_b01(label_ab_ab);
99+
const std::vector<Label::ab> &labels_ab = this->split_b01(label_ab_ab);
100100
for(const Label::ab &label_ab : labels_ab)
101101
{
102102
const int a = Label_Tools::get_a(label_ab);

include/RI/ri/Label_Tools.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace RI
1515

1616
namespace Label_Tools
1717
{
18-
static std::string get_name(const Label::ab &label)
18+
inline std::string get_name(const Label::ab &label)
1919
{
2020
switch(label)
2121
{
@@ -34,7 +34,7 @@ namespace Label_Tools
3434
}
3535
}
3636

37-
static std::string get_name(const Label::ab_ab &label)
37+
inline std::string get_name(const Label::ab_ab &label)
3838
{
3939
switch(label)
4040
{
@@ -60,7 +60,7 @@ namespace Label_Tools
6060
}
6161
}
6262

63-
static std::string get_name(const Label::Aab &label)
63+
inline std::string get_name(const Label::Aab &label)
6464
{
6565
switch(label)
6666
{
@@ -74,7 +74,7 @@ namespace Label_Tools
7474
}
7575
}
7676

77-
static std::string get_name(const Label::Aab_Aab &label)
77+
inline std::string get_name(const Label::Aab_Aab &label)
7878
{
7979
switch(label)
8080
{

unittests/Test_All.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
namespace Test_All
2626
{
27-
void test_all(int argc, char *argv[])
27+
static void test_all(int argc, char *argv[])
2828
{
2929
Communicate_Tensors_Test::test_comm_judge_map(argc, argv);
3030
Communicate_Tensors_Test::test_comm_judge_map2(argc, argv);

unittests/comm/mix/Communicate_Tensors-test.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
namespace Communicate_Tensors_Test
1919
{
20-
RI::Tensor<double> init_Tensor(const double d)
20+
inline RI::Tensor<double> init_Tensor(const double d)
2121
{
2222
RI::Tensor<double> t({1});
2323
t(0) = d;
@@ -43,7 +43,7 @@ namespace Communicate_Tensors_Test
4343
rank 4:
4444
*/
4545

46-
void test_comm_judge_map(int argc, char *argv[])
46+
static void test_comm_judge_map(int argc, char *argv[])
4747
{
4848
int mpi_init_provide; MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &mpi_init_provide);
4949
const int rank_mine = RI::MPI_Wrapper::mpi_get_rank(MPI_COMM_WORLD);
@@ -76,7 +76,7 @@ namespace Communicate_Tensors_Test
7676
MPI_Finalize();
7777
}
7878

79-
void test_comm_judge_map2(int argc, char *argv[])
79+
static void test_comm_judge_map2(int argc, char *argv[])
8080
{
8181
int mpi_init_provide; MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &mpi_init_provide);
8282
const int rank_mine = RI::MPI_Wrapper::mpi_get_rank(MPI_COMM_WORLD);
@@ -113,7 +113,7 @@ namespace Communicate_Tensors_Test
113113
MPI_Finalize();
114114
}
115115

116-
void test_comm_judge_map3(int argc, char *argv[])
116+
static void test_comm_judge_map3(int argc, char *argv[])
117117
{
118118
int mpi_init_provide; MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &mpi_init_provide);
119119
const int rank_mine = RI::MPI_Wrapper::mpi_get_rank(MPI_COMM_WORLD);
@@ -151,7 +151,7 @@ namespace Communicate_Tensors_Test
151151
MPI_Finalize();
152152
}
153153

154-
void test_comm_judge_map2_first(int argc, char *argv[])
154+
static void test_comm_judge_map2_first(int argc, char *argv[])
155155
{
156156
int mpi_init_provide; MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &mpi_init_provide);
157157
const int rank_mine = RI::MPI_Wrapper::mpi_get_rank(MPI_COMM_WORLD);
@@ -186,7 +186,7 @@ namespace Communicate_Tensors_Test
186186
MPI_Finalize();
187187
}
188188

189-
void test_comm_judge_map3_first(int argc, char *argv[])
189+
static void test_comm_judge_map3_first(int argc, char *argv[])
190190
{
191191
int mpi_init_provide; MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &mpi_init_provide);
192192
const int rank_mine = RI::MPI_Wrapper::mpi_get_rank(MPI_COMM_WORLD);
@@ -222,7 +222,7 @@ namespace Communicate_Tensors_Test
222222
MPI_Finalize();
223223
}
224224

225-
void test_comm_judge_map2_period(int argc, char *argv[])
225+
static void test_comm_judge_map2_period(int argc, char *argv[])
226226
{
227227
int mpi_init_provide; MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &mpi_init_provide);
228228
const int rank_mine = RI::MPI_Wrapper::mpi_get_rank(MPI_COMM_WORLD);
@@ -262,7 +262,7 @@ namespace Communicate_Tensors_Test
262262
MPI_Finalize();
263263
}
264264

265-
void test_comm_judge_map3_period(int argc, char *argv[])
265+
static void test_comm_judge_map3_period(int argc, char *argv[])
266266
{
267267
int mpi_init_provide; MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &mpi_init_provide);
268268
const int rank_mine = RI::MPI_Wrapper::mpi_get_rank(MPI_COMM_WORLD);

unittests/distribute/Distribute_Equally-test.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
namespace Distribute_Equally_Test
1515
{
16-
void test_distribute_atoms(int argc, char *argv[])
16+
static void test_distribute_atoms(int argc, char *argv[])
1717
{
1818
MPI_Init(&argc, &argv);
1919

@@ -57,7 +57,7 @@ namespace Distribute_Equally_Test
5757
{ 3, 0 }| { 3, -1 }| { 4, 0 }| { 4, -1 }|
5858
*/
5959

60-
void test_distribute_atoms_periods(int argc, char *argv[])
60+
static void test_distribute_atoms_periods(int argc, char *argv[])
6161
{
6262
MPI_Init(&argc, &argv);
6363

@@ -101,7 +101,7 @@ namespace Distribute_Equally_Test
101101
{ 3, -1 }| { 4, 0 }| { 4, -1 }|
102102
*/
103103

104-
void test_distribute_atoms_repeatable(int argc, char *argv[])
104+
static void test_distribute_atoms_repeatable(int argc, char *argv[])
105105
{
106106
auto test_repeatable = [&](const bool repeatable)
107107
{
@@ -151,7 +151,7 @@ namespace Distribute_Equally_Test
151151
*/
152152
}
153153

154-
void test_distribute_periods(int argc, char *argv[])
154+
static void test_distribute_periods(int argc, char *argv[])
155155
{
156156
MPI_Init(&argc, &argv);
157157

unittests/distribute/Divide_Atoms-test.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
namespace Divide_Atoms_Test
1212
{
13-
void test_divide_atoms()
13+
static void test_divide_atoms()
1414
{
1515
const std::size_t group_size = 6;
1616
std::vector<std::size_t> atoms(31);
@@ -29,7 +29,7 @@ namespace Divide_Atoms_Test
2929
*/
3030

3131

32-
void test_divide_atoms_with_period()
32+
static void test_divide_atoms_with_period()
3333
{
3434
const std::size_t group_size = 6;
3535
std::vector<std::size_t> atoms(31);
@@ -49,7 +49,7 @@ namespace Divide_Atoms_Test
4949
*/
5050

5151

52-
void test_divide_atoms_periods()
52+
static void test_divide_atoms_periods()
5353
{
5454
const std::size_t group_size = 6;
5555
std::vector<std::size_t> atoms(31);

unittests/distribute/Split_Processes-test.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Split_Processes_Test
1313
{
14-
void test_split_all(int argc, char *argv[], const std::vector<std::size_t> &task_sizes)
14+
static void test_split_all(int argc, char *argv[], const std::vector<std::size_t> &task_sizes)
1515
{
1616
MPI_Init(&argc, &argv);
1717

@@ -28,9 +28,9 @@ namespace Split_Processes_Test
2828
MPI_Finalize();
2929
}
3030

31-
void test_split_all(int argc, char *argv[])
31+
static void test_split_all(int argc, char *argv[])
3232
{
33-
//test_split_all(argc, argv, {8,12});
33+
test_split_all(argc, argv, {8,12});
3434
/*
3535
mpirun -n 6 // num_average 恰好为4,完美均分
3636
rank 0
@@ -60,7 +60,7 @@ namespace Split_Processes_Test
6060
*/
6161

6262

63-
//test_split_all(argc, argv, {4,5,6});
63+
test_split_all(argc, argv, {4,5,6});
6464
/*
6565
mpirun -n 7 // num_average 各维度、各进程不同,尽量均分
6666
rank 0
@@ -100,7 +100,7 @@ namespace Split_Processes_Test
100100
0 1 | 0 1
101101
*/
102102

103-
//test_split_all(argc, argv, {2,10}); // task_sizes[0] << task_sizes[1], 按照第1维划分
103+
test_split_all(argc, argv, {2,10}); // task_sizes[0] << task_sizes[1], 按照第1维划分
104104
/*
105105
mpirun -n 3
106106
rank 0
@@ -117,7 +117,7 @@ namespace Split_Processes_Test
117117
0 1 | 2 3
118118
*/
119119

120-
//test_split_all(argc, argv, {2,3});
120+
test_split_all(argc, argv, {2,3});
121121
/*
122122
mpirun -n 7 // task_sizes > rank_size, 01进程被分到同一task
123123
rank 0

unittests/global/Blas-test.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ namespace Blas_Test
139139
// 35 365
140140
}
141141

142-
void syrk()
142+
static void syrk()
143143
{
144144
const RI::Tensor<double> m = Tensor_Test::init_matrix<double>(2,3);
145145

@@ -187,7 +187,7 @@ namespace Blas_Test
187187
}
188188
#endif
189189

190-
void test_all()
190+
static void test_all()
191191
{
192192
nrm2<float>();
193193
nrm2<double>();

unittests/global/Map_Operator-test.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
namespace Map_Operator_Test
1515
{
16-
void test_union_map1()
16+
static void test_union_map1()
1717
{
1818
std::map<int,double> m1, m2;
1919
m1[2]=2; m1[1]=1;
@@ -27,7 +27,7 @@ namespace Map_Operator_Test
2727
}*/
2828
}
2929

30-
void test_union_map2()
30+
static void test_union_map2()
3131
{
3232
std::map<int,std::map<std::string,double>> m1, m2;
3333
m1[2]["a"]=2; m1[1]["b"]=1;
@@ -41,7 +41,7 @@ namespace Map_Operator_Test
4141
}*/
4242
}
4343

44-
void test_intersection_map1()
44+
static void test_intersection_map1()
4545
{
4646
std::map<int,double> m1, m2;
4747
m1[2]=2; m1[1]=1;
@@ -53,7 +53,7 @@ namespace Map_Operator_Test
5353
}*/
5454
}
5555

56-
void test_intersection_map2()
56+
static void test_intersection_map2()
5757
{
5858
std::map<int,std::map<std::string,double>> m1, m2;
5959
m1[2]["a"]=2; m1[1]["b"]=1;
@@ -65,7 +65,7 @@ namespace Map_Operator_Test
6565
}*/
6666
}
6767

68-
void test_intersection_map3()
68+
static void test_intersection_map3()
6969
{
7070
std::map<int,std::map<std::string,double>> m1;
7171
std::map<int,std::map<std::string,std::string>> m2;
@@ -78,7 +78,7 @@ namespace Map_Operator_Test
7878
}*/
7979
}
8080

81-
void test_transform_map()
81+
static void test_transform_map()
8282
{
8383
std::map<int,std::map<std::string,double>> m;
8484
m[0]["c"]=0; m[1]["b"]=10; m[1]["c"]=20;
@@ -91,7 +91,7 @@ namespace Map_Operator_Test
9191
}*/
9292
}
9393

94-
void test_for_each_map()
94+
static void test_for_each_map()
9595
{
9696
std::map<int,std::map<std::string,double>> m;
9797
m[0]["c"]=0; m[1]["b"]=10; m[1]["c"]=20;

0 commit comments

Comments
 (0)