【LibTorch】 判定GPU是否可用

矫情吗;* 2022-09-07 01:20 294阅读 0赞

【LibTorch】 判定GPU是否可用

  • 1、背景
  • 2、代码

1、背景

最近学习libtorch(pytorch的c++版本)。
开发环境介绍:

  1. -1.1 windows10;
  2. -1.2 Microsoft Visual Studio 2017社区版;
  3. -1.3 libTorch: libtorch-win-shared-with-deps-1.9.0+cu102.zip
  4. -1.4 cuda: cuda_10.2.89_441.22_win10.exe
  5. -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

  1. #include<iostream>

发表评论

表情:
评论列表 (有 0 条评论,294人围观)

还没有评论,来说两句吧...

相关阅读