|
|
#ifndef C10_MACROS_EXPORT_H_
|
|
|
#define C10_MACROS_EXPORT_H_
|
|
|
|
|
|
#ifndef C10_USING_CUSTOM_GENERATED_MACROS
|
|
|
#include <c10/macros/cmake_macros.h>
|
|
|
#endif
|
|
|
|
|
|
#include <torch/headeronly/macros/Export.h>
|
|
|
|
|
|
|
|
|
#ifdef CAFFE2_BUILD_MAIN_LIB
|
|
|
#define TORCH_API C10_EXPORT
|
|
|
#else
|
|
|
#define TORCH_API C10_IMPORT
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef TORCH_CUDA_CU_BUILD_MAIN_LIB
|
|
|
#define TORCH_CUDA_CU_API C10_EXPORT
|
|
|
#elif defined(BUILD_SPLIT_CUDA)
|
|
|
#define TORCH_CUDA_CU_API C10_IMPORT
|
|
|
#endif
|
|
|
|
|
|
|
|
|
#ifdef TORCH_CUDA_CPP_BUILD_MAIN_LIB
|
|
|
#define TORCH_CUDA_CPP_API C10_EXPORT
|
|
|
#elif defined(BUILD_SPLIT_CUDA)
|
|
|
#define TORCH_CUDA_CPP_API C10_IMPORT
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef TORCH_CUDA_BUILD_MAIN_LIB
|
|
|
#define TORCH_CUDA_CPP_API C10_EXPORT
|
|
|
#define TORCH_CUDA_CU_API C10_EXPORT
|
|
|
#elif !defined(BUILD_SPLIT_CUDA)
|
|
|
#define TORCH_CUDA_CPP_API C10_IMPORT
|
|
|
#define TORCH_CUDA_CU_API C10_IMPORT
|
|
|
#endif
|
|
|
|
|
|
#if defined(TORCH_HIP_BUILD_MAIN_LIB)
|
|
|
#define TORCH_HIP_CPP_API C10_EXPORT
|
|
|
#define TORCH_HIP_API C10_EXPORT
|
|
|
#else
|
|
|
#define TORCH_HIP_CPP_API C10_IMPORT
|
|
|
#define TORCH_HIP_API C10_IMPORT
|
|
|
#endif
|
|
|
|
|
|
#if defined(TORCH_XPU_BUILD_MAIN_LIB)
|
|
|
#define TORCH_XPU_API C10_EXPORT
|
|
|
#else
|
|
|
#define TORCH_XPU_API C10_IMPORT
|
|
|
#endif
|
|
|
|
|
|
|
|
|
#if defined(_WIN32) && defined(__CUDACC__)
|
|
|
#define C10_API_ENUM C10_API
|
|
|
#else
|
|
|
#define C10_API_ENUM
|
|
|
#endif
|
|
|
|
|
|
#endif
|
|
|
|