errc.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 #pragma once
6 
7 #include <cudf/utilities/export.hpp>
8 
9 #include <cuda/std/cstdint>
10 
16 namespace CUDF_EXPORT cudf {
17 
26 enum class [[nodiscard]] errc : cuda::std::int8_t {
27  SUCCESS = 0,
28  OVERFLOW = 1,
29  DIVISION_BY_ZERO = 2,
30 };
31 
37 [[nodiscard]] constexpr char const* to_string(errc error)
38 {
39  switch (error) {
40  case errc::SUCCESS: return "SUCCESS";
41  case errc::OVERFLOW: return "OVERFLOW";
42  case errc::DIVISION_BY_ZERO: return "DIVISION_BY_ZERO";
43  default: return "UNKNOWN_ERROR";
44  }
45 }
46 
49 } // namespace CUDF_EXPORT cudf
constexpr char const * to_string(errc error)
Convert an errc error code to a human-readable string.
Definition: errc.hpp:37
errc
An enumeration of error codes that can occur during operations.
Definition: errc.hpp:26
cuDF interfaces
Definition: host_udf.hpp:26