|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if (defined(__cplusplus) && __cplusplus >= 201402L)
|
|
|
#define C10_DEPRECATED [[deprecated]]
|
|
|
#define C10_DEPRECATED_MESSAGE(message) [[deprecated(message)]]
|
|
|
#elif defined(__GNUC__)
|
|
|
#define C10_DEPRECATED __attribute__((deprecated))
|
|
|
|
|
|
#define C10_DEPRECATED_MESSAGE(message) __attribute__((deprecated))
|
|
|
|
|
|
#elif defined(_MSC_VER)
|
|
|
#define C10_DEPRECATED __declspec(deprecated)
|
|
|
#define C10_DEPRECATED_MESSAGE(message) __declspec(deprecated(message))
|
|
|
#else
|
|
|
#warning "You need to implement C10_DEPRECATED for this compiler"
|
|
|
#define C10_DEPRECATED
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(__has_cpp_attribute)
|
|
|
#if __has_cpp_attribute(deprecated) && !defined(__CUDACC__)
|
|
|
#define C10_DEFINE_DEPRECATED_USING(TypeName, TypeThingy) \
|
|
|
using TypeName [[deprecated]] = TypeThingy;
|
|
|
#endif
|
|
|
#endif
|
|
|
|
|
|
#if defined(_MSC_VER)
|
|
|
#if defined(__CUDACC__)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(C10_DEFINE_DEPRECATED_USING)
|
|
|
#undef C10_DEFINE_DEPRECATED_USING
|
|
|
#endif
|
|
|
#define C10_DEFINE_DEPRECATED_USING(TypeName, TypeThingy) \
|
|
|
using TypeName = TypeThingy;
|
|
|
#else
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef C10_DEFINE_DEPRECATED_USING
|
|
|
#if defined(_MSVC_LANG) && _MSVC_LANG >= 201402L
|
|
|
#define C10_DEFINE_DEPRECATED_USING(TypeName, TypeThingy) \
|
|
|
using TypeName [[deprecated]] = TypeThingy;
|
|
|
#else
|
|
|
#define C10_DEFINE_DEPRECATED_USING(TypeName, TypeThingy) \
|
|
|
using TypeName = __declspec(deprecated) TypeThingy;
|
|
|
#endif
|
|
|
#endif
|
|
|
#endif
|
|
|
#endif
|
|
|
|
|
|
#if !defined(C10_DEFINE_DEPRECATED_USING) && defined(__GNUC__)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(__CUDACC__)
|
|
|
#define C10_DEFINE_DEPRECATED_USING(TypeName, TypeThingy) \
|
|
|
using TypeName __attribute__((deprecated)) = TypeThingy;
|
|
|
#else
|
|
|
|
|
|
#define C10_DEFINE_DEPRECATED_USING(TypeName, TypeThingy) \
|
|
|
using TypeName = TypeThingy;
|
|
|
#endif
|
|
|
#endif
|
|
|
|
|
|
#if !defined(C10_DEFINE_DEPRECATED_USING)
|
|
|
#warning "You need to implement C10_DEFINE_DEPRECATED_USING for this compiler"
|
|
|
#define C10_DEFINE_DEPRECATED_USING
|
|
|
#endif
|
|
|
|