Poplar and PopLibs
Error.hpp
1// Copyright (c) 2021 Graphcore Ltd. All rights reserved.
2#ifndef poplar_Error_hpp
3#define poplar_Error_hpp
4
5#include <iosfwd>
6#include <limits>
7#include <memory>
8#include <unordered_set>
9
10#include "poplar/StringRef.hpp"
11
12namespace poplar {
13
14// Forward declarations.
15
16class Engine;
17
18namespace core {
19
20struct ErrorLocation;
21
22} // namespace core
23
31enum class ErrorCode : unsigned {
33 NONE = 0,
35 UNKNOWN,
37 TRAP,
80};
81
86
92
93std::ostream &operator<<(std::ostream &os, ErrorCode error);
94std::istream &operator>>(std::istream &is, ErrorCode &error);
95
100 explicit operator bool() const noexcept;
101
103 unsigned getTile() const noexcept;
104
105 bool operator==(const ErrorLocation &rhs) const noexcept;
106
107 bool operator!=(const ErrorLocation &rhs) const noexcept;
108
109 ErrorLocation() noexcept;
110 ErrorLocation(ErrorLocation const &other);
111 ErrorLocation(ErrorLocation &&other) noexcept;
112 ~ErrorLocation() noexcept;
113 ErrorLocation &operator=(ErrorLocation other) noexcept;
114
115 // Implementation.
116 ErrorLocation(core::ErrorLocation other);
117
118private:
119 friend class Engine;
120 friend struct ErrorLocationHash;
121 friend std::ostream &operator<<(std::ostream &os,
122 const ErrorLocation &location);
123
124 std::unique_ptr<core::ErrorLocation> impl;
125};
126
127std::ostream &operator<<(std::ostream &os, const ErrorLocation &location);
128
131 size_t operator()(const ErrorLocation &location) const noexcept;
132};
133
134} // namespace poplar
135
136#endif // poplar_Error_hpp
A graph compute engine.
Definition: Engine.hpp:390
std::istream & operator>>(std::istream &is, CollectiveOperator &op)
Parse token from input stream is to op.
Poplar classes and functions.
Definition: ArrayRef.hpp:14
std::ostream & operator<<(std::ostream &os, const DebugNameAndId &dnai)
Display the path name of the DebugNameAndId.
StringRef errorCodeToString(ErrorCode error)
Convert a poplar::ErrorCode code to a string.
ErrorCode errorCodeFromString(StringRef error)
Convert a string to a poplar::ErrorCode code.
ErrorCode
Unique error codes for all the possible errors.
Definition: Error.hpp:31
@ FLOATING_POINT_INVALID_OPERATION
The tile failed to execute a floating point operation because it is invalid, for example multiplying ...
@ TRAP
The tile raises a debug exception event.
@ INVALID_PROGRAM_COUNTER
The tile's program counter does not point to a valid region of memory.
@ INVALID_INSTRUCTION
The tile tried to execute an invalid instruction.
@ INVALID_EXCHANGE_CONFIGURATION
The tile tried to configure how it communicates with other tiles incorrectly.
@ FLOATING_POINT_DIVIDE_BY_ZERO
The tile tried to divide a floating point number by zero.
@ FLOATING_POINT_OVERFLOW
The tile performed some floating point operation that caused a floating point number to overflow.
@ UNKNOWN
The error does not have an error code yet.
@ IPU_MEMORY_FAILURE
GCDA has determined that an excessive number of parity errors have occurred on a particular tile of a...
@ IPUSOFTERR
Same as memory error but reported via the SOC rather than tile exception.
@ INVALID_OPERAND
The tile tried to execute an instruction with an invalid operand.
@ TILE_MEMORY_BANK_CONFLICT
Two or more threads on the tile tried to access the same memory bank at the same time.
@ LINK_DOWN
A connection between IPUs failed.
@ HOST_LINK_DOWN
The connection between the host and the IPUs failed.
@ INVALID_ADDRESS
The tile tried to access memory that it does not have access to.
@ MEMORY_ERROR
The tile has detected one or more memory parity errors indicating that data may be corrupted.
@ EXCHANGE_ERROR
The tile failed to successfully communicate with other tiles.
@ NONE
Not an error.
@ HOST_SYNC_TIMEOUT
The host didn't receive any communication from the IPUs for a timeout period.
Hash function for ErrorLocation.
Definition: Error.hpp:130
Uniquely identify the location of an error within a Poplar Device.
Definition: Error.hpp:97
unsigned getTile() const noexcept