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 
11 namespace CUDF_EXPORT cudf {
12 
22 enum class [[nodiscard]] errc : cuda::std::int8_t {
23  SUCCESS = 0,
24  OVERFLOW = 1,
25  DIVISION_BY_ZERO = 2,
26 };
27 
33 [[nodiscard]] constexpr char const* to_string(errc error)
34 {
35  switch (error) {
36  case errc::SUCCESS: return "SUCCESS";
37  case errc::OVERFLOW: return "OVERFLOW";
38  case errc::DIVISION_BY_ZERO: return "DIVISION_BY_ZERO";
39  default: return "UNKNOWN_ERROR";
40  }
41 }
42 
45 } // namespace CUDF_EXPORT cudf
constexpr char const * to_string(errc error)
Convert an errc error code to a human-readable string.
Definition: errc.hpp:33
errc
An enumeration of error codes that can occur during operations.
Definition: errc.hpp:22
cuDF interfaces
Definition: host_udf.hpp:26