aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/stream_executor/lib
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2017-01-17 12:28:27 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-01-17 12:51:25 -0800
commit21c0fa9e2dd966c242a4e89f1cac9e3e0f146ea8 (patch)
treedafb27008ba040280825c18d10e0bef02d68187c /tensorflow/stream_executor/lib
parentc276876a4ab1ebedf2b847d9ac12d019d6a16cff (diff)
Plumb port::Status through the internal synchronous memcopy routines.
Now, at least for the public APIs that return port::Status, they can grab the port::Status that the implementation would like to return and use its additional information in reporting to the user. Change: 144741667
Diffstat (limited to 'tensorflow/stream_executor/lib')
-rw-r--r--tensorflow/stream_executor/lib/status.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/tensorflow/stream_executor/lib/status.h b/tensorflow/stream_executor/lib/status.h
index 493fc656e1..0aec2917dc 100644
--- a/tensorflow/stream_executor/lib/status.h
+++ b/tensorflow/stream_executor/lib/status.h
@@ -20,6 +20,7 @@ limitations under the License.
#include "tensorflow/core/lib/core/status.h"
#include "tensorflow/stream_executor/lib/error.h" // IWYU pragma: export
+#include "tensorflow/stream_executor/lib/stringpiece.h"
#include "tensorflow/stream_executor/platform/logging.h"
namespace perftools {
@@ -33,6 +34,17 @@ using Status = tensorflow::Status;
#define SE_ASSERT_OK(val) \
ASSERT_EQ(::perftools::gputools::port::Status::OK(), (val))
+// Define some canonical error helpers.
+inline Status UnimplementedError(StringPiece message) {
+ return Status(error::UNIMPLEMENTED, message);
+}
+inline Status InternalError(StringPiece message) {
+ return Status(error::INTERNAL, message);
+}
+inline Status FailedPreconditionError(StringPiece message) {
+ return Status(error::FAILED_PRECONDITION, message);
+}
+
} // namespace port
} // namespace gputools
} // namespace perftools