Skip to content

Commit 6da1f14

Browse files
committed
change func name
1 parent df73fb2 commit 6da1f14

26 files changed

+111
-111
lines changed

source/source_basis/module_pw/kernels/pw_op.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct set_3d_fft_box_op {
2727

2828
template <typename FPTYPE, typename Device>
2929
struct set_recip_to_real_output_op {
30-
/// @brief Calculate the outputs after the FFT translation of recip_to_real
30+
/// @brief Calculate the outputs after the FFT translation of recip2real_impl
3131
///
3232
/// Input Parameters
3333
/// @param dev - which device this function runs on
@@ -54,7 +54,7 @@ struct set_recip_to_real_output_op {
5454

5555
template <typename FPTYPE, typename Device>
5656
struct set_real_to_recip_output_op {
57-
/// @brief Calculate the outputs after the FFT translation of real_to_recip
57+
/// @brief Calculate the outputs after the FFT translation of real2recip_impl
5858
///
5959
/// Input Parameters
6060
/// @param dev - which device this function runs on

source/source_basis/module_pw/pw_basis.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ class PW_Basis
319319
&& std::is_same<Device, base_device::DEVICE_CPU>::value,
320320
int>::type
321321
= 0>
322-
void recip_to_real(TK* in, TR* out, const bool add = false, const typename GetTypeReal<TK>::type factor = 1.0) const
322+
void recip2real_impl(TK* in, TR* out, const bool add = false, const typename GetTypeReal<TK>::type factor = 1.0) const
323323
{
324324
this->recip2real(in, out, add, factor);
325325
};
@@ -350,7 +350,7 @@ class PW_Basis
350350
&& std::is_same<Device, base_device::DEVICE_GPU>::value,
351351
int>::type
352352
= 0>
353-
void recip_to_real(TK* in,
353+
void recip2real_impl(TK* in,
354354
TR* out,
355355
const bool add = false,
356356
const typename GetTypeReal<TK>::type factor = 1.0) const
@@ -361,7 +361,7 @@ class PW_Basis
361361
// template <typename FPTYPE,
362362
// typename Device,
363363
// typename std::enable_if<!std::is_same<FPTYPE, typename GetTypeReal<FPTYPE>::type>::value, int>::type = 0>
364-
// void recip_to_real(FPTYPE* in,
364+
// void recip2real_impl(FPTYPE* in,
365365
// FPTYPE* out,
366366
// const bool add = false,
367367
// const typename GetTypeReal<FPTYPE>::type factor = 1.0) const;
@@ -391,7 +391,7 @@ class PW_Basis
391391
typename std::enable_if<!std::is_same<TK, typename GetTypeReal<TK>::type>::value
392392
&& (std::is_same<TR, typename GetTypeReal<TK>::type>::value || std::is_same<TR, TK>::value)
393393
&& std::is_same<Device, base_device::DEVICE_CPU>::value ,int>::type = 0>
394-
void real_to_recip(TR* in,
394+
void real2recip_impl(TR* in,
395395
TK* out,
396396
const bool add = false,
397397
const typename GetTypeReal<TK>::type factor = 1.0) const
@@ -403,7 +403,7 @@ class PW_Basis
403403
typename std::enable_if<!std::is_same<TK, typename GetTypeReal<TK>::type>::value
404404
&& (std::is_same<TR, typename GetTypeReal<TK>::type>::value || std::is_same<TR, TK>::value)
405405
&& std::is_same<Device, base_device::DEVICE_GPU>::value ,int>::type = 0>
406-
void real_to_recip(TR* in,
406+
void real2recip_impl(TR* in,
407407
TK* out,
408408
const bool add = false,
409409
const typename GetTypeReal<TK>::type factor = 1.0) const

source/source_basis/module_pw/pw_basis_k.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,14 @@ class PW_Basis_K : public PW_Basis
162162
#endif
163163

164164
template <typename FPTYPE, typename Device>
165-
void real_to_recip(const Device* ctx,
165+
void real2recip_impl(const Device* ctx,
166166
const std::complex<FPTYPE>* in,
167167
std::complex<FPTYPE>* out,
168168
const int ik,
169169
const bool add = false,
170170
const FPTYPE factor = 1.0) const; // in:(nplane,nx*ny) ; out(nz, ns)
171171
template <typename FPTYPE, typename Device>
172-
void recip_to_real(const Device* ctx,
172+
void recip2real_impl(const Device* ctx,
173173
const std::complex<FPTYPE>* in,
174174
std::complex<FPTYPE>* out,
175175
const int ik,
@@ -180,7 +180,7 @@ class PW_Basis_K : public PW_Basis
180180
template <typename TK,
181181
typename Device,
182182
typename std::enable_if<std::is_same<Device, base_device::DEVICE_CPU>::value, int>::type = 0>
183-
void real_to_recip(const TK* in,
183+
void real2recip_impl(const TK* in,
184184
TK* out,
185185
const int ik,
186186
const bool add = false,
@@ -195,7 +195,7 @@ class PW_Basis_K : public PW_Basis
195195
template <typename TK,
196196
typename Device,
197197
typename std::enable_if<std::is_same<Device, base_device::DEVICE_CPU>::value, int>::type = 0>
198-
void recip_to_real(const TK* in,
198+
void recip2real_impl(const TK* in,
199199
TK* out,
200200
const int ik,
201201
const bool add = false,
@@ -225,7 +225,7 @@ class PW_Basis_K : public PW_Basis
225225
template <typename FPTYPE,
226226
typename Device,
227227
typename std::enable_if<!std::is_same<Device, base_device::DEVICE_CPU>::value, int>::type = 0>
228-
void real_to_recip(const FPTYPE* in,
228+
void real2recip_impl(const FPTYPE* in,
229229
FPTYPE* out,
230230
const int ik,
231231
const bool add = false,
@@ -237,7 +237,7 @@ class PW_Basis_K : public PW_Basis
237237
template <typename TK,
238238
typename Device,
239239
typename std::enable_if<std::is_same<Device, base_device::DEVICE_GPU>::value, int>::type = 0>
240-
void recip_to_real(const TK* in,
240+
void recip2real_impl(const TK* in,
241241
TK* out,
242242
const int ik,
243243
const bool add = false,

source/source_basis/module_pw/pw_transform_gpu.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace ModulePW
77
template <typename FPTYPE>
88
void PW_Basis::real2recip_gpu(const FPTYPE* in, std::complex<FPTYPE>* out, const bool add, const FPTYPE factor) const
99
{
10-
ModuleBase::timer::tick(this->classname, "real_to_recip gpu");
10+
ModuleBase::timer::tick(this->classname, "real2recip_impl gpu");
1111
assert(this->poolnproc == 1);
1212
const size_t size = this->nrxx;
1313
base_device::memory::cast_memory_op<std::complex<FPTYPE>, FPTYPE,base_device::DEVICE_GPU, base_device::DEVICE_GPU>()(
@@ -25,15 +25,15 @@ void PW_Basis::real2recip_gpu(const FPTYPE* in, std::complex<FPTYPE>* out, const
2525
this->ig2ixyz_gpu,
2626
this->fft_bundle.get_auxr_3d_data<FPTYPE>(),
2727
out);
28-
ModuleBase::timer::tick(this->classname, "real_to_recip gpu");
28+
ModuleBase::timer::tick(this->classname, "real2recip_impl gpu");
2929
}
3030
template <typename FPTYPE>
3131
void PW_Basis::real2recip_gpu(const std::complex<FPTYPE>* in,
3232
std::complex<FPTYPE>* out,
3333
const bool add,
3434
const FPTYPE factor) const
3535
{
36-
ModuleBase::timer::tick(this->classname, "real_to_recip gpu");
36+
ModuleBase::timer::tick(this->classname, "real2recip_impl gpu");
3737
assert(this->poolnproc == 1);
3838
base_device::memory::synchronize_memory_op<std::complex<FPTYPE>,
3939
base_device::DEVICE_GPU,
@@ -50,13 +50,13 @@ void PW_Basis::real2recip_gpu(const std::complex<FPTYPE>* in,
5050
this->ig2ixyz_gpu,
5151
this->fft_bundle.get_auxr_3d_data<FPTYPE>(),
5252
out);
53-
ModuleBase::timer::tick(this->classname, "real_to_recip gpu");
53+
ModuleBase::timer::tick(this->classname, "real2recip_impl gpu");
5454
}
5555

5656
template <typename FPTYPE>
5757
void PW_Basis::recip2real_gpu(const std::complex<FPTYPE>* in, FPTYPE* out, const bool add, const FPTYPE factor) const
5858
{
59-
ModuleBase::timer::tick(this->classname, "recip_to_real gpu");
59+
ModuleBase::timer::tick(this->classname, "recip2real_impl gpu");
6060
assert(this->poolnproc == 1);
6161
// ModuleBase::GlobalFunc::ZEROS(fft_bundle.get_auxr_3d_data<FPTYPE>(), this->nxyz);
6262
base_device::memory::set_memory_op<std::complex<FPTYPE>, base_device::DEVICE_GPU>()(
@@ -76,15 +76,15 @@ void PW_Basis::recip2real_gpu(const std::complex<FPTYPE>* in, FPTYPE* out, const
7676
this->fft_bundle.get_auxr_3d_data<FPTYPE>(),
7777
out);
7878

79-
ModuleBase::timer::tick(this->classname, "recip_to_real gpu");
79+
ModuleBase::timer::tick(this->classname, "recip2real_impl gpu");
8080
}
8181
template <typename FPTYPE>
8282
void PW_Basis::recip2real_gpu(const std::complex<FPTYPE>* in,
8383
std::complex<FPTYPE>* out,
8484
const bool add,
8585
const FPTYPE factor) const
8686
{
87-
ModuleBase::timer::tick(this->classname, "recip_to_real gpu");
87+
ModuleBase::timer::tick(this->classname, "recip2real_impl gpu");
8888
assert(this->poolnproc == 1);
8989
// ModuleBase::GlobalFunc::ZEROS(fft_bundle.get_auxr_3d_data<double>(), this->nxyz);
9090
base_device::memory::set_memory_op<std::complex<FPTYPE>, base_device::DEVICE_GPU>()(
@@ -105,7 +105,7 @@ void PW_Basis::recip2real_gpu(const std::complex<FPTYPE>* in,
105105
this->fft_bundle.get_auxr_3d_data<FPTYPE>(),
106106
out);
107107

108-
ModuleBase::timer::tick(this->classname, "recip_to_real gpu");
108+
ModuleBase::timer::tick(this->classname, "recip2real_impl gpu");
109109
}
110110
template void PW_Basis::real2recip_gpu<double>(const double* in,
111111
std::complex<double>* out,

source/source_basis/module_pw/pw_transform_k.cpp

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ void PW_Basis_K::recip2real(const std::complex<FPTYPE>* in,
289289
}
290290

291291
template <>
292-
void PW_Basis_K::real_to_recip(const base_device::DEVICE_CPU* /*dev*/,
292+
void PW_Basis_K::real2recip_impl(const base_device::DEVICE_CPU* /*dev*/,
293293
const std::complex<float>* in,
294294
std::complex<float>* out,
295295
const int ik,
@@ -299,7 +299,7 @@ void PW_Basis_K::real_to_recip(const base_device::DEVICE_CPU* /*dev*/,
299299
this->real2recip(in, out, ik, add, factor);
300300
}
301301
template <>
302-
void PW_Basis_K::real_to_recip(const base_device::DEVICE_CPU* /*dev*/,
302+
void PW_Basis_K::real2recip_impl(const base_device::DEVICE_CPU* /*dev*/,
303303
const std::complex<double>* in,
304304
std::complex<double>* out,
305305
const int ik,
@@ -314,7 +314,7 @@ void PW_Basis_K::real_to_recip(const base_device::DEVICE_CPU* /*dev*/,
314314
}
315315

316316
template <>
317-
void PW_Basis_K::recip_to_real(const base_device::DEVICE_CPU* /*dev*/,
317+
void PW_Basis_K::recip2real_impl(const base_device::DEVICE_CPU* /*dev*/,
318318
const std::complex<float>* in,
319319
std::complex<float>* out,
320320
const int ik,
@@ -324,7 +324,7 @@ void PW_Basis_K::recip_to_real(const base_device::DEVICE_CPU* /*dev*/,
324324
this->recip2real(in, out, ik, add, factor);
325325
}
326326
template <>
327-
void PW_Basis_K::recip_to_real(const base_device::DEVICE_CPU* /*dev*/,
327+
void PW_Basis_K::recip2real_impl(const base_device::DEVICE_CPU* /*dev*/,
328328
const std::complex<double>* in,
329329
std::complex<double>* out,
330330
const int ik,
@@ -340,14 +340,14 @@ void PW_Basis_K::recip_to_real(const base_device::DEVICE_CPU* /*dev*/,
340340

341341
#if (defined(__CUDA) || defined(__ROCM))
342342
template <>
343-
void PW_Basis_K::real_to_recip(const base_device::DEVICE_GPU* ctx,
343+
void PW_Basis_K::real2recip_impl(const base_device::DEVICE_GPU* ctx,
344344
const std::complex<float>* in,
345345
std::complex<float>* out,
346346
const int ik,
347347
const bool add,
348348
const float factor) const
349349
{
350-
ModuleBase::timer::tick(this->classname, "real_to_recip gpu");
350+
ModuleBase::timer::tick(this->classname, "real2recip_impl gpu");
351351
assert(this->gamma_only == false);
352352
assert(this->poolnproc == 1);
353353

@@ -367,17 +367,17 @@ void PW_Basis_K::real_to_recip(const base_device::DEVICE_GPU* ctx,
367367
this->ig2ixyz_k + startig,
368368
this->fft_bundle.get_auxr_3d_data<float>(),
369369
out);
370-
ModuleBase::timer::tick(this->classname, "real_to_recip gpu");
370+
ModuleBase::timer::tick(this->classname, "real2recip_impl gpu");
371371
}
372372
template <>
373-
void PW_Basis_K::real_to_recip(const base_device::DEVICE_GPU* ctx,
373+
void PW_Basis_K::real2recip_impl(const base_device::DEVICE_GPU* ctx,
374374
const std::complex<double>* in,
375375
std::complex<double>* out,
376376
const int ik,
377377
const bool add,
378378
const double factor) const
379379
{
380-
ModuleBase::timer::tick(this->classname, "real_to_recip gpu");
380+
ModuleBase::timer::tick(this->classname, "real2recip_impl gpu");
381381
assert(this->gamma_only == false);
382382
assert(this->poolnproc == 1);
383383

@@ -398,18 +398,18 @@ void PW_Basis_K::real_to_recip(const base_device::DEVICE_GPU* ctx,
398398
this->ig2ixyz_k + startig,
399399
this->fft_bundle.get_auxr_3d_data<double>(),
400400
out);
401-
ModuleBase::timer::tick(this->classname, "real_to_recip gpu");
401+
ModuleBase::timer::tick(this->classname, "real2recip_impl gpu");
402402
}
403403

404404
template <>
405-
void PW_Basis_K::recip_to_real(const base_device::DEVICE_GPU* ctx,
405+
void PW_Basis_K::recip2real_impl(const base_device::DEVICE_GPU* ctx,
406406
const std::complex<float>* in,
407407
std::complex<float>* out,
408408
const int ik,
409409
const bool add,
410410
const float factor) const
411411
{
412-
ModuleBase::timer::tick(this->classname, "recip_to_real gpu");
412+
ModuleBase::timer::tick(this->classname, "recip2real_impl gpu");
413413
assert(this->gamma_only == false);
414414
assert(this->poolnproc == 1);
415415
// ModuleBase::GlobalFunc::ZEROS(fft_bundle.get_auxr_3d_data<float>(), this->nxyz);
@@ -433,17 +433,17 @@ void PW_Basis_K::recip_to_real(const base_device::DEVICE_GPU* ctx,
433433
this->fft_bundle.get_auxr_3d_data<float>(),
434434
out);
435435

436-
ModuleBase::timer::tick(this->classname, "recip_to_real gpu");
436+
ModuleBase::timer::tick(this->classname, "recip2real_impl gpu");
437437
}
438438
template <>
439-
void PW_Basis_K::recip_to_real(const base_device::DEVICE_GPU* ctx,
439+
void PW_Basis_K::recip2real_impl(const base_device::DEVICE_GPU* ctx,
440440
const std::complex<double>* in,
441441
std::complex<double>* out,
442442
const int ik,
443443
const bool add,
444444
const double factor) const
445445
{
446-
ModuleBase::timer::tick(this->classname, "recip_to_real gpu");
446+
ModuleBase::timer::tick(this->classname, "recip2real_impl gpu");
447447
assert(this->gamma_only == false);
448448
assert(this->poolnproc == 1);
449449
// ModuleBase::GlobalFunc::ZEROS(fft_bundle.get_auxr_3d_data<double>(), this->nxyz);
@@ -467,7 +467,7 @@ void PW_Basis_K::recip_to_real(const base_device::DEVICE_GPU* ctx,
467467
this->fft_bundle.get_auxr_3d_data<double>(),
468468
out);
469469

470-
ModuleBase::timer::tick(this->classname, "recip_to_real gpu");
470+
ModuleBase::timer::tick(this->classname, "recip2real_impl gpu");
471471
}
472472

473473
template <typename FPTYPE>
@@ -477,7 +477,7 @@ void PW_Basis_K::real2recip_gpu(const std::complex<FPTYPE>* in,
477477
const bool add,
478478
const FPTYPE factor) const
479479
{
480-
ModuleBase::timer::tick(this->classname, "real_to_recip gpu");
480+
ModuleBase::timer::tick(this->classname, "real2recip_impl gpu");
481481
assert(this->gamma_only == false);
482482
assert(this->poolnproc == 1);
483483

@@ -498,7 +498,7 @@ void PW_Basis_K::real2recip_gpu(const std::complex<FPTYPE>* in,
498498
this->ig2ixyz_k + startig,
499499
this->fft_bundle.get_auxr_3d_data<FPTYPE>(),
500500
out);
501-
ModuleBase::timer::tick(this->classname, "real_to_recip gpu");
501+
ModuleBase::timer::tick(this->classname, "real2recip_impl gpu");
502502
}
503503
template <typename FPTYPE>
504504
void PW_Basis_K::recip2real_gpu(const std::complex<FPTYPE>* in,
@@ -507,7 +507,7 @@ void PW_Basis_K::recip2real_gpu(const std::complex<FPTYPE>* in,
507507
const bool add,
508508
const FPTYPE factor) const
509509
{
510-
ModuleBase::timer::tick(this->classname, "recip_to_real gpu");
510+
ModuleBase::timer::tick(this->classname, "recip2real_impl gpu");
511511
assert(this->gamma_only == false);
512512
assert(this->poolnproc == 1);
513513
// ModuleBase::GlobalFunc::ZEROS(fft_bundle.get_auxr_3d_data<FPTYPE>(), this->nxyz);
@@ -531,7 +531,7 @@ void PW_Basis_K::recip2real_gpu(const std::complex<FPTYPE>* in,
531531
this->fft_bundle.get_auxr_3d_data<FPTYPE>(),
532532
out);
533533

534-
ModuleBase::timer::tick(this->classname, "recip_to_real gpu");
534+
ModuleBase::timer::tick(this->classname, "recip2real_impl gpu");
535535
}
536536

537537
template void PW_Basis_K::real2recip_gpu<float>(const std::complex<float>*,

source/source_basis/module_pw/test_gpu/pw_basis_C2C.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,10 @@ class PW_BASIS_K_GPU_TEST : public ::testing::Test
167167

168168
h_rhor = new complex<T>[nrxx];
169169

170-
pwtest.recip_to_real<std::complex<T>, std::complex<T>,base_device::DEVICE_GPU>(d_rhog, d_rhor);
170+
pwtest.recip2real_impl<std::complex<T>, std::complex<T>,base_device::DEVICE_GPU>(d_rhog, d_rhor);
171171
cudaMemcpy(h_rhor, d_rhor, nrxx * sizeof(complex<T>), cudaMemcpyDeviceToHost);
172172

173-
pwtest.real_to_recip<std::complex<T>, std::complex<T>,base_device::DEVICE_GPU>(d_rhor, d_rhog);
173+
pwtest.real2recip_impl<std::complex<T>, std::complex<T>,base_device::DEVICE_GPU>(d_rhor, d_rhog);
174174
cudaMemcpy(h_rhogout, d_rhog, npw * sizeof(complex<T>), cudaMemcpyDeviceToHost);
175175
}
176176
}

source/source_basis/module_pw/test_gpu/pw_basis_C2R.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,10 @@ class PW_BASIS_C2R_GPU_TEST : public ::testing::Test
154154
h_rhor = new T[nrxx];
155155

156156
cudaMalloc((void**)&d_rhor, nrxx * sizeof(T));
157-
pwtest.recip_to_real<std::complex<T>, T, base_device::DEVICE_GPU>(d_rhog, d_rhor);
157+
pwtest.recip2real_impl<std::complex<T>, T, base_device::DEVICE_GPU>(d_rhog, d_rhor);
158158
cudaMemcpy(h_rhor, d_rhor, nrxx * sizeof(T), cudaMemcpyDeviceToHost);
159159

160-
pwtest.real_to_recip<T,std::complex<T>,base_device::DEVICE_GPU>(d_rhor,d_rhog);
160+
pwtest.real2recip_impl<T,std::complex<T>,base_device::DEVICE_GPU>(d_rhor,d_rhog);
161161
cudaMemcpy(h_rhogout,d_rhog,npw * sizeof(complex<T>),cudaMemcpyDeviceToHost);
162162

163163

0 commit comments

Comments
 (0)