CUDAMacros.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #pragma once
  2. #ifndef C10_USING_CUSTOM_GENERATED_MACROS
  3. // We have not yet modified the AMD HIP build to generate this file so
  4. // we add an extra option to specifically ignore it.
  5. #ifndef C10_CUDA_NO_CMAKE_CONFIGURE_FILE
  6. #include <c10/cuda/impl/cuda_cmake_macros.h>
  7. #endif // C10_CUDA_NO_CMAKE_CONFIGURE_FILE
  8. #endif
  9. // See c10/macros/Export.h for a detailed explanation of what the function
  10. // of these macros are. We need one set of macros for every separate library
  11. // we build.
  12. #ifdef _WIN32
  13. #if defined(C10_CUDA_BUILD_SHARED_LIBS)
  14. #define C10_CUDA_EXPORT __declspec(dllexport)
  15. #define C10_CUDA_IMPORT __declspec(dllimport)
  16. #else
  17. #define C10_CUDA_EXPORT
  18. #define C10_CUDA_IMPORT
  19. #endif
  20. #else // _WIN32
  21. #if defined(__GNUC__)
  22. #define C10_CUDA_EXPORT __attribute__((__visibility__("default")))
  23. #else // defined(__GNUC__)
  24. #define C10_CUDA_EXPORT
  25. #endif // defined(__GNUC__)
  26. #define C10_CUDA_IMPORT C10_CUDA_EXPORT
  27. #endif // _WIN32
  28. // This one is being used by libc10_cuda.so
  29. #ifdef C10_CUDA_BUILD_MAIN_LIB
  30. #define C10_CUDA_API C10_CUDA_EXPORT
  31. #else
  32. #define C10_CUDA_API C10_CUDA_IMPORT
  33. #endif
  34. /**
  35. * The maximum number of GPUs that we recognizes.
  36. */
  37. #define C10_COMPILE_TIME_MAX_GPUS 16