From 9d957786ffc267cd72e18e1727385654bea90352 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Tue, 12 Nov 2024 21:46:20 -0500 Subject: [PATCH] fix compile error Signed-off-by: Jinzhe Zeng --- source/api_cc/src/DeepPotJAX.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/api_cc/src/DeepPotJAX.cc b/source/api_cc/src/DeepPotJAX.cc index 672d97f351..037afa47c5 100644 --- a/source/api_cc/src/DeepPotJAX.cc +++ b/source/api_cc/src/DeepPotJAX.cc @@ -246,7 +246,8 @@ void deepmd::DeepPotJAX::init(const std::string& model, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x20, 0x1, 0x38, 0x1}}; // Convert the desired percentage into a byte-array. - auto bytes = reinterpret_cast(0.9); + double gpu_memory_fraction = 0.9; + auto bytes = reinterpret_cast(&gpu_memory_fraction); // Put it to the config byte-array, from 3 to 10: for (std::size_t i = 0; i < sizeof(gpu_memory_fraction); ++i) {