Caffe2 - C++ API
A deep learning, cross platform ML framework
conversions.h
1 #pragma once
2 
3 #include <caffe2/core/types.h>
4 
5 #ifdef __CUDA_ARCH__
6 // Proxy for including cuda_fp16.h, because common_gpu.h
7 // has necessary diagnostic guards.
8 #include <caffe2/core/common_gpu.h>
9 #endif
10 #if __HIP_DEVICE_COMPILE__
11 #include <caffe2/core/hip/common_gpu.h>
12 #endif
13 
14 // See Note [hip-clang differences to hcc]
15 
16 #if defined(__CUDA_ARCH__) || defined(__HIP_DEVICE_COMPILE__) || defined(__HIP__)
17 #define CONVERSIONS_DECL __host__ __device__ inline
18 #else
19 #define CONVERSIONS_DECL inline
20 #endif
21 
22 namespace caffe2 {
23 
24 namespace convert {
25 
26 template <typename IN, typename OUT>
27 CONVERSIONS_DECL OUT To(const IN in) {
28  return static_cast<OUT>(in);
29 }
30 
31 template <typename OUT, typename IN>
32 CONVERSIONS_DECL OUT Get(IN x) {
33  return static_cast<OUT>(x);
34 }
35 
36 }; // namespace convert
37 
38 }; // namespace caffe2
39 
40 #undef CONVERSIONS_DECL
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
Definition: blob.h:13