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

Function arg_as_OpcodeClassID

tools/profiler/src/problem_space.cpp:1005–1028  ·  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

1003
1004/// Lexically casts an argument to an int64 if it is defined. Returns true if not null.
1005bool arg_as_OpcodeClassID(
1006 library::OpcodeClassID &opcode_class,
1007 KernelArgument::Value const *value_ptr) {
1008
1009 if (value_ptr->not_null) {
1010 if (value_ptr->argument->description->type == ArgumentTypeID::kEnumerated) {
1011
1012 opcode_class = library::from_string<library::OpcodeClassID>(
1013 static_cast<EnumeratedTypeArgument::EnumeratedTypeValue const *>(value_ptr)->element);
1014
1015 if (opcode_class == library::OpcodeClassID::kInvalid) {
1016 throw std::runtime_error(
1017 "arg_as_OpcodeClassID() - illegal cast.");
1018 }
1019 }
1020 else {
1021
1022 throw std::runtime_error(
1023 "arg_as_OpcodeClassID() - illegal cast.");
1024 }
1025 return true;
1026 }
1027 return false;
1028}
1029
1030/// Lexically casts an argument to an int64 if it is defined. Returns true if not null.
1031bool arg_as_OpcodeClassID(

Callers

nothing calls this directly

Calls 3

argument_indexMethod · 0.80
getMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected