From ebb8677dc6d9433d5479fd354a45b0d27409e388 Mon Sep 17 00:00:00 2001 From: Eisuke Kawashima Date: Wed, 1 Nov 2023 02:12:26 +0900 Subject: [PATCH] src/bin/libint/task.cc src/bin/libint/test.cc src/bin/profile/chrono.cc src/bin/profile/generate_t0g12_code.cc src/bin/profile/profile.cc src/bin/test_eri/generate_eri_code.cc src/bin/test_eri/test_eri.cc src/bin/test_eri/test_eri_rys.cc src/bin/test_eri/test_eri_rys_vec.cc src/bin/test_eri/time_eri.cc --- src/bin/libint/task.cc | 10 +++++----- src/bin/libint/test.cc | 26 +++++++++++++------------- src/bin/profile/chrono.cc | 6 +++--- src/bin/profile/generate_t0g12_code.cc | 2 +- src/bin/profile/profile.cc | 24 ++++++++++++------------ src/bin/test_eri/generate_eri_code.cc | 2 +- src/bin/test_eri/test_eri.cc | 4 ++-- src/bin/test_eri/test_eri_rys.cc | 10 +++++----- src/bin/test_eri/test_eri_rys_vec.cc | 10 +++++----- src/bin/test_eri/time_eri.cc | 6 +++--- 10 files changed, 50 insertions(+), 50 deletions(-) diff --git a/src/bin/libint/task.cc b/src/bin/libint/task.cc index 4c05e8dde..9069ec962 100644 --- a/src/bin/libint/task.cc +++ b/src/bin/libint/task.cc @@ -99,7 +99,7 @@ LibraryTaskManager::current() void TaskExternSymbols::add(const SymbolList& symbols) { - typedef SymbolList::const_iterator citer; + using citer = SymbolList::const_iterator; citer end = symbols.end(); for(citer s=symbols.begin(); s!=end; ++s) { symbols_[*s] = true; @@ -109,7 +109,7 @@ TaskExternSymbols::add(const SymbolList& symbols) void TaskExternSymbols::add(const RRList& rrlist) { - typedef RRList::const_iterator citer; + using citer = RRList::const_iterator; citer end = rrlist.end(); for(citer rr=rrlist.begin(); rr!=end; ++rr) { rrmap_[*rr] = true; @@ -120,7 +120,7 @@ const TaskExternSymbols::SymbolList& TaskExternSymbols::symbols() const { symbollist_.clear(); - typedef Symbols::const_iterator citer; + using citer = Symbols::const_iterator; citer end = symbols_.end(); for(citer s=symbols_.begin(); s!=end; ++s) { @@ -132,7 +132,7 @@ TaskExternSymbols::symbols() const bool TaskExternSymbols::find(const RRid& rrid) const { - typedef RRmap::const_iterator citer; + using citer = RRmap::const_iterator; citer found = rrmap_.find(rrid); return (found != rrmap_.end()); } @@ -140,7 +140,7 @@ TaskExternSymbols::find(const RRid& rrid) const TaskExternSymbols::RRList TaskExternSymbols::rrlist() const { RRList result; - typedef RRmap::const_iterator citer; + using citer = RRmap::const_iterator; citer end = rrmap_.end(); for(citer rr=rrmap_.begin(); rr!=end; ++rr) { result.push_back(rr->first); diff --git a/src/bin/libint/test.cc b/src/bin/libint/test.cc index 94c2f8946..b46492321 100644 --- a/src/bin/libint/test.cc +++ b/src/bin/libint/test.cc @@ -278,7 +278,7 @@ namespace { const typename Integral::OperType::Descriptor& descr, unsigned int size_to_unroll) { std::string descr_label("build "); - typedef typename Integral::OperType::Descriptor Descriptor; + using Descriptor = typename Integral::OperType::Descriptor; GenOper oper(descr); SafePtr i = Integral::Instance(f1,f2,f3,f4,m,oper); descr_label += i->label(); @@ -316,32 +316,32 @@ namespace { CGShell csh_q(12u); { - typedef TwoPRep_11_11_sq IType; + using IType = TwoPRep_11_11_sq; SafePtr iset = IType::Instance(sh_p,sh_p,sh_p,sh_p,0u); std::cout << "Created integral set " << iset->label() << " key = " << iset->key() << std::endl; } { - typedef R12kG12_11_11_sq IType; + using IType = R12kG12_11_11_sq; SafePtr iset = IType::Instance(sh_p,sh_p,sh_p,sh_p,0u,IType::OperType(-1)); std::cout << "Created integral set " << iset->label() << " key = " << iset->key() << std::endl; } { - typedef TwoPRep_11_11_sq IType; + using IType = TwoPRep_11_11_sq; SafePtr iset = IType::Instance(csh_s,csh_q,csh_s,csh_s,0u); std::cout << "Created integral set " << iset->label() << " key = " << iset->key() << std::endl; } { - typedef TwoPRep_11_11_sq IType; + using IType = TwoPRep_11_11_sq; SafePtr iset = IType::Instance(csh_s,csh_d_dx,csh_s,csh_s,0u); std::cout << "Created integral set " << iset->label() << " key = " << iset->key() << std::endl; } { - typedef TwoPRep_11_11_sq IType; + using IType = TwoPRep_11_11_sq; SafePtr iset = IType::Instance(csh_s,csh_f_dx,csh_s,csh_s,0u); std::cout << "Created integral set " << iset->label() << " key = " << iset->key() << std::endl; } { - typedef TwoPRep_11_11_sq IType; + using IType = TwoPRep_11_11_sq; SafePtr iset = IType::Instance(csh_q,csh_q,csh_q,csh_q,0u); std::cout << "Created integral set " << iset->label() << " key = " << iset->key() << std::endl; } @@ -351,22 +351,22 @@ namespace { test3() { { - typedef TwoPRep_11_11_sq IType; - typedef VRR_a_11_TwoPRep_11_sh RRType; + using IType = TwoPRep_11_11_sq; + using RRType = VRR_a_11_TwoPRep_11_sh; SafePtr iset = IType::Instance(sh_p,sh_p,sh_p,sh_p,0u); SafePtr rr = RRType::Instance(iset,0); std::cout << "Created recurrence relation " << rr->label() << std::endl; } { - typedef TwoPRep_11_11_sq IType; - typedef VRR_c_11_TwoPRep_11_sh RRType; + using IType = TwoPRep_11_11_sq; + using RRType = VRR_c_11_TwoPRep_11_sh; SafePtr iset = IType::Instance(sh_p,sh_p,sh_p,sh_p,0u); SafePtr rr = RRType::Instance(iset,0); std::cout << "Created recurrence relation " << rr->label() << std::endl; } { - typedef DivG12prime_xTx_11_11_sq IType; - typedef CR_11_DivG12prime_xTx_11_sh RRType; + using IType = DivG12prime_xTx_11_11_sq; + using RRType = CR_11_DivG12prime_xTx_11_sh; SafePtr iset = IType::Instance(sh_p,sh_p,sh_p,sh_p,0u,DivG12prime_xTx_Descr(0)); SafePtr rr = RRType::Instance(iset,0); std::cout << "Created recurrence relation " << rr->label() << std::endl; diff --git a/src/bin/profile/chrono.cc b/src/bin/profile/chrono.cc index 064c6bad1..328b429d4 100644 --- a/src/bin/profile/chrono.cc +++ b/src/bin/profile/chrono.cc @@ -29,8 +29,8 @@ int main (int argc, char* argv[]) { - typedef std::chrono::high_resolution_clock clock_t; - typedef std::chrono::time_point time_point_t; + using clock_t = std::chrono::high_resolution_clock; + using time_point_t = std::chrono::time_point; std::cout << "WARNING: turn off turboboost for reliable profiling" << std::endl; @@ -42,7 +42,7 @@ int main (int argc, char* argv[]) asm("nop"); } auto tstop = clock_t::now(); - typedef std::chrono::duration dur_t; + using dur_t = std::chrono::duration; const dur_t d0 = tstop - tstart; std::cout << "nop took " << std::setprecision(15) << d0.count()*1e9/nrepeats << " nanoseconds" << std::endl; diff --git a/src/bin/profile/generate_t0g12_code.cc b/src/bin/profile/generate_t0g12_code.cc index 07e0ddd00..dc4d143d5 100644 --- a/src/bin/profile/generate_t0g12_code.cc +++ b/src/bin/profile/generate_t0g12_code.cc @@ -44,7 +44,7 @@ int main (int argc, char* argv[]) namespace { unsigned int am[][1] = { {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}}; - typedef TiG12_11_11 IntegralSet; + using IntegralSet = TiG12_11_11; int try_main (int argc, char* argv[]) { diff --git a/src/bin/profile/profile.cc b/src/bin/profile/profile.cc index 1a927c041..ed9792ad9 100644 --- a/src/bin/profile/profile.cc +++ b/src/bin/profile/profile.cc @@ -36,7 +36,7 @@ #ifndef SKIP_AXPY # include -typedef MKL_INT BLAS_INT; +using BLAS_INT = MKL_INT; #endif #ifdef SKIP_ALL @@ -108,7 +108,7 @@ void do_stg(int mmax, double T, double U, int nrepeats); template struct BasicKernel { - typedef Real ResultType; + using ResultType = Real; BasicKernel(Real T, std::string label, double T_dec = 0.00001) : label_(label), T_(T), T_dec_(T_dec), sum_(0) {} std::string label() const { return label_; } @@ -164,7 +164,7 @@ struct VectorOpKernel { template struct AXPYKernel : public VectorOpKernel { - typedef Real ResultType; + using ResultType = Real; AXPYKernel(size_t veclen, Real a, Real T, @@ -193,8 +193,8 @@ struct AXPYKernel : public VectorOpKernel { }; struct DAXPYKernel : public VectorOpKernel { - typedef double ResultType; - typedef double Real; + using ResultType = double; + using Real = double; DAXPYKernel(size_t veclen, Real a, Real T, @@ -222,7 +222,7 @@ struct DAXPYKernel : public VectorOpKernel { template struct DOTKernel : public VectorOpKernel { - typedef Real ResultType; + using ResultType = Real; DOTKernel(size_t veclen, Real T, std::string label) : VectorOpKernel(veclen, 2, T, label), result_(0) { @@ -250,8 +250,8 @@ struct DOTKernel : public VectorOpKernel { }; struct DDOTKernel : public VectorOpKernel { - typedef double ResultType; - typedef double Real; + using ResultType = double; + using Real = double; DDOTKernel(size_t veclen, Real T, std::string label) : VectorOpKernel(veclen, 2, T, label), result_(0) { @@ -277,8 +277,8 @@ struct DDOTKernel : public VectorOpKernel { }; struct DGEMMKernel : public VectorOpKernel { - typedef double ResultType; - typedef double Real; + using ResultType = double; + using Real = double; DGEMMKernel(size_t n, Real T, std::string label) : VectorOpKernel(n*n, 2, T, label), m_(n), n_(n), k_(n) { @@ -419,7 +419,7 @@ template void profile(const Kernel& k, int nrepeats) { std::cout << "===================== " << k.label() << " ======================" << std::endl; - typedef typename Kernel::ResultType Real; + using Real = typename Kernel::ResultType; timer.clear(); timer.start(0); @@ -451,7 +451,7 @@ void do_chebyshev(int mmax, int nrepeats) { const double scale_unit32_to_T = T_max / std::numeric_limits::max(); if (InterpolationOrder != 7) abort(); - typedef libint2::FmEval_Chebyshev7<> fmeval_t; + using fmeval_t = libint2::FmEval_Chebyshev7<>; fmeval_t fmeval_cheb(mmax); std::cout << "done initialization:" << std::endl; std::fill(Fm_array_sum, Fm_array_sum+mmax+1, 0.0); diff --git a/src/bin/test_eri/generate_eri_code.cc b/src/bin/test_eri/generate_eri_code.cc index 66866e67a..a6e45093b 100644 --- a/src/bin/test_eri/generate_eri_code.cc +++ b/src/bin/test_eri/generate_eri_code.cc @@ -49,7 +49,7 @@ int main (int argc, char* argv[]) namespace { unsigned int am[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; - typedef TwoPRep_11_11_sq ERIQtet; + using ERIQtet = TwoPRep_11_11_sq; int try_main (int argc, char* argv[]) { diff --git a/src/bin/test_eri/test_eri.cc b/src/bin/test_eri/test_eri.cc index c19872fff..f8da36d4f 100644 --- a/src/bin/test_eri/test_eri.cc +++ b/src/bin/test_eri/test_eri.cc @@ -78,7 +78,7 @@ namespace libint2 { }; -typedef unsigned int uint; +using uint = unsigned int; libint2::FmEval_Chebyshev7 fmeval_chebyshev(28); libint2::FmEval_Taylor fmeval_taylor(28, 1e-15); @@ -117,7 +117,7 @@ int main(int argc, char** argv) LIBINT2_REF_REALTYPE Cref[4]; for(int i=0; i<4; ++i) Cref[i] = C[i]; LIBINT2_REF_REALTYPE Dref[4]; for(int i=0; i<4; ++i) Dref[i] = D[i]; - typedef SubIteratorBase iter; + using iter = SubIteratorBase; SafePtr sh0_iter(new iter(sh0)); SafePtr sh1_iter(new iter(sh1)); SafePtr sh2_iter(new iter(sh2)); diff --git a/src/bin/test_eri/test_eri_rys.cc b/src/bin/test_eri/test_eri_rys.cc index edf956377..dcc91df6b 100644 --- a/src/bin/test_eri/test_eri_rys.cc +++ b/src/bin/test_eri/test_eri_rys.cc @@ -44,7 +44,7 @@ int bool_test = 0; #include #include #include -typedef struct { +struct Libint_t { LIBINT2_REALTYPE AB_x[LIBINT2_MAX_VECLEN]; LIBINT2_REALTYPE AB_y[LIBINT2_MAX_VECLEN]; LIBINT2_REALTYPE AB_z[LIBINT2_MAX_VECLEN]; @@ -71,7 +71,7 @@ typedef struct { mutable LIBINT2_UINT_LEAST64* nflops; #endif int contrdepth; -} Libint_t; +}; #endif #include @@ -176,7 +176,7 @@ namespace libint2 { }; }; -typedef unsigned int uint; +using uint = unsigned int; libint2::FmEval_Chebyshev7 fmeval_chebyshev(28); libint2::FmEval_Taylor fmeval_taylor(28, 1e-15); @@ -230,7 +230,7 @@ int main(int argc, char** argv) LIBINT2_REF_REALTYPE Cref[4]; for(int i=0; i<4; ++i) Cref[i] = C[i]; LIBINT2_REF_REALTYPE Dref[4]; for(int i=0; i<4; ++i) Dref[i] = D[i]; - typedef SubIteratorBase iter; + using iter = SubIteratorBase; SafePtr sh0_iter(new iter(sh0)); SafePtr sh1_iter(new iter(sh1)); SafePtr sh2_iter(new iter(sh2)); @@ -346,7 +346,7 @@ int main(int argc, char** argv) // prepare to compute 2-dimensional ints - typedef LIBINT2_REALTYPE real_t; + using real_t = LIBINT2_REALTYPE; Tensor gtg_x{npts,am[0]+1,am[1]+1,am[2]+1,am[3]+1}; Tensor gtg_y{npts,am[0]+1,am[1]+1,am[2]+1,am[3]+1}; Tensor gtg_z{npts,am[0]+1,am[1]+1,am[2]+1,am[3]+1}; diff --git a/src/bin/test_eri/test_eri_rys_vec.cc b/src/bin/test_eri/test_eri_rys_vec.cc index 704e361f0..558d0b562 100644 --- a/src/bin/test_eri/test_eri_rys_vec.cc +++ b/src/bin/test_eri/test_eri_rys_vec.cc @@ -47,7 +47,7 @@ constexpr auto npts = am_tot / 2 + 1; #include #include "../../../../../libint_master/include/libint2/timer.h" -typedef struct { +struct Libint_t { double AB_x[LIBINT2_MAX_VECLEN]; double AB_y[LIBINT2_MAX_VECLEN]; double AB_z[LIBINT2_MAX_VECLEN]; @@ -74,7 +74,7 @@ typedef struct { mutable LIBINT2_UINT_LEAST64* nflops; #endif int contrdepth; -} Libint_t; +}; #endif #include @@ -178,7 +178,7 @@ namespace libint2 { }; }; -typedef unsigned int uint; +using uint = unsigned int; libint2::FmEval_Chebyshev7 fmeval_chebyshev(28); libint2::FmEval_Taylor fmeval_taylor(28, 1e-15); @@ -234,7 +234,7 @@ std::cout<<"number of points"< iter; + using iter = SubIteratorBase; SafePtr sh0_iter(new iter(sh0)); SafePtr sh1_iter(new iter(sh1)); SafePtr sh2_iter(new iter(sh2)); @@ -371,7 +371,7 @@ std::cout<<"number of points"< > gtg_x{1u,am[0]+1,am[1]+1,am[2]+1,am[3]+1}; Tensor< VectorSIMD > gtg_y{1u,am[0]+1,am[1]+1,am[2]+1,am[3]+1}; Tensor< VectorSIMD > gtg_z{1u,am[0]+1,am[1]+1,am[2]+1,am[3]+1}; diff --git a/src/bin/test_eri/time_eri.cc b/src/bin/test_eri/time_eri.cc index a27404947..43871e9dd 100644 --- a/src/bin/test_eri/time_eri.cc +++ b/src/bin/test_eri/time_eri.cc @@ -41,7 +41,7 @@ using namespace std; using namespace libint2; -typedef unsigned int uint; +using uint = unsigned int; libint2::FmEval_Chebyshev7 fmeval_chebyshev(28); libint2::FmEval_Taylor fmeval_taylor(28, 1e-15); @@ -54,7 +54,7 @@ namespace { int main(int argc, char** argv) { - typedef unsigned int uint; + using uint = unsigned int; if (argc != 2) { cerr << usage() << endl; @@ -86,7 +86,7 @@ int main(int argc, char** argv) const double* C = &(rsqset.R[2][0]); const double* D = &(rsqset.R[3][0]); - typedef SubIteratorBase iter; + using iter = SubIteratorBase; SafePtr sh0_iter(new iter(sh0)); SafePtr sh1_iter(new iter(sh1)); SafePtr sh2_iter(new iter(sh2));