Hello, I have a question about compiling an extension with cuda files. I get the following error:
distutils.errors.UnknownFileError: unknown file type '.cu'

when I include .cu files in the sources:
import os
import torch
import glob
from torch.utils.ffi import create_extension

this_file = os.path.dirname(__file__)

sources = ['../Library/~.cpp',
            '../Library/~.cpp',
            '../Library/~.cu']
headers = ['../Library/~.h']
here = os.path.abspath(os.path.dirname(__file__))
lib_dir = os.path.join(here, '..', 'Library')
include_dirs = [
    os.path.join(lib_dir, '~'),
    os.path.join(lib_dir, 'Math'),
]
defines = [('WITH_CUDA', None)]
with_cuda = True

ffi = create_extension(
    '_CUDA.~',
    headers=headers,
    sources=sources,
    define_macros=defines,
    relative_to=__file__,
    with_cuda=with_cuda,
    include_dirs = include_dirs,
    extra_compile_args=["-fopenmp"]
)

if __name__ == '__main__':
    ffi.build()
    from _CUDA import ~
    print ~.__dict__

Am I doing something wrong?