XPUMacros.h 870 B

123456789101112131415161718192021222324252627282930313233
  1. #pragma once
  2. #ifndef C10_USING_CUSTOM_GENERATED_MACROS
  3. #include <c10/xpu/impl/xpu_cmake_macros.h>
  4. #endif
  5. // See c10/macros/Export.h for a detailed explanation of what the function
  6. // of these macros are. We need one set of macros for every separate library
  7. // we build.
  8. #ifdef _WIN32
  9. #if defined(C10_XPU_BUILD_SHARED_LIBS)
  10. #define C10_XPU_EXPORT __declspec(dllexport)
  11. #define C10_XPU_IMPORT __declspec(dllimport)
  12. #else
  13. #define C10_XPU_EXPORT
  14. #define C10_XPU_IMPORT
  15. #endif
  16. #else // _WIN32
  17. #if defined(__GNUC__)
  18. #define C10_XPU_EXPORT __attribute__((__visibility__("default")))
  19. #else // defined(__GNUC__)
  20. #define C10_XPU_EXPORT
  21. #endif // defined(__GNUC__)
  22. #define C10_XPU_IMPORT C10_XPU_EXPORT
  23. #endif // _WIN32
  24. // This one is being used by libc10_xpu.so
  25. #ifdef C10_XPU_BUILD_MAIN_LIB
  26. #define C10_XPU_API C10_XPU_EXPORT
  27. #else
  28. #define C10_XPU_API C10_XPU_IMPORT
  29. #endif