File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -1187,22 +1187,18 @@ string CUDADevice::query(luisa::string_view property) noexcept {
11871187 return " cuda" ;
11881188 }
11891189 if (property == " total_memory" ) {
1190- string memory = " 0" ;
1191- with_handle ([&memory]{
1190+ return with_handle ([]{
11921191 size_t free_mem, total_mem;
11931192 cuMemGetInfo (&free_mem, &total_mem);
1194- memory = std::to_string (total_mem);
1193+ return std::to_string (total_mem);
11951194 });
1196- return memory;
11971195 }
11981196 if (property == " free_memory" ) {
1199- string memory = " 0" ;
1200- with_handle ([&memory]{
1197+ return with_handle ([]{
12011198 size_t free_mem, total_mem;
12021199 cuMemGetInfo (&free_mem, &total_mem);
1203- memory = std::to_string (free_mem);
1200+ return std::to_string (free_mem);
12041201 });
1205- return memory;
12061202 }
12071203 LUISA_WARNING_WITH_LOCATION (" Unknown device property '{}'." , property);
12081204 return {};
You can’t perform that action at this time.
0 commit comments