【LibTorch】 判定GPU是否可用
【LibTorch】 判定GPU是否可用
- 1、背景
- 2、代码
1、背景
最近学习libtorch(pytorch的c++版本)。
开发环境介绍:
-1.1 windows10;
-1.2 Microsoft Visual Studio 2017社区版;
-1.3 libTorch: libtorch-win-shared-with-deps-1.9.0+cu102.zip
-1.4 cuda: cuda_10.2.89_441.22_win10.exe
-1.5 cudnn: cudnn-10.2-windows10-x64-v7.6.5.32.7z
LibTorch、cuda配置按照官方进行: https://pytorch.org/get-started/locally/
2、代码
c++14测试ok
#include<iostream>
还没有评论,来说两句吧...