Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

vision.cpp 610 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
  1. #include "vision.h"
  2. #include <torch/library.h>
  3. #ifdef WITH_CUDA
  4. #include <cuda.h>
  5. #endif
  6. #ifdef WITH_HIP
  7. #include <hip/hip_runtime.h>
  8. #endif
  9. // If we are in a Windows environment, we need to define
  10. // initialization functions for the _custom_ops extension.
  11. #if !defined(MOBILE) && defined(_WIN32)
  12. void* PyInit__C(void) {
  13. return nullptr;
  14. }
  15. #endif // !defined(MOBILE) && defined(_WIN32)
  16. namespace vision {
  17. int64_t cuda_version() {
  18. #ifdef WITH_CUDA
  19. return CUDA_VERSION;
  20. #else
  21. return -1;
  22. #endif
  23. }
  24. TORCH_LIBRARY_FRAGMENT(torchvision, m) {
  25. m.def("_cuda_version", &cuda_version);
  26. }
  27. } // namespace vision
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...