COMPASS  5.0.0
End-to-end AO simulation tool using GPU acceleration
declare_name.hpp
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------
2 // This file is part of COMPASS <https://anr-compass.github.io/compass/>
3 //
4 // Copyright (C) 2011-2019 COMPASS Team <https://github.com/ANR-COMPASS>
5 // All rights reserved.
6 // Distributed under GNU - LGPL
7 //
8 // COMPASS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser
9 // General Public License as published by the Free Software Foundation, either version 3 of the License,
10 // or any later version.
11 //
12 // COMPASS: End-to-end AO simulation tool using GPU acceleration
13 // The COMPASS platform was designed to meet the need of high-performance for the simulation of AO systems.
14 //
15 // The final product includes a software package for simulating all the critical subcomponents of AO,
16 // particularly in the context of the ELT and a real-time core based on several control approaches,
17 // with performances consistent with its integration into an instrument. Taking advantage of the specific
18 // hardware architecture of the GPU, the COMPASS tool allows to achieve adequate execution speeds to
19 // conduct large simulation campaigns called to the ELT.
20 //
21 // The COMPASS platform can be used to carry a wide variety of simulations to both testspecific components
22 // of AO of the E-ELT (such as wavefront analysis device with a pyramid or elongated Laser star), and
23 // various systems configurations such as multi-conjugate AO.
24 //
25 // COMPASS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
26 // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
27 // See the GNU Lesser General Public License for more details.
28 //
29 // You should have received a copy of the GNU Lesser General Public License along with COMPASS.
30 // If not, see <https://www.gnu.org/licenses/lgpl-3.0.txt>.
31 // -----------------------------------------------------------------------------
32 
40 
41 #ifndef _DECLARE_NAME_H_
42 #define _DECLARE_NAME_H_
43 
44 #include <string>
45 #include <cstdint>
46 #include <cuComplex.h>
47 
48 #ifdef CAN_DO_HALF
49 #include <cuda_fp16.h>
50 #endif
51 
52 template <typename T>
53 constexpr static char const* explicit_name();
54 
55 #define DECLARE_NAME_CARMA(Type, Name) \
56  template <> \
57  constexpr char const* explicit_name<Type>() { \
58  return #Name; \
59  }
60 
61 // DECLARE_NAME_CARMA(u8, Uint8)
62 // DECLARE_NAME_CARMA(i8, Int8)
63 
64 // DECLARE_NAME_CARMA(u16, Uint16)
65 // DECLARE_NAME_CARMA(i16, Int16)
66 
67 // DECLARE_NAME_CARMA(u32, Uint32)
68 // DECLARE_NAME_CARMA(i32, Int32)
69 
70 // DECLARE_NAME_CARMA(u64, Uint64)
71 // DECLARE_NAME_CARMA(i64, Int64)
72 
74 DECLARE_NAME_CARMA(unsigned int, uint);
75 DECLARE_NAME_CARMA(uint16_t, uint16);
76 
77 #ifdef CAN_DO_HALF
78 DECLARE_NAME_CARMA(half, half);
79 #endif
80 DECLARE_NAME_CARMA(float, float);
81 DECLARE_NAME_CARMA(double, double);
82 
83 DECLARE_NAME_CARMA(cuFloatComplex, float_complex);
84 DECLARE_NAME_CARMA(cuDoubleComplex, double_complex);
85 // DECLARE_NAME_CARMA(tuple_t<float>, tuple_float);
86 
87 template <typename T>
88 std::string appendName(std::string str) {
89  return str + explicit_name<T>();
90 }
91 #endif
appendName
std::string appendName(std::string str)
Definition: declare_name.hpp:88
DECLARE_NAME_CARMA
#define DECLARE_NAME_CARMA(Type, Name)
Definition: declare_name.hpp:55