gronki / fastconv

BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Build error when compiling on Apple M1 #1

Open ofmla opened 4 months ago

ofmla commented 4 months ago

I am getting an error when building an app that uses fastconv as dependency via fpm

build/dependencies/fastconv/src/conv1d/conv1d_simd_core.c:66:13: error: use of undeclared identifier 'kernel_length'
    assert((kernel_length % 4) == 0);
            ^
1 error generated.
[ 21%]             conv1d_simd_core.c  done.

build/dependencies/fastconv/src/conv1d/conv1d_simd_core.c:66:13: error: use of undeclared identifier 'kernel_length'
    assert((kernel_length % 4) == 0);
            ^
1 error generated.
<ERROR> Compilation failed for object " build_dependencies_fastconv_src_conv1d_conv1d_simd_core.c.o "
<ERROR> stopping due to failed compilation
STOP 1
gronki commented 4 months ago

@ofmla thank you very much for the report! Since this part of the code was mostly used for comparison between pure Fortran and manually written SIMD code, it is in fact not used any longer. I will remove this file entirely and keep it Fortran-only library.

ofmla commented 4 months ago

thx for your quick answer. I have a question, why is the kernel matrix reversed in https://github.com/gronki/fastconv/blob/master/src/conv2d/ref.F90#L16, did you use centrosymmetric kernels in your apps

gronki commented 4 months ago

I followed this definition of convolution, where kernel needs to be reversed prior to the integration: https://en.wikipedia.org/wiki/Convolution#Visual_explanation Indeed I mostly work with symmetric kernels, but if you think the way it is implemented is not correct I am open to input :)

gronki commented 2 months ago

@ofmla I have removed the C implementation, since the idea for this library is to be portable. Please check if the compilation issues persist. Thank you!