MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / ToString

Function ToString

tensorflow/stream_executor/rocm/rocm_driver.cc:85–120  ·  view source on GitHub ↗

Formats hipError_t to output prettified values into a log stream. Error summaries taken from: TODO(leary) switch to cuGetErrorName when updated rocm.h is available.

Source from the content-addressed store, hash-verified

83//
84// TODO(leary) switch to cuGetErrorName when updated rocm.h is available.
85string ToString(hipError_t result) {
86#define OSTREAM_ROCM_ERROR(__name) \
87 case hipError##__name: \
88 return "HIP_ERROR_" #__name;
89
90 switch (result) {
91 OSTREAM_ROCM_ERROR(InvalidValue)
92 OSTREAM_ROCM_ERROR(OutOfMemory)
93 OSTREAM_ROCM_ERROR(NotInitialized)
94 OSTREAM_ROCM_ERROR(Deinitialized)
95 OSTREAM_ROCM_ERROR(NoDevice)
96 OSTREAM_ROCM_ERROR(InvalidDevice)
97 OSTREAM_ROCM_ERROR(InvalidImage)
98 OSTREAM_ROCM_ERROR(InvalidContext)
99 OSTREAM_ROCM_ERROR(InvalidHandle)
100 OSTREAM_ROCM_ERROR(NotFound)
101 OSTREAM_ROCM_ERROR(NotReady)
102 OSTREAM_ROCM_ERROR(NoBinaryForGpu)
103
104 // Encountered an uncorrectable ECC error during execution.
105 OSTREAM_ROCM_ERROR(ECCNotCorrectable)
106
107 // Load/store on an invalid address. Must reboot all context.
108 case 700:
109 return "ROCM_ERROR_ILLEGAL_ADDRESS";
110 // Passed too many / wrong arguments, too many threads for register count.
111 case 701:
112 return "ROCM_ERROR_LAUNCH_OUT_OF_RESOURCES";
113
114 OSTREAM_ROCM_ERROR(ContextAlreadyInUse)
115 OSTREAM_ROCM_ERROR(PeerAccessUnsupported)
116 OSTREAM_ROCM_ERROR(Unknown) // Unknown internal error to ROCM.
117 default:
118 return absl::StrCat("hipError_t(", static_cast<int>(result), ")");
119 }
120}
121
122// ROCM driver routines may require a large amount of stack (particularly
123// hipModuleLoadDataEx, in our experience). To avoid stack overflow when using

Callers 15

CurrentDeviceOrDieFunction · 0.70
SynchronizeOrDieFunction · 0.70
InternalInitFunction · 0.70
GetDeviceMethod · 0.70
GetDeviceNameMethod · 0.70
FuncSetCacheConfigMethod · 0.70
LaunchKernelMethod · 0.70
LoadHsacoMethod · 0.70

Calls 1

StrCatFunction · 0.50

Tested by

no test coverage detected