MCPcopy Create free account
hub / github.com/NVIDIA/cutlass / arg_as_ProviderID

Function arg_as_ProviderID

tools/profiler/src/problem_space.cpp:1125–1148  ·  view source on GitHub ↗

Lexically casts an argument to an int64 if it is defined. Returns true if not null.

Source from the content-addressed store, hash-verified

1123
1124/// Lexically casts an argument to an int64 if it is defined. Returns true if not null.
1125bool arg_as_ProviderID(
1126 library::Provider &provider,
1127 KernelArgument::Value const *value_ptr) {
1128
1129 if (value_ptr->not_null) {
1130 if (value_ptr->argument->description->type == ArgumentTypeID::kEnumerated) {
1131
1132 provider = library::from_string<library::Provider>(
1133 static_cast<EnumeratedTypeArgument::EnumeratedTypeValue const *>(value_ptr)->element);
1134
1135 if (provider == library::Provider::kInvalid) {
1136 throw std::runtime_error(
1137 "arg_as_ProviderID() - illegal cast.");
1138 }
1139 }
1140 else {
1141
1142 throw std::runtime_error(
1143 "arg_as_ProviderID() - illegal cast.");
1144 }
1145 return true;
1146 }
1147 return false;
1148}
1149
1150/// Lexically casts an argument to an int64 if it is defined. Returns true if not null.
1151bool arg_as_ProviderID(

Callers

nothing calls this directly

Calls 3

argument_indexMethod · 0.80
getMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected