Skip to content

Commit cead7ce

Browse files
authored
Fix blas_connector.cpp warnings and math_kernel_op.cu warnings (#5444)
* Fix warnings * Fix cuda compiling bug * Fix compiling error
1 parent b63aad4 commit cead7ce

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

source/module_base/blas_connector.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,17 @@ float BlasConnector::dot( const int n, const float *X, const int incX, const flo
6969
{
7070
if (device_type == base_device::AbacusDevice_t::CpuDevice) {
7171
return sdot_(&n, X, &incX, Y, &incY);
72+
}
7273
return sdot_(&n, X, &incX, Y, &incY);
7374
}
74-
}
7575

7676
double BlasConnector::dot( const int n, const double *X, const int incX, const double *Y, const int incY, base_device::AbacusDevice_t device_type)
7777
{
7878
if (device_type == base_device::AbacusDevice_t::CpuDevice) {
7979
return ddot_(&n, X, &incX, Y, &incY);
80+
}
8081
return ddot_(&n, X, &incX, Y, &incY);
8182
}
82-
}
8383

8484
// C = a * A.? * B.? + b * C
8585
void BlasConnector::gemm(const char transa, const char transb, const int m, const int n, const int k,
@@ -196,39 +196,39 @@ float BlasConnector::nrm2( const int n, const float *X, const int incX, base_dev
196196
{
197197
if (device_type == base_device::AbacusDevice_t::CpuDevice) {
198198
return snrm2_( &n, X, &incX );
199+
}
199200
return snrm2_( &n, X, &incX );
200201
}
201-
}
202202

203203

204204
double BlasConnector::nrm2( const int n, const double *X, const int incX, base_device::AbacusDevice_t device_type )
205205
{
206206
if (device_type == base_device::AbacusDevice_t::CpuDevice) {
207207
return dnrm2_( &n, X, &incX );
208+
}
208209
return dnrm2_( &n, X, &incX );
209210
}
210-
}
211211

212212

213213
double BlasConnector::nrm2( const int n, const std::complex<double> *X, const int incX, base_device::AbacusDevice_t device_type )
214214
{
215215
if (device_type == base_device::AbacusDevice_t::CpuDevice) {
216216
return dznrm2_( &n, X, &incX );
217+
}
217218
return dznrm2_( &n, X, &incX );
218219
}
219-
}
220220

221221
// copies a into b
222222
void BlasConnector::copy(const long n, const double *a, const int incx, double *b, const int incy, base_device::AbacusDevice_t device_type)
223223
{
224224
if (device_type == base_device::AbacusDevice_t::CpuDevice) {
225225
dcopy_(&n, a, &incx, b, &incy);
226-
}
226+
}
227227
}
228228

229229
void BlasConnector::copy(const long n, const std::complex<double> *a, const int incx, std::complex<double> *b, const int incy, base_device::AbacusDevice_t device_type)
230230
{
231231
if (device_type == base_device::AbacusDevice_t::CpuDevice) {
232232
zcopy_(&n, a, &incx, b, &incy);
233-
}
233+
}
234234
}

source/module_hsolver/kernels/cuda/math_kernel_op.cu

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace hsolver
1313
{
1414
const int warp_size = 32;
15-
const unsigned int full_mask = 0xffffffff;
15+
// const unsigned int full_mask = 0xffffffff;
1616
const int thread_per_block = 256;
1717
}
1818

@@ -65,11 +65,11 @@ void destoryBLAShandle(){
6565
}
6666
}
6767

68-
template <typename FPTYPE>
69-
__forceinline__ __device__ void warp_reduce(FPTYPE& val) {
70-
for (int offset = 16; offset > 0; offset >>= 1)
71-
val += __shfl_down_sync(full_mask, val, offset);
72-
}
68+
// template <typename FPTYPE>
69+
// __forceinline__ __device__ void warp_reduce(FPTYPE& val) {
70+
// for (int offset = 16; offset > 0; offset >>= 1)
71+
// val += __shfl_down_sync(full_mask, val, offset);
72+
// }
7373

7474
template <typename Real>
7575
__global__ void line_minimize_with_block(

0 commit comments

Comments
 (0)