Fix missing include for size_t (#84088)

Fixes the following issue:

```C++
In file included from /home/gaoxiang/pytorch-ucc/c10/test/util/ConstexprCrc_test.cpp:1:
In file included from /home/gaoxiang/pytorch-ucc/c10/util/ConstexprCrc.h:3:
/home/gaoxiang/pytorch-ucc/c10/util/IdWrapper.h:42:10: error: unknown type name 'size_t'; did you mean 'std::size_t'?
  friend size_t hash_value(const concrete_type& v) {
         ^~~~~~
         std::size_t
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.0/../../../../include/c++/12.2.0/x86_64-pc-linux-gnu/bits/c++config.h:298:26: note: 'std::size_t' declared here
  typedef __SIZE_TYPE__         size_t;
                                ^
1 error generated.
[111/2069] Generating /home/gaoxiang/pytorch-ucc/torch/csrc/a...ch-ucc/torch/testing/_internal/generated/annotated_fn_args.py
ninja: build stopped: subcommand failed.
```

This error happens with my GCC 12.2.0 + Clang 14.0.6.

Full environment:
```
Collecting environment information...
PyTorch version: 1.13.0a0+git14a53e6
Is debug build: True
CUDA used to build PyTorch: 11.7
ROCM used to build PyTorch: N/A

OS: Arch Linux (x86_64)
GCC version: (GCC) 12.2.0
Clang version: 14.0.6
CMake version: version 3.24.1
Libc version: glibc-2.36

Python version: 3.10.6 (main, Aug  3 2022, 17:39:45) [GCC 12.1.1 20220730] (64-bit runtime)
Python platform: Linux-5.19.3-arch1-1-x86_64-with-glibc2.36
Is CUDA available: True
CUDA runtime version: 11.7.99
GPU models and configuration:
GPU 0: NVIDIA GeForce RTX 3090
GPU 1: NVIDIA GeForce RTX 2080 Ti

Nvidia driver version: 515.65.01
cuDNN version: Probably one of the following:
/usr/lib/libcudnn.so.8.4.1
/usr/lib/libcudnn_adv_infer.so.8.4.1
/usr/lib/libcudnn_adv_train.so.8.4.1
/usr/lib/libcudnn_cnn_infer.so.8.4.1
/usr/lib/libcudnn_cnn_train.so.8.4.1
/usr/lib/libcudnn_ops_infer.so.8.4.1
/usr/lib/libcudnn_ops_train.so.8.4.1
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] numpy==1.23.1
[pip3] torch==1.13.0a0+gitbcc6f6c
[pip3] torch-ucc==1.0.0
[pip3] torchani==2.2
[pip3] torchvision==0.2.2.post3
[conda] Could not collect
```
Pull Request resolved: https://github.com/pytorch/pytorch/pull/84088
Approved by: https://github.com/ezyang
This commit is contained in:
Gao, Xiang
2022-08-26 03:11:46 +00:00
committed by PyTorch MergeBot
parent 9790d90e4b
commit 15b560a5c4

View File

@ -1,6 +1,7 @@
#pragma once
#include <c10/macros/Macros.h>
#include <cstddef>
#include <functional>
#include <utility>