treelite_util.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2020-2021, NVIDIA CORPORATION.
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 
6 #pragma once
7 #include <cstdint>
8 
9 namespace ML {
10 namespace DT {
11 
12 template <typename T>
14 
15 template <>
16 class TreeliteType<float> {
17  public:
18  static constexpr const char* value = "float32";
19 };
20 
21 template <>
22 class TreeliteType<double> {
23  public:
24  static constexpr const char* value = "float64";
25 };
26 
27 template <>
28 class TreeliteType<uint32_t> {
29  public:
30  static constexpr const char* value = "uint32";
31 };
32 
33 template <>
34 class TreeliteType<int> {
35  public:
36  static_assert(sizeof(int) == sizeof(uint32_t), "int must be 32-bit");
37  static constexpr const char* value = "uint32";
38 };
39 
40 } // End namespace DT
41 
42 } // End namespace ML
Definition: treelite_util.h:13
Definition: dbscan.hpp:18