项目环境由pytorch1.10升级1.11中间要改的东西

1. "THC/THCDeviceUtils.cuh"该文件弃用

nightly: missing THC/THCDeviceUtils.cuh

- #include  
+ #include "ATen/cuda/DeviceUtils.cuh"

2. THCudaMalloc/THCudaFree 被弃用

Migrate THCThrustAllocator to ATen
将THCThrustAllocator.cuh替换成ATen/cuda/ThrustAllocator.h
用c10::cuda::CUDACachingAllocator::raw_alloc(size)/raw_delete(ptr)替代THCudaMalloc/THCudaFree

  • 示例如下:
- THCState *state = at::globalContext().lazyInitCUDA(); // TODO replace with getTHCState

- mask_dev = (unsigned long long*) THCudaMalloc(state, boxes_num * col_blocks * sizeof(unsigned long long));
+ mask_dev = (unsigned long long*) c10::cuda::CUDACachingAllocator::raw_alloc(boxes_num * col_blocks * sizeof(unsigned long long));

- THCudaFree(state, mask_dev);
+ c10::cuda::CUDACachingAllocator::raw_delete(mask_dev);

3. THCeilDiv被弃用

Migrate remainder of THCDeviceUtils.cuh to ATen
THCeilDiv函数和THC/THCDeviceUtils.cuh头文件被弃用,用at::ceil_div和ATen/ceil_div.h头文件

4.THCudaCheck被弃用

Remove THCGeneral.cpp

- THCudaCheck
+ C10_CUDA_CHECK

5. THCState也不再使用

此问题见2,目前直接删掉相关就可
Migrate THCState to ATen

目前整理以上问题及修改,还有其他相关问题可以到pytorch github issues中查询

你可能感兴趣的:(pytorch,C++,深度学习,人工智能)