Skip to content

Commit 96e2b59

Browse files
committed
follow Daniel suggestion
1 parent dbc91ed commit 96e2b59

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

src/main_gpumd/run.cu

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -497,19 +497,22 @@ void Run::parse_velocity(const char** param, int num_param)
497497
bool use_seed = false;
498498
if (!(num_param == 2 || num_param == 4)) {
499499
PRINT_INPUT_ERROR("velocity should have 1 or 2 parameters.\n");
500+
} else if (num_param == 4) {
501+
// See https://github.com/brucefan1983/GPUMD/pull/768
502+
// for the reason for putting this branch here.
503+
use_seed = true;
504+
if (!is_valid_int(param[3], &seed)) {
505+
PRINT_INPUT_ERROR("seed should be a positive integer.\n");
506+
}
500507
}
508+
501509
if (!is_valid_real(param[1], &initial_temperature)) {
502510
PRINT_INPUT_ERROR("initial temperature should be a real number.\n");
503511
}
504512
if (initial_temperature <= 0.0) {
505513
PRINT_INPUT_ERROR("initial temperature should be a positive number.\n");
506514
}
507-
if (num_param == 4) {
508-
use_seed = true;
509-
if (!is_valid_int(param[3], &seed)) {
510-
PRINT_INPUT_ERROR("seed should be a positive integer.\n");
511-
}
512-
}
515+
513516
velocity.initialize(
514517
has_velocity_in_xyz,
515518
initial_temperature,

src/makefile.hip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# some flags
1515
###########################################################
1616
CC = hipcc
17-
CFLAGS = -std=c++14 -O1 --offload-arch=gfx90a -DUSE_HIP
17+
CFLAGS = -std=c++14 -O3 --offload-arch=gfx90a -DUSE_HIP
1818
INC = -I./
1919
LDFLAGS =
2020
LIBS = -lhipblas -lhipsolver

0 commit comments

Comments
 (0)