Skip to content

Commit 7f7583a

Browse files
committed
Fix dot_complex_wrapper bug
1 parent 937eb35 commit 7f7583a

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

source/module_base/kernels/cuda/math_kernel_op.cu

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -467,8 +467,7 @@ double dot_real_op<double, base_device::DEVICE_GPU>::operator()(const int& dim,
467467
// https://thrust.github.io/doc/group__transformed__reductions_ga321192d85c5f510e52300ae762c7e995.html denghui modify
468468
// 2022-10-03 Note that ddot_(2*dim,a,1,b,1) = REAL( zdotc_(dim,a,1,b,1) ) GPU specialization of actual computation.
469469
template <typename FPTYPE>
470-
inline FPTYPE dot_complex_wrapper(const base_device::DEVICE_GPU* d,
471-
const int& dim,
470+
inline FPTYPE dot_complex_wrapper(const int& dim,
472471
const std::complex<FPTYPE>* psi_L,
473472
const std::complex<FPTYPE>* psi_R,
474473
const bool reduce)
@@ -492,15 +491,15 @@ float dot_real_op<std::complex<float>, base_device::DEVICE_GPU>::operator()(cons
492491
const std::complex<float>* psi_R,
493492
const bool reduce)
494493
{
495-
return dot_complex_wrapper(d, dim, psi_L, psi_R, reduce);
494+
return dot_complex_wrapper(dim, psi_L, psi_R, reduce);
496495
}
497496
template <>
498497
double dot_real_op<std::complex<double>, base_device::DEVICE_GPU>::operator()(const int& dim,
499498
const std::complex<double>* psi_L,
500499
const std::complex<double>* psi_R,
501500
const bool reduce)
502501
{
503-
return dot_complex_wrapper(d, dim, psi_L, psi_R, reduce);
502+
return dot_complex_wrapper(dim, psi_L, psi_R, reduce);
504503
}
505504

506505
// vector operator: result[i] = vector[i] / constant

source/module_base/kernels/rocm/math_kernel_op.hip.cu

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,7 @@ double dot_real_op<double, base_device::DEVICE_GPU>::operator()(const int& dim,
391391
// https://thrust.github.io/doc/group__transformed__reductions_ga321192d85c5f510e52300ae762c7e995.html denghui modify
392392
// 2022-10-03 Note that ddot_(2*dim,a,1, b,1) = REAL( zdotc_(dim,a,1,b,1) ) GPU specialization of actual computation.
393393
template <typename FPTYPE>
394-
inline FPTYPE dot_complex_wrapper(const base_device::DEVICE_GPU* d,
395-
const int& dim,
394+
inline FPTYPE dot_complex_wrapper(const int& dim,
396395
const std::complex<FPTYPE>* psi_L,
397396
const std::complex<FPTYPE>* psi_R,
398397
const bool reduce)
@@ -415,15 +414,15 @@ float dot_real_op<std::complex<float>, base_device::DEVICE_GPU>::operator()(cons
415414
const std::complex<float>* psi_R,
416415
const bool reduce)
417416
{
418-
return dot_complex_wrapper(d, dim, psi_L, psi_R, reduce);
417+
return dot_complex_wrapper(dim, psi_L, psi_R, reduce);
419418
}
420419
template <>
421420
double dot_real_op<std::complex<double>, base_device::DEVICE_GPU>::operator()(const int& dim,
422421
const std::complex<double>* psi_L,
423422
const std::complex<double>* psi_R,
424423
const bool reduce)
425424
{
426-
return dot_complex_wrapper(d, dim, psi_L, psi_R, reduce);
425+
return dot_complex_wrapper(dim, psi_L, psi_R, reduce);
427426
}
428427

429428
template <>

0 commit comments

Comments
 (0)