Pytorch extension build problem

Hello I try to build official pytorch CUDA example from GitHub - pytorch/extension-cpp: C++ extensions in PyTorch

python install invoked from the cuda subfolder of extension-cpp works well

Hovewer when I try to run


I get error

** Visual Studio 2019 Developer Command Prompt v16.9.18
** Copyright (c) 2021 Microsoft Corporation
[vcvarsall.bat] Environment initialized for: 'x64'

C:\Windows\System32>python D:\projects\extension-cpp\cuda\
Using C:\Users\jakub\AppData\Local\torch_extensions\torch_extensions\Cache\py37_cu113 as PyTorch extensions root...
Traceback (most recent call last):
  File "D:\projects\extension-cpp\cuda\", line 3, in <module>
    'lltm_cuda', ['lltm_cuda.cpp', ''], verbose=True)
  File "C:\Users\jakub\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\utils\", line 1136, in load
  File "C:\Users\jakub\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\utils\", line 1314, in _jit_compile
  File "C:\Users\jakub\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\utils\", line 45, in bump_version_if_changed
    hash_value = hash_source_files(hash_value, source_files)
  File "C:\Users\jakub\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\utils\", line 15, in hash_source_files
    with open(filename) as file:
FileNotFoundError: [Errno 2] No such file or directory: 'lltm_cuda.cpp'

I also faund that somebody tried to make it work by changing to

        CUDAExtension('lltm_cuda', [
        'build_ext': BuildExtension

but I can not figure it out what include directory to include here because when I try

from torch.utils.cpp_extension import load
lltm_cuda = load(
    'lltm_cuda', ['D:/projects/extension-cpp/cuda/lltm_cuda.cpp', 'D:/projects/extension-cpp/cuda/'], verbose=True)

I get

list index out of range

my configuration
torch==1.10.2+cu113 torchvision==0.11.3+cu113 torchaudio===0.10.2+cu113
Python 6.3
I had also installed latest Microsoft Visual C++ Redistributable

Thanks for any help !!!

Ok I figured it out I just put all of the necessery files to one directory not dividing to subfolders (I used only CUDA) and all works now