mirror of
https://github.com/wassname/ray.git
synced 2026-07-06 05:16:30 +08:00
[core] Use int64_t instead of int to keep track of fractional resources (#4959)
This commit is contained in:
committed by
Robert Nishihara
parent
1e2b649580
commit
ebb3b3b928
@@ -18,7 +18,8 @@ FractionalResourceQuantity::FractionalResourceQuantity(double resource_quantity)
|
||||
RAY_CHECK(resource_quantity >= 0) << "Resource capacity, " << resource_quantity
|
||||
<< ", should be nonnegative.";
|
||||
|
||||
resource_quantity_ = static_cast<int>(resource_quantity * kResourceConversionFactor);
|
||||
resource_quantity_ =
|
||||
static_cast<int64_t>(resource_quantity * kResourceConversionFactor);
|
||||
}
|
||||
|
||||
const FractionalResourceQuantity FractionalResourceQuantity::operator+(
|
||||
|
||||
@@ -58,7 +58,7 @@ class FractionalResourceQuantity {
|
||||
private:
|
||||
/// The resource quantity represented as 1/kResourceConversionFactor-th of a
|
||||
/// unit.
|
||||
int resource_quantity_;
|
||||
int64_t resource_quantity_;
|
||||
};
|
||||
|
||||
/// \class ResourceSet
|
||||
|
||||
Reference in New Issue
Block a user