#include <ATen/cuda/detail/IndexUtils.cuh>
+#include <vector>
namespace at {
namespace cuda {
*/
bool maybeOverlappingIndices(const Tensor& t) {
/* Extract size/stride arrays; only consider size >1 dims. */
- SizeAndStride *info = (SizeAndStride *)alloca(sizeof(SizeAndStride) * t.dim());
+ std::vector<SizeAndStride> info(t.dim());
int dims = t.dim();
int nonSize1Dims = 0;
for (int i = 0; i < dims; ++i) {
}
/* Ascending order (innermost dimension in sorted view is at [0]) */
- qsort(info, nonSize1Dims, sizeof(SizeAndStride), compareSizeAndStride);
+ qsort(info.data(), nonSize1Dims, sizeof(SizeAndStride), compareSizeAndStride);
for (int i = 0; i < (nonSize1Dims - 1); ++i) {
if (((info[i].size - 1) * info[i].stride) >= info[i + 1].stride) {