I am writing a custom extension that implements a modified grid_sample layer. I use the source code from Aten/native/cpu/GridSamplerKernel.cpp by making a few changes to it. Followed the steps in pytorch website and used the CppExtension to compile the layer. Since the source code in GridSamplerKernel.cpp involved #pragma unroll i also passed the “-O3” flag to the extra compile_args of CppExtension as follows
CppExtension(
            "alignSingle",
            sources,
            include_dirs=include_dirs,
            define_macros=define_macros,
            extra_compile_args=e['-O3'],
        )

. But still, it shows that the pragma unroll is ignored during the compilation. Is there anything else to add for compiling the custom layers with pragma unroll?. To reproduce the warning run ./make.sh from the source code here https://drive.google.com/file/d/1hBmWyK3UvQMd3FRFD5_5tL50WvCtRegp/view?usp=sharing 3 . NOTE: I am using ubuntu and have to set the flag AT_MKL_ENABLED() at include/ATen/Config.h to 0 before compiling. Otherwise it throws the error no <mkl.h> file during compilation.