Skip to content

Commit

Permalink
src/bin/libint/task.cc
Browse files Browse the repository at this point in the history
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
  • Loading branch information
e-kwsm committed Oct 31, 2023
1 parent 8a5c7b1 commit ebb8677
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 50 deletions.
10 changes: 5 additions & 5 deletions src/bin/libint/task.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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) {
Expand All @@ -132,15 +132,15 @@ 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());
}

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);
Expand Down
26 changes: 13 additions & 13 deletions src/bin/libint/test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<Descriptor> oper(descr);
SafePtr<Integral> i = Integral::Instance(f1,f2,f3,f4,m,oper);
descr_label += i->label();
Expand Down Expand Up @@ -316,32 +316,32 @@ namespace {
CGShell csh_q(12u);

{
typedef TwoPRep_11_11_sq IType;
using IType = TwoPRep_11_11_sq;
SafePtr<IType> 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<IType> 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<IType> 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<IType> 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<IType> 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<IType> iset = IType::Instance(csh_q,csh_q,csh_q,csh_q,0u);
std::cout << "Created integral set " << iset->label() << " key = " << iset->key() << std::endl;
}
Expand All @@ -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<IType> iset = IType::Instance(sh_p,sh_p,sh_p,sh_p,0u);
SafePtr<RRType> 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<IType> iset = IType::Instance(sh_p,sh_p,sh_p,sh_p,0u);
SafePtr<RRType> 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<IType> iset = IType::Instance(sh_p,sh_p,sh_p,sh_p,0u,DivG12prime_xTx_Descr(0));
SafePtr<RRType> rr = RRType::Instance(iset,0);
std::cout << "Created recurrence relation " << rr->label() << std::endl;
Expand Down
6 changes: 3 additions & 3 deletions src/bin/profile/chrono.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@

int main (int argc, char* argv[])
{
typedef std::chrono::high_resolution_clock clock_t;
typedef std::chrono::time_point<clock_t> time_point_t;
using clock_t = std::chrono::high_resolution_clock;
using time_point_t = std::chrono::time_point<clock_t>;

std::cout << "WARNING: turn off turboboost for reliable profiling" << std::endl;

Expand All @@ -42,7 +42,7 @@ int main (int argc, char* argv[])
asm("nop");
}
auto tstop = clock_t::now();
typedef std::chrono::duration<double> dur_t;
using dur_t = std::chrono::duration<double>;
const dur_t d0 = tstop - tstart;
std::cout << "nop took " << std::setprecision(15) << d0.count()*1e9/nrepeats << " nanoseconds" << std::endl;

Expand Down
2 changes: 1 addition & 1 deletion src/bin/profile/generate_t0g12_code.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<CGShell,0> IntegralSet;
using IntegralSet = TiG12_11_11<CGShell,0>;

int try_main (int argc, char* argv[])
{
Expand Down
24 changes: 12 additions & 12 deletions src/bin/profile/profile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

#ifndef SKIP_AXPY
# include <mkl_cblas.h>
typedef MKL_INT BLAS_INT;
using BLAS_INT = MKL_INT;
#endif

#ifdef SKIP_ALL
Expand Down Expand Up @@ -108,7 +108,7 @@ void do_stg(int mmax, double T, double U, int nrepeats);

template <typename Real, Real (Function)(Real) >
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_; }
Expand Down Expand Up @@ -164,7 +164,7 @@ struct VectorOpKernel {

template <typename Real>
struct AXPYKernel : public VectorOpKernel<Real> {
typedef Real ResultType;
using ResultType = Real;
AXPYKernel(size_t veclen,
Real a,
Real T,
Expand Down Expand Up @@ -193,8 +193,8 @@ struct AXPYKernel : public VectorOpKernel<Real> {
};

struct DAXPYKernel : public VectorOpKernel<double> {
typedef double ResultType;
typedef double Real;
using ResultType = double;
using Real = double;
DAXPYKernel(size_t veclen,
Real a,
Real T,
Expand Down Expand Up @@ -222,7 +222,7 @@ struct DAXPYKernel : public VectorOpKernel<double> {

template <typename Real>
struct DOTKernel : public VectorOpKernel<Real> {
typedef Real ResultType;
using ResultType = Real;
DOTKernel(size_t veclen,
Real T,
std::string label) : VectorOpKernel<Real>(veclen, 2, T, label), result_(0) {
Expand Down Expand Up @@ -250,8 +250,8 @@ struct DOTKernel : public VectorOpKernel<Real> {
};

struct DDOTKernel : public VectorOpKernel<double> {
typedef double ResultType;
typedef double Real;
using ResultType = double;
using Real = double;
DDOTKernel(size_t veclen,
Real T,
std::string label) : VectorOpKernel<Real>(veclen, 2, T, label), result_(0) {
Expand All @@ -277,8 +277,8 @@ struct DDOTKernel : public VectorOpKernel<double> {
};

struct DGEMMKernel : public VectorOpKernel<double> {
typedef double ResultType;
typedef double Real;
using ResultType = double;
using Real = double;
DGEMMKernel(size_t n,
Real T,
std::string label) : VectorOpKernel<Real>(n*n, 2, T, label), m_(n), n_(n), k_(n) {
Expand Down Expand Up @@ -419,7 +419,7 @@ template <typename Kernel>
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);
Expand Down Expand Up @@ -451,7 +451,7 @@ void do_chebyshev(int mmax, int nrepeats) {
const double scale_unit32_to_T = T_max / std::numeric_limits<uint32_t>::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);
Expand Down
2 changes: 1 addition & 1 deletion src/bin/test_eri/generate_eri_code.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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[])
{
Expand Down
4 changes: 2 additions & 2 deletions src/bin/test_eri/test_eri.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ namespace libint2 {

};

typedef unsigned int uint;
using uint = unsigned int;

libint2::FmEval_Chebyshev7<double> fmeval_chebyshev(28);
libint2::FmEval_Taylor<double,6> fmeval_taylor(28, 1e-15);
Expand Down Expand Up @@ -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<CGShell> iter;
using iter = SubIteratorBase<CGShell>;
SafePtr<iter> sh0_iter(new iter(sh0));
SafePtr<iter> sh1_iter(new iter(sh1));
SafePtr<iter> sh2_iter(new iter(sh2));
Expand Down
10 changes: 5 additions & 5 deletions src/bin/test_eri/test_eri_rys.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ int bool_test = 0;
#include <libint2/util/memory.h>
#include <libint2/util/intrinsic_operations.h>
#include <libint2/util/timer.h>
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];
Expand All @@ -71,7 +71,7 @@ typedef struct {
mutable LIBINT2_UINT_LEAST64* nflops;
#endif
int contrdepth;
} Libint_t;
};
#endif

#include <VRR_GTG_1d_xx_xx.h>
Expand Down Expand Up @@ -176,7 +176,7 @@ namespace libint2 {
};
};

typedef unsigned int uint;
using uint = unsigned int;

libint2::FmEval_Chebyshev7<double> fmeval_chebyshev(28);
libint2::FmEval_Taylor<double,7> fmeval_taylor(28, 1e-15);
Expand Down Expand Up @@ -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<CGShell> iter;
using iter = SubIteratorBase<CGShell>;
SafePtr<iter> sh0_iter(new iter(sh0));
SafePtr<iter> sh1_iter(new iter(sh1));
SafePtr<iter> sh2_iter(new iter(sh2));
Expand Down Expand Up @@ -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<real_t> gtg_x{npts,am[0]+1,am[1]+1,am[2]+1,am[3]+1};
Tensor<real_t> gtg_y{npts,am[0]+1,am[1]+1,am[2]+1,am[3]+1};
Tensor<real_t> gtg_z{npts,am[0]+1,am[1]+1,am[2]+1,am[3]+1};
Expand Down
10 changes: 5 additions & 5 deletions src/bin/test_eri/test_eri_rys_vec.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ constexpr auto npts = am_tot / 2 + 1;
#include <libint2/util/intrinsic_operations.h>
#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];
Expand All @@ -74,7 +74,7 @@ typedef struct {
mutable LIBINT2_UINT_LEAST64* nflops;
#endif
int contrdepth;
} Libint_t;
};
#endif

#include <VRR_GTG_1d_xx_xx_vec.h>
Expand Down Expand Up @@ -178,7 +178,7 @@ namespace libint2 {
};
};

typedef unsigned int uint;
using uint = unsigned int;

libint2::FmEval_Chebyshev7<double> fmeval_chebyshev(28);
libint2::FmEval_Taylor<double,7> fmeval_taylor(28, 1e-15);
Expand Down Expand Up @@ -234,7 +234,7 @@ std::cout<<"number of points"<<npts<<endl;
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<CGShell> iter;
using iter = SubIteratorBase<CGShell>;
SafePtr<iter> sh0_iter(new iter(sh0));
SafePtr<iter> sh1_iter(new iter(sh1));
SafePtr<iter> sh2_iter(new iter(sh2));
Expand Down Expand Up @@ -371,7 +371,7 @@ std::cout<<"number of points"<<npts<<endl;


// prepare to compute 2-dimensional ints
typedef LIBINT2_REALTYPE real_t;
using real_t = LIBINT2_REALTYPE;
Tensor< VectorSIMD<double,npts> > gtg_x{1u,am[0]+1,am[1]+1,am[2]+1,am[3]+1};
Tensor< VectorSIMD<double,npts> > gtg_y{1u,am[0]+1,am[1]+1,am[2]+1,am[3]+1};
Tensor< VectorSIMD<double,npts> > gtg_z{1u,am[0]+1,am[1]+1,am[2]+1,am[3]+1};
Expand Down
6 changes: 3 additions & 3 deletions src/bin/test_eri/time_eri.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
using namespace std;
using namespace libint2;

typedef unsigned int uint;
using uint = unsigned int;

libint2::FmEval_Chebyshev7<double> fmeval_chebyshev(28);
libint2::FmEval_Taylor<double,6> fmeval_taylor(28, 1e-15);
Expand All @@ -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;
Expand Down Expand Up @@ -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<CGShell> iter;
using iter = SubIteratorBase<CGShell>;
SafePtr<iter> sh0_iter(new iter(sh0));
SafePtr<iter> sh1_iter(new iter(sh1));
SafePtr<iter> sh2_iter(new iter(sh2));
Expand Down

0 comments on commit ebb8677

Please sign in to comment.