Skip to content

Commit b96bb77

Browse files
committed
remove ctx in the file
1 parent 926f608 commit b96bb77

File tree

7 files changed

+37
-75
lines changed

7 files changed

+37
-75
lines changed

source/module_basis/module_pw/kernels/cuda/pw_op.cu

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ __global__ void set_real_to_recip_output(
100100
}
101101

102102
template <typename FPTYPE>
103-
void set_3d_fft_box_op<FPTYPE, base_device::DEVICE_GPU>::operator()(const base_device::DEVICE_GPU* /*dev*/,
104-
const int npwk,
103+
void set_3d_fft_box_op<FPTYPE, base_device::DEVICE_GPU>::operator()(const int npwk,
105104
const int* box_index,
106105
const std::complex<FPTYPE>* in,
107106
std::complex<FPTYPE>* out)
@@ -117,8 +116,7 @@ void set_3d_fft_box_op<FPTYPE, base_device::DEVICE_GPU>::operator()(const base_d
117116
}
118117

119118
template <typename FPTYPE>
120-
void set_recip_to_real_output_op<FPTYPE, base_device::DEVICE_GPU>::operator()(const base_device::DEVICE_GPU* /*dev*/,
121-
const int nrxx,
119+
void set_recip_to_real_output_op<FPTYPE, base_device::DEVICE_GPU>::operator()(const int nrxx,
122120
const bool add,
123121
const FPTYPE factor,
124122
const std::complex<FPTYPE>* in,
@@ -136,8 +134,7 @@ void set_recip_to_real_output_op<FPTYPE, base_device::DEVICE_GPU>::operator()(co
136134
}
137135

138136
template <typename FPTYPE>
139-
void set_recip_to_real_output_op<FPTYPE, base_device::DEVICE_GPU>::operator()(const base_device::DEVICE_GPU* /*dev*/,
140-
const int nrxx,
137+
void set_recip_to_real_output_op<FPTYPE, base_device::DEVICE_GPU>::operator()(const int nrxx,
141138
const bool add,
142139
const FPTYPE factor,
143140
const std::complex<FPTYPE>* in,
@@ -155,8 +152,7 @@ void set_recip_to_real_output_op<FPTYPE, base_device::DEVICE_GPU>::operator()(co
155152
}
156153

157154
template <typename FPTYPE>
158-
void set_real_to_recip_output_op<FPTYPE, base_device::DEVICE_GPU>::operator()(const base_device::DEVICE_GPU* /*dev*/,
159-
const int npwk,
155+
void set_real_to_recip_output_op<FPTYPE, base_device::DEVICE_GPU>::operator()(const int npwk,
160156
const int nxyz,
161157
const bool add,
162158
const FPTYPE factor,
@@ -178,8 +174,7 @@ void set_real_to_recip_output_op<FPTYPE, base_device::DEVICE_GPU>::operator()(co
178174
}
179175

180176
template <typename FPTYPE>
181-
void set_real_to_recip_output_op<FPTYPE, base_device::DEVICE_GPU>::operator()(const base_device::DEVICE_GPU* /*dev*/,
182-
const int npwk,
177+
void set_real_to_recip_output_op<FPTYPE, base_device::DEVICE_GPU>::operator()(const int npwk,
183178
const int nxyz,
184179
const bool add,
185180
const FPTYPE factor,

source/module_basis/module_pw/kernels/pw_op.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ namespace ModulePW {
55
template <typename FPTYPE>
66
struct set_3d_fft_box_op<FPTYPE, base_device::DEVICE_CPU>
77
{
8-
void operator()(const base_device::DEVICE_CPU* /*dev*/,
9-
const int npwk,
8+
void operator()(const int npwk,
109
const int* box_index,
1110
const std::complex<FPTYPE>* in,
1211
std::complex<FPTYPE>* out)
@@ -21,8 +20,7 @@ struct set_3d_fft_box_op<FPTYPE, base_device::DEVICE_CPU>
2120
template <typename FPTYPE>
2221
struct set_recip_to_real_output_op<FPTYPE, base_device::DEVICE_CPU>
2322
{
24-
void operator()(const base_device::DEVICE_CPU* /*dev*/,
25-
const int nrxx,
23+
void operator()(const int nrxx,
2624
const bool add,
2725
const FPTYPE factor,
2826
const std::complex<FPTYPE>* in,
@@ -40,8 +38,7 @@ struct set_recip_to_real_output_op<FPTYPE, base_device::DEVICE_CPU>
4038
}
4139
}
4240

43-
void operator()(const base_device::DEVICE_CPU* /*dev*/,
44-
const int nrxx,
41+
void operator()(const int nrxx,
4542
const bool add,
4643
const FPTYPE factor,
4744
const std::complex<FPTYPE>* in,
@@ -67,8 +64,7 @@ struct set_recip_to_real_output_op<FPTYPE, base_device::DEVICE_CPU>
6764
template <typename FPTYPE>
6865
struct set_real_to_recip_output_op<FPTYPE, base_device::DEVICE_CPU>
6966
{
70-
void operator()(const base_device::DEVICE_CPU* /*dev*/,
71-
const int npw_k,
67+
void operator()(const int npw_k,
7268
const int nxyz,
7369
const bool add,
7470
const FPTYPE factor,

source/module_basis/module_pw/kernels/pw_op.h

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ struct set_3d_fft_box_op {
1919
/// Output Parameters
2020
/// @param out - output psi within the 3D box(in recip space)
2121
void operator() (
22-
const Device* dev,
2322
const int npwk,
2423
const int* box_index,
2524
const std::complex<FPTYPE>* in,
@@ -39,15 +38,13 @@ struct set_recip_to_real_output_op {
3938
/// Output Parameters
4039
/// @param out - output psi within the 3D box(in real space)
4140
void operator() (
42-
const Device* dev,
4341
const int nrxx,
4442
const bool add,
4543
const FPTYPE factor,
4644
const std::complex<FPTYPE>* in,
4745
std::complex<FPTYPE>* out);
4846

4947
void operator() (
50-
const Device* dev,
5148
const int nrxx,
5249
const bool add,
5350
const FPTYPE factor,
@@ -70,7 +67,6 @@ struct set_real_to_recip_output_op {
7067
/// Output Parameters
7168
/// @param out - output psi within the 3D box(in recip space)
7269
void operator() (
73-
const Device* dev,
7470
const int npw_k,
7571
const int nxyz,
7672
const bool add,
@@ -80,7 +76,6 @@ struct set_real_to_recip_output_op {
8076
std::complex<FPTYPE>* out);
8177

8278
void operator() (
83-
const Device* dev,
8479
const int npw_k,
8580
const int nxyz,
8681
const bool add,
@@ -95,8 +90,7 @@ struct set_real_to_recip_output_op {
9590
template <typename FPTYPE>
9691
struct set_3d_fft_box_op<FPTYPE, base_device::DEVICE_GPU>
9792
{
98-
void operator()(const base_device::DEVICE_GPU* dev,
99-
const int npwk,
93+
void operator()(const int npwk,
10094
const int* box_index,
10195
const std::complex<FPTYPE>* in,
10296
std::complex<FPTYPE>* out);
@@ -105,15 +99,13 @@ struct set_3d_fft_box_op<FPTYPE, base_device::DEVICE_GPU>
10599
template <typename FPTYPE>
106100
struct set_recip_to_real_output_op<FPTYPE, base_device::DEVICE_GPU>
107101
{
108-
void operator()(const base_device::DEVICE_GPU* dev,
109-
const int nrxx,
102+
void operator()(const int nrxx,
110103
const bool add,
111104
const FPTYPE factor,
112105
const std::complex<FPTYPE>* in,
113106
std::complex<FPTYPE>* out);
114107

115-
void operator()(const base_device::DEVICE_GPU* dev,
116-
const int nrxx,
108+
void operator()(const int nrxx,
117109
const bool add,
118110
const FPTYPE factor,
119111
const std::complex<FPTYPE>* in,
@@ -123,16 +115,14 @@ struct set_recip_to_real_output_op<FPTYPE, base_device::DEVICE_GPU>
123115
template <typename FPTYPE>
124116
struct set_real_to_recip_output_op<FPTYPE, base_device::DEVICE_GPU>
125117
{
126-
void operator()(const base_device::DEVICE_GPU* dev,
127-
const int npw_k,
118+
void operator()(const int npw_k,
128119
const int nxyz,
129120
const bool add,
130121
const FPTYPE factor,
131122
const int* box_index,
132123
const std::complex<FPTYPE>* in,
133124
std::complex<FPTYPE>* out);
134-
void operator()(const base_device::DEVICE_GPU* dev,
135-
const int npw_k,
125+
void operator()(const int npw_k,
136126
const int nxyz,
137127
const bool add,
138128
const FPTYPE factor,

source/module_basis/module_pw/kernels/rocm/pw_op.hip.cu

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,7 @@ __global__ void set_real_to_recip_output(
101101
}
102102

103103
template <typename FPTYPE>
104-
void set_3d_fft_box_op<FPTYPE, base_device::DEVICE_GPU>::operator()(const base_device::DEVICE_GPU* /*dev*/,
105-
const int npwk,
104+
void set_3d_fft_box_op<FPTYPE, base_device::DEVICE_GPU>::operator()(const int npwk,
106105
const int* box_index,
107106
const std::complex<FPTYPE>* in,
108107
std::complex<FPTYPE>* out)
@@ -118,8 +117,7 @@ void set_3d_fft_box_op<FPTYPE, base_device::DEVICE_GPU>::operator()(const base_d
118117
}
119118

120119
template <typename FPTYPE>
121-
void set_recip_to_real_output_op<FPTYPE, base_device::DEVICE_GPU>::operator()(const base_device::DEVICE_GPU* /*dev*/,
122-
const int nrxx,
120+
void set_recip_to_real_output_op<FPTYPE, base_device::DEVICE_GPU>::operator()(const int nrxx,
123121
const bool add,
124122
const FPTYPE factor,
125123
const std::complex<FPTYPE>* in,
@@ -137,8 +135,7 @@ void set_recip_to_real_output_op<FPTYPE, base_device::DEVICE_GPU>::operator()(co
137135
}
138136

139137
template <typename FPTYPE>
140-
void set_recip_to_real_output_op<FPTYPE, base_device::DEVICE_GPU>::operator()(const base_device::DEVICE_GPU* /*dev*/,
141-
const int nrxx,
138+
void set_recip_to_real_output_op<FPTYPE, base_device::DEVICE_GPU>::operator()(const int nrxx,
142139
const bool add,
143140
const FPTYPE factor,
144141
const std::complex<FPTYPE>* in,
@@ -156,8 +153,7 @@ void set_recip_to_real_output_op<FPTYPE, base_device::DEVICE_GPU>::operator()(co
156153
}
157154

158155
template <typename FPTYPE>
159-
void set_real_to_recip_output_op<FPTYPE, base_device::DEVICE_GPU>::operator()(const base_device::DEVICE_GPU* /*dev*/,
160-
const int npwk,
156+
void set_real_to_recip_output_op<FPTYPE, base_device::DEVICE_GPU>::operator()(const int npwk,
161157
const int nxyz,
162158
const bool add,
163159
const FPTYPE factor,
@@ -179,8 +175,7 @@ void set_real_to_recip_output_op<FPTYPE, base_device::DEVICE_GPU>::operator()(co
179175
}
180176

181177
template <typename FPTYPE>
182-
void set_real_to_recip_output_op<FPTYPE, base_device::DEVICE_GPU>::operator()(const base_device::DEVICE_GPU* /*dev*/,
183-
const int npwk,
178+
void set_real_to_recip_output_op<FPTYPE, base_device::DEVICE_GPU>::operator()(const int npwk,
184179
const int nxyz,
185180
const bool add,
186181
const FPTYPE factor,

source/module_basis/module_pw/pw_transform_gpu.cpp

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include "module_basis/module_pw/kernels/pw_op.h"
44
namespace ModulePW
55
{
6-
#if (defined(__CUDA) || defined(__ROCM))
6+
// #if (defined(__CUDA) || defined(__ROCM))
77
template <typename FPTYPE>
88
void PW_Basis::real2recip_gpu(const FPTYPE* in,
99
std::complex<FPTYPE>* out,
@@ -24,8 +24,7 @@ void PW_Basis::real2recip_gpu(const FPTYPE* in,
2424
this->fft_bundle.get_auxr_3d_data<FPTYPE>(),
2525
this->fft_bundle.get_auxr_3d_data<FPTYPE>());
2626

27-
set_real_to_recip_output_op<FPTYPE, base_device::DEVICE_GPU>()(ctx,
28-
npw,
27+
set_real_to_recip_output_op<FPTYPE, base_device::DEVICE_GPU>()(npw,
2928
this->nxyz,
3029
add,
3130
factor,
@@ -54,8 +53,7 @@ void PW_Basis::real2recip_gpu(const std::complex<FPTYPE>* in,
5453
this->fft_bundle.get_auxr_3d_data<FPTYPE>(),
5554
this->fft_bundle.get_auxr_3d_data<FPTYPE>());
5655

57-
set_real_to_recip_output_op<FPTYPE, base_device::DEVICE_GPU>()(ctx,
58-
npw,
56+
set_real_to_recip_output_op<FPTYPE, base_device::DEVICE_GPU>()(npw,
5957
this->nxyz,
6058
add,
6159
factor,
@@ -81,17 +79,15 @@ void PW_Basis::recip2real_gpu(const std::complex<FPTYPE>* in,
8179
0,
8280
this->nxyz);
8381

84-
set_3d_fft_box_op<FPTYPE, base_device::DEVICE_GPU>()(ctx,
85-
npw,
82+
set_3d_fft_box_op<FPTYPE, base_device::DEVICE_GPU>()(npw,
8683
this->ig2isz,
8784
in,
8885
this->fft_bundle.get_auxr_3d_data<FPTYPE>());
8986
this->fft_bundle.fft3D_backward(ctx,
9087
this->fft_bundle.get_auxr_3d_data<FPTYPE>(),
9188
this->fft_bundle.get_auxr_3d_data<FPTYPE>());
9289

93-
set_recip_to_real_output_op<FPTYPE, base_device::DEVICE_GPU>()(ctx,
94-
this->nrxx,
90+
set_recip_to_real_output_op<FPTYPE, base_device::DEVICE_GPU>()(this->nrxx,
9591
add,
9692
factor,
9793
this->fft_bundle.get_auxr_3d_data<FPTYPE>(),
@@ -115,17 +111,15 @@ template <typename FPTYPE>
115111
0,
116112
this->nxyz);
117113

118-
set_3d_fft_box_op<FPTYPE, base_device::DEVICE_GPU>()(ctx,
119-
npw,
114+
set_3d_fft_box_op<FPTYPE, base_device::DEVICE_GPU>()(npw,
120115
this->ig2isz,
121116
in,
122117
this->fft_bundle.get_auxr_3d_data<FPTYPE>());
123118
this->fft_bundle.fft3D_backward(ctx,
124119
this->fft_bundle.get_auxr_3d_data<FPTYPE>(),
125120
this->fft_bundle.get_auxr_3d_data<FPTYPE>());
126121

127-
set_recip_to_real_output_op<FPTYPE, base_device::DEVICE_GPU>()(ctx,
128-
this->nrxx,
122+
set_recip_to_real_output_op<FPTYPE, base_device::DEVICE_GPU>()(this->nrxx,
129123
add,
130124
factor,
131125
this->fft_bundle.get_auxr_3d_data<FPTYPE>(),
@@ -169,5 +163,5 @@ template void PW_Basis::recip2real_gpu<float>(const std::complex<float>* in,
169163
const bool add,
170164
const float factor) const;
171165

172-
#endif
166+
// #endif
173167
} // namespace ModulePW

source/module_basis/module_pw/pw_transform_k.cpp

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,7 @@ void PW_Basis_K::real_to_recip(const base_device::DEVICE_GPU* ctx,
361361

362362
const int startig = ik * this->npwk_max;
363363
const int npw_k = this->npwk[ik];
364-
set_real_to_recip_output_op<float, base_device::DEVICE_GPU>()(ctx,
365-
npw_k,
364+
set_real_to_recip_output_op<float, base_device::DEVICE_GPU>()(npw_k,
366365
this->nxyz,
367366
add,
368367
factor,
@@ -393,8 +392,7 @@ void PW_Basis_K::real_to_recip(const base_device::DEVICE_GPU* ctx,
393392

394393
const int startig = ik * this->npwk_max;
395394
const int npw_k = this->npwk[ik];
396-
set_real_to_recip_output_op<double, base_device::DEVICE_GPU>()(ctx,
397-
npw_k,
395+
set_real_to_recip_output_op<double, base_device::DEVICE_GPU>()(npw_k,
398396
this->nxyz,
399397
add,
400398
factor,
@@ -424,15 +422,13 @@ void PW_Basis_K::recip_to_real(const base_device::DEVICE_GPU* ctx,
424422
const int startig = ik * this->npwk_max;
425423
const int npw_k = this->npwk[ik];
426424

427-
set_3d_fft_box_op<float, base_device::DEVICE_GPU>()(ctx,
428-
npw_k,
425+
set_3d_fft_box_op<float, base_device::DEVICE_GPU>()(npw_k,
429426
this->ig2ixyz_k + startig,
430427
in,
431428
this->fft_bundle.get_auxr_3d_data<float>());
432429
this->fft_bundle.fft3D_backward(ctx, this->fft_bundle.get_auxr_3d_data<float>(), this->fft_bundle.get_auxr_3d_data<float>());
433430

434-
set_recip_to_real_output_op<float, base_device::DEVICE_GPU>()(ctx,
435-
this->nrxx,
431+
set_recip_to_real_output_op<float, base_device::DEVICE_GPU>()(this->nrxx,
436432
add,
437433
factor,
438434
this->fft_bundle.get_auxr_3d_data<float>(),
@@ -460,15 +456,13 @@ void PW_Basis_K::recip_to_real(const base_device::DEVICE_GPU* ctx,
460456
const int startig = ik * this->npwk_max;
461457
const int npw_k = this->npwk[ik];
462458

463-
set_3d_fft_box_op<double, base_device::DEVICE_GPU>()(ctx,
464-
npw_k,
459+
set_3d_fft_box_op<double, base_device::DEVICE_GPU>()(npw_k,
465460
this->ig2ixyz_k + startig,
466461
in,
467462
this->fft_bundle.get_auxr_3d_data<double>());
468463
this->fft_bundle.fft3D_backward(ctx, this->fft_bundle.get_auxr_3d_data<double>(), this->fft_bundle.get_auxr_3d_data<double>());
469464

470-
set_recip_to_real_output_op<double, base_device::DEVICE_GPU>()(ctx,
471-
this->nrxx,
465+
set_recip_to_real_output_op<double, base_device::DEVICE_GPU>()(this->nrxx,
472466
add,
473467
factor,
474468
this->fft_bundle.get_auxr_3d_data<double>(),

0 commit comments

Comments
 (0)