joaopauloschuler / neural-api

CAI NEURAL API - Pascal based deep learning neural network API optimized for AVX, AVX2 and AVX512 instruction sets plus OpenCL capable devices including AMD, Intel and NVIDIA.
GNU Lesser General Public License v2.1
356 stars 195 forks source link

Compile Errors - Delphi 10.3 - Release #27

Open HuguesDug opened 4 years ago

HuguesDug commented 4 years ago

Development environment. Delphi 10.3, targets windows 32 or 64 bits, release and debug. Last release of Master branch as of June 21rst.

Error : Compiler errors when trying to compile in Release mode.

Error 1: In NeuralNetwork.pas Compiler raise error : E2501 : inline not possible for a nested procedure.

This is due to inline directive" in the declaration of TNNetLayer.ComputeErrorDeriv(); It is activated when going in release mode, but not activated in debug.

Error2: In NeuralThread;pas Similar problem with function fNTL: TNeuralThreadList; {$IFDEF Release} inline; {$ENDIF} Cannot be inlined.

joaopauloschuler commented 4 years ago

Thank you for reporting!

joaopauloschuler commented 4 years ago

This is really strange. I've just given a go with Release settings and I can build with Delphi 10.3.

HuguesDug commented 4 years ago

Hello, I tested again, no discussion : compiling fails. Delphi 10.3.3 Check your compilers directive inside project-settings-Delphi compiler - compiler options. Do you have the control inline code active ?

HuguesDug commented 4 years ago

Here are my compiler directives, for release mode. They are default option, as I reinstalled recently the 10.3.3 over a clean install. It is a translation from French... sorry for the wording.

Other options : all unchecked

Debugging :

Runtime erros:

Code generation:

Syntaxe:

Keep in mind, I am running a project in a windows form.

As a fix, I did:

Then, it compiles OK.

joaopauloschuler commented 4 years ago

Thank you for sending details. I'll look into it.

HuguesDug commented 3 years ago

I read delphi documentation regarding INLINE directive.

I confirm yourcode should not compile in 10.3, as the restrictions on the use of inline for specific cases clearly exclude what was programmed.

So, it is not a problem of compiler setting. More probably the fact that you did not test with "release mode" activated. So, INLINE was ignored.