From: @zhangzhaoju
Reviewed-by: @ginfung,@zh_qh
Signed-off-by: @zh_qh
This commit is contained in:
mindspore-ci-bot 2021-06-02 14:21:52 +08:00 committed by Gitee
commit a4dffa755c
3 changed files with 17 additions and 17 deletions

View File

@ -47,10 +47,9 @@ using debugger::WatchCondition_Parameter;
using debugger::WatchNode;
using debugger::WatchpointHit;
static constexpr auto g_chunk_size = 1024 * 1024 * 3;
namespace mindspore {
static constexpr auto g_chunk_size = 1024 * 1024 * 3;
DebuggerPtr Debugger::debugger_ = nullptr;
std::mutex Debugger::instance_lock_;

View File

@ -82,7 +82,7 @@ static std::unordered_map<TypeId, std::string> g_type_2_lable{
{kObjectTypeIOMonad, MS_TYPE2LABLE(kObjectTypeIOMonad)},
{kMonadTypeEnd, MS_TYPE2LABLE(kMonadTypeEnd)}};
enum BitsNum : int {
enum class BitsNum : int {
eBits8 = 8,
eBits16 = 16,
eBits32 = 32,
@ -90,13 +90,13 @@ enum BitsNum : int {
};
TypeId IntBitsToTypeId(const int nbits) {
switch (nbits) {
case eBits8:
case static_cast<int>(BitsNum::eBits8):
return kNumberTypeInt8;
case eBits16:
case static_cast<int>(BitsNum::eBits16):
return kNumberTypeInt16;
case eBits32:
case static_cast<int>(BitsNum::eBits32):
return kNumberTypeInt32;
case eBits64:
case static_cast<int>(BitsNum::eBits64):
return kNumberTypeInt64;
default:
MS_LOG(EXCEPTION) << "Wrong number of bits:" << nbits;
@ -105,13 +105,13 @@ TypeId IntBitsToTypeId(const int nbits) {
TypeId UIntBitsToTypeId(const int nbits) {
switch (nbits) {
case eBits8:
case static_cast<int>(BitsNum::eBits8):
return kNumberTypeUInt8;
case eBits16:
case static_cast<int>(BitsNum::eBits16):
return kNumberTypeUInt16;
case eBits32:
case static_cast<int>(BitsNum::eBits32):
return kNumberTypeUInt32;
case eBits64:
case static_cast<int>(BitsNum::eBits64):
return kNumberTypeUInt64;
default:
MS_LOG(EXCEPTION) << "Wrong number of bits:" << nbits;
@ -120,11 +120,11 @@ TypeId UIntBitsToTypeId(const int nbits) {
TypeId FloatBitsToTypeId(const int nbits) {
switch (nbits) {
case eBits16:
case static_cast<int>(BitsNum::eBits16):
return kNumberTypeFloat16;
case eBits32:
case static_cast<int>(BitsNum::eBits32):
return kNumberTypeFloat32;
case eBits64:
case static_cast<int>(BitsNum::eBits64):
return kNumberTypeFloat64;
default:
MS_LOG(EXCEPTION) << "Wrong number of bits:" << nbits;

View File

@ -178,7 +178,7 @@ enum class LogConfigToken : size_t {
NUM_LOG_CFG_TOKENS
};
static const char *g_tok_names[(size_t)LogConfigToken::NUM_LOG_CFG_TOKENS] = {
static const char *g_tok_names[static_cast<size_t>(LogConfigToken::NUM_LOG_CFG_TOKENS)] = {
"invalid", // indicate invalid token
"{", // '{'
"}", // '}'
@ -278,8 +278,9 @@ class LogConfigParser {
bool Expect(LogConfigToken expected, LogConfigToken tok) const {
if (expected != tok) {
MS_LOG(WARNING) << "Parse submodule log configuration text error, expect `" << g_tok_names[(size_t)expected]
<< "`, but got `" << g_tok_names[(size_t)tok] << "`. The whole configuration will be ignored.";
MS_LOG(WARNING) << "Parse submodule log configuration text error, expect `"
<< g_tok_names[static_cast<size_t>(expected)] << "`, but got `"
<< g_tok_names[static_cast<size_t>(tok)] << "`. The whole configuration will be ignored.";
return false;
}
return true;