Skip to content

Commit 9d95778

Browse files
committed
fix compile error
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
1 parent 1b3fd5e commit 9d95778

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

source/api_cc/src/DeepPotJAX.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,8 @@ void deepmd::DeepPotJAX::init(const std::string& model,
246246
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x20, 0x1, 0x38, 0x1}};
247247

248248
// Convert the desired percentage into a byte-array.
249-
auto bytes = reinterpret_cast<std::uint8_t*>(0.9);
249+
double gpu_memory_fraction = 0.9;
250+
auto bytes = reinterpret_cast<std::uint8_t*>(&gpu_memory_fraction);
250251

251252
// Put it to the config byte-array, from 3 to 10:
252253
for (std::size_t i = 0; i < sizeof(gpu_memory_fraction); ++i) {

0 commit comments

Comments
 (0)