Skip to content

Commit d6cd27f

Browse files
Fix GPU, but so ugly...
1 parent 799b019 commit d6cd27f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

source/source_pw/module_pwdft/operator_pw/exx_pw_pot.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ void get_exx_potential(const K_Vectors* kv,
176176
#ifdef __CUDA
177177
cudaError_t err = cudaHostRegister(pot_cpu, sizeof(Real) * npw, cudaHostRegisterPortable);
178178
if (err != cudaSuccess) {
179-
printf("临时锁定失败: %s\n", cudaGetErrorString(err));
179+
throw std::runtime_error("failed to register potential CPU memory operations");
180180
}
181181
#endif
182182
syncmem_real_c2d_op()(pot, pot_cpu, rhopw_dev->npw);
@@ -353,7 +353,7 @@ void get_exx_stress_potential(const K_Vectors* kv,
353353
#ifdef __CUDA
354354
cudaError_t err = cudaHostRegister(pot_cpu, sizeof(Real) * npw, cudaHostRegisterPortable);
355355
if (err != cudaSuccess) {
356-
printf("临时锁定失败: %s\n", cudaGetErrorString(err));
356+
throw std::runtime_error("failed to register potential CPU memory operations");
357357
}
358358
#endif
359359
syncmem_real_c2d_op()(pot, pot_cpu, rhopw_dev->npw);

0 commit comments

Comments
 (0)