Lexically casts an argument to an int64 if it is defined. Returns true if not null.
| 1043 | |
| 1044 | /// Lexically casts an argument to an int64 if it is defined. Returns true if not null. |
| 1045 | bool arg_as_SplitKModeID( |
| 1046 | library::SplitKMode &split_k_mode, |
| 1047 | KernelArgument::Value const *value_ptr) { |
| 1048 | |
| 1049 | if (value_ptr->not_null) { |
| 1050 | if (value_ptr->argument->description->type == ArgumentTypeID::kEnumerated) { |
| 1051 | |
| 1052 | split_k_mode = library::from_string<library::SplitKMode>( |
| 1053 | static_cast<EnumeratedTypeArgument::EnumeratedTypeValue const *>(value_ptr)->element); |
| 1054 | |
| 1055 | if (split_k_mode == library::SplitKMode::kInvalid) { |
| 1056 | throw std::runtime_error( |
| 1057 | "arg_as_SplitKModeID() - illegal cast."); |
| 1058 | } |
| 1059 | } |
| 1060 | else { |
| 1061 | |
| 1062 | throw std::runtime_error( |
| 1063 | "arg_as_SplitKModeID() - illegal cast."); |
| 1064 | } |
| 1065 | return true; |
| 1066 | } |
| 1067 | return false; |
| 1068 | } |
| 1069 | |
| 1070 | /// Lexically casts an argument to an int64 if it is defined. Returns true if not null. |
| 1071 | bool arg_as_SplitKModeID( |
nothing calls this directly
no test coverage detected