/usr/local/lib64/python3.6/site-packages/torch/include/ATen/native/cuda
NameSizeModeActions
BatchLinearAlgebraLib.h31140644editdlrm
block_reduce.cuh25490644editdlrm
CompositeRandomAccessor.h9290644editdlrm
CUDALoops.cuh75980644editdlrm
CuFFTPlanCache.h192820644editdlrm
CuFFTUtils.h18920644editdlrm
DeviceSqrt.cuh5850644editdlrm
DistributionTemplates.h274350644editdlrm
EmbeddingBackwardKernel.cuh7150644editdlrm
ForeachFunctors.cuh168510644editdlrm
GridSampler.cuh113160644editdlrm
im2col.cuh65770644editdlrm
KernelUtils.cuh25530644editdlrm
LaunchUtils.h3060644editdlrm
Loops.cuh99970644editdlrm
Math.cuh138400644editdlrm
MemoryAccess.cuh124630644editdlrm
MiscUtils.h33410644editdlrm
MultiTensorApply.cuh75520644editdlrm
Normalization.cuh744410644editdlrm
PersistentSoftmax.cuh146350644editdlrm
Randperm.cuh21140644editdlrm
Reduce.cuh387840644editdlrm
Resize.cuh19190644editdlrm
ROCmLoops.cuh135260644editdlrm
SortingCommon.cuh56880644editdlrm
SortingRadixSelect.cuh119180644editdlrm
SortUtils.cuh55490644editdlrm
TensorModeKernel.cuh143910644editdlrm
UniqueCub.cuh3450644editdlrm
UpSample.cuh75520644editdlrm
vol2col.cuh82970644editdlrm
Edit: /usr/local/lib64/python3.6/site-packages/torch/include/ATen/native/cuda/Resize.cuh (1919B)
#pragma once #include #include #include #include namespace at { namespace native { // These functions are called by native::resize_ as well as (legacy) THC resize. // They are not in THC/THCTensor.cpp because the at namespace is easier // to benchmark than THC; I can't get gbenchmark to call fns from THTensor.cpp static inline void maybe_resize_storage_cuda(TensorImpl* self, uint64_t new_size) { // It does not make sense to try to resize a storage // to hold 0 elements, and this can break // if storage_offset is positive but // new_size is 0, so just bail in that case // (same comment is in Resize.h) if (new_size == 0) { return; } if (!THTensor_getStoragePtr(self)) { TORCH_CHECK(false, "Tensor: invalid null storage"); } uint64_t new_size_bytes = (new_size + self->storage_offset()) * self->dtype().itemsize(); if (new_size_bytes > self->storage().nbytes()) { THCStorage_resizeBytes( globalContext().getTHCState(), THTensor_getStoragePtr(self), new_size_bytes ); } } inline TensorImpl* resize_impl_cuda_( TensorImpl* self, IntArrayRef size, c10::optional stride, bool device_guard = true) { if (self->sizes() == size && (!stride || self->strides() == stride)) { return self; } // NB: We don't need to hold the device guard when calling from TH cuda::OptionalCUDAGuard guard; if (device_guard) { guard.set_index(self->storage().device().index()); } int64_t storage_size = 1; if (stride) { self->set_sizes_and_strides(size, *stride); // NB: storage size can be different from numel. storage_size = storage_size_for(size, *stride); } else { self->set_sizes_contiguous(size); storage_size = self->numel(); } maybe_resize_storage_cuda(self, storage_size); return self; } }}