Replacing THC/THC.h module to ATen/ATen.h module
I have question about replacing &lt;THC/THC.h&gt; method.
Recently, I'm working on installing different loss functions compiled with cpp and cuda.
However, what I faced was a fatal error of
'THC/THC.h': No such file or directory

I found out that TH(C) methods were currently deprecated in recent version of pytorch, and was replaced by ATen API (https://discuss.pytorch.org/t/question-about-thc-thc-h/147145/8).
For sure, downgrading my pytorch version will solve the problem. However, due to my GPU compatibility issue, I have no choice but to modify the script by myself. Therefore, my question can be summarized into follows.
First, how can I replace codes that have dependency of TH(C) method using ATen API?. Below are codes that I have to modify, replacing those three lines looked enough for my case.
#include &lt;THC/THC.h&gt;
extern THCState *state;
cudaStream_t stream = THCState_getCurrentStream(state);

Second, will single modification on cpp file be enough to clear the issue that I'm facing right now? (This is just a minor question, answer on first question will suffice me).
For reference, I attach the github link of the file I'm trying to build (https://github.com/sshaoshuai/Pointnet2.PyTorch).

After struggling for a while, I found the answer for my own.
In case of  THCState_getCurrentStream, it could directly be replaced by at::cuda::getCurrentCUDAStream(). Therefore, modified code block was formulated as below.
//Comment Out
//#include &lt;THE/THC.h&gt;
//extern THCState *state;
//cudaStream_t stream = THCState_getCurrentStream(state);

//Replace with
#include &lt;ATen/cuda/CUDAContext.h&gt;
#include &lt;ATen/cuda/CUDAEvent.h&gt;
cudaStream_t stream = at::cuda::getCurrentCUDAStream();

After replacing the whole source code, I was able to successfully build the module.
Hope this helps.
