Agnuxo commited on
Commit
db3c893
·
verified ·
1 Parent(s): 95c13dc

Upload 36 files

Browse files
.gitattributes CHANGED
@@ -33,3 +33,8 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ data_loader.obj filter=lfs diff=lfs merge=lfs -text
37
+ fashion_mnist_trainer.device-link.obj filter=lfs diff=lfs merge=lfs -text
38
+ fashion_mnist_trainer.exe filter=lfs diff=lfs merge=lfs -text
39
+ fungi.obj filter=lfs diff=lfs merge=lfs -text
40
+ optical_model.obj filter=lfs diff=lfs merge=lfs -text
ALL_BUILD.vcxproj ADDED
@@ -0,0 +1,188 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <Project DefaultTargets="Build" ToolsVersion="17.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+ <PropertyGroup>
4
+ <PreferredToolArchitecture>x64</PreferredToolArchitecture>
5
+ </PropertyGroup>
6
+ <PropertyGroup>
7
+ <ResolveNugetPackages>false</ResolveNugetPackages>
8
+ </PropertyGroup>
9
+ <ItemGroup Label="ProjectConfigurations">
10
+ <ProjectConfiguration Include="Debug|x64">
11
+ <Configuration>Debug</Configuration>
12
+ <Platform>x64</Platform>
13
+ </ProjectConfiguration>
14
+ <ProjectConfiguration Include="Release|x64">
15
+ <Configuration>Release</Configuration>
16
+ <Platform>x64</Platform>
17
+ </ProjectConfiguration>
18
+ <ProjectConfiguration Include="MinSizeRel|x64">
19
+ <Configuration>MinSizeRel</Configuration>
20
+ <Platform>x64</Platform>
21
+ </ProjectConfiguration>
22
+ <ProjectConfiguration Include="RelWithDebInfo|x64">
23
+ <Configuration>RelWithDebInfo</Configuration>
24
+ <Platform>x64</Platform>
25
+ </ProjectConfiguration>
26
+ </ItemGroup>
27
+ <PropertyGroup Label="Globals">
28
+ <ProjectGuid>{EF40E32F-9DB8-3F09-9CAA-07717AF7BF99}</ProjectGuid>
29
+ <Keyword>Win32Proj</Keyword>
30
+ <WindowsTargetPlatformVersion>10.0.26100.0</WindowsTargetPlatformVersion>
31
+ <Platform>x64</Platform>
32
+ <ProjectName>ALL_BUILD</ProjectName>
33
+ <CudaToolkitCustomDir>C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0\</CudaToolkitCustomDir>
34
+ <VCProjectUpgraderObjectName>NoUpgrade</VCProjectUpgraderObjectName>
35
+ </PropertyGroup>
36
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
37
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
38
+ <ConfigurationType>Utility</ConfigurationType>
39
+ <CharacterSet>MultiByte</CharacterSet>
40
+ <PlatformToolset>v143</PlatformToolset>
41
+ </PropertyGroup>
42
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
43
+ <ConfigurationType>Utility</ConfigurationType>
44
+ <CharacterSet>MultiByte</CharacterSet>
45
+ <PlatformToolset>v143</PlatformToolset>
46
+ </PropertyGroup>
47
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'" Label="Configuration">
48
+ <ConfigurationType>Utility</ConfigurationType>
49
+ <CharacterSet>MultiByte</CharacterSet>
50
+ <PlatformToolset>v143</PlatformToolset>
51
+ </PropertyGroup>
52
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'" Label="Configuration">
53
+ <ConfigurationType>Utility</ConfigurationType>
54
+ <CharacterSet>MultiByte</CharacterSet>
55
+ <PlatformToolset>v143</PlatformToolset>
56
+ </PropertyGroup>
57
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
58
+ <ImportGroup Label="ExtensionSettings">
59
+ <Import Project="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0\extras\visual_studio_integration\MSBuildExtensions\CUDA 13.0.props" />
60
+ </ImportGroup>
61
+ <ImportGroup Label="PropertySheets">
62
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
63
+ </ImportGroup>
64
+ <PropertyGroup Label="UserMacros" />
65
+ <PropertyGroup>
66
+ <_ProjectFileVersion>10.0.20506.1</_ProjectFileVersion>
67
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
68
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
69
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
70
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
71
+ </PropertyGroup>
72
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
73
+ <Midl>
74
+ <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
75
+ <OutputDirectory>$(ProjectDir)/$(IntDir)</OutputDirectory>
76
+ <HeaderFileName>%(Filename).h</HeaderFileName>
77
+ <TypeLibraryName>%(Filename).tlb</TypeLibraryName>
78
+ <InterfaceIdentifierFileName>%(Filename)_i.c</InterfaceIdentifierFileName>
79
+ <ProxyFileName>%(Filename)_p.c</ProxyFileName>
80
+ </Midl>
81
+ </ItemDefinitionGroup>
82
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
83
+ <Midl>
84
+ <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
85
+ <OutputDirectory>$(ProjectDir)/$(IntDir)</OutputDirectory>
86
+ <HeaderFileName>%(Filename).h</HeaderFileName>
87
+ <TypeLibraryName>%(Filename).tlb</TypeLibraryName>
88
+ <InterfaceIdentifierFileName>%(Filename)_i.c</InterfaceIdentifierFileName>
89
+ <ProxyFileName>%(Filename)_p.c</ProxyFileName>
90
+ </Midl>
91
+ </ItemDefinitionGroup>
92
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">
93
+ <Midl>
94
+ <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
95
+ <OutputDirectory>$(ProjectDir)/$(IntDir)</OutputDirectory>
96
+ <HeaderFileName>%(Filename).h</HeaderFileName>
97
+ <TypeLibraryName>%(Filename).tlb</TypeLibraryName>
98
+ <InterfaceIdentifierFileName>%(Filename)_i.c</InterfaceIdentifierFileName>
99
+ <ProxyFileName>%(Filename)_p.c</ProxyFileName>
100
+ </Midl>
101
+ </ItemDefinitionGroup>
102
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">
103
+ <Midl>
104
+ <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
105
+ <OutputDirectory>$(ProjectDir)/$(IntDir)</OutputDirectory>
106
+ <HeaderFileName>%(Filename).h</HeaderFileName>
107
+ <TypeLibraryName>%(Filename).tlb</TypeLibraryName>
108
+ <InterfaceIdentifierFileName>%(Filename)_i.c</InterfaceIdentifierFileName>
109
+ <ProxyFileName>%(Filename)_p.c</ProxyFileName>
110
+ </Midl>
111
+ </ItemDefinitionGroup>
112
+ <ItemGroup>
113
+ <CustomBuild Include="E:\Fashion_MNIST_Optic_Evolution\CMakeLists.txt">
114
+ <UseUtf8Encoding>Always</UseUtf8Encoding>
115
+ <Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Building Custom Rule E:/Fashion_MNIST_Optic_Evolution/CMakeLists.txt</Message>
116
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">setlocal
117
+ "C:\Program Files\CMake\bin\cmake.exe" -SE:/Fashion_MNIST_Optic_Evolution -BE:/Fashion_MNIST_Optic_Evolution/build --check-stamp-file E:/Fashion_MNIST_Optic_Evolution/build/CMakeFiles/generate.stamp
118
+ if %errorlevel% neq 0 goto :cmEnd
119
+ :cmEnd
120
+ endlocal &amp; call :cmErrorLevel %errorlevel% &amp; goto :cmDone
121
+ :cmErrorLevel
122
+ exit /b %1
123
+ :cmDone
124
+ if %errorlevel% neq 0 goto :VCEnd</Command>
125
+ <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeCUDAInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeCXXInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeCommonLanguageInclude.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeGenericSystem.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeInitializeConfigs.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeLanguageInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeRCInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeSystemSpecificInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeSystemSpecificInitialize.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CheckLanguage.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\CMakeCommonCompilerMacros.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\MSVC-CXX.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\MSVC.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\NVIDIA-CUDA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\NVIDIA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\FindCUDAToolkit.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\FindPackageHandleStandardArgs.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\FindPackageMessage.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Internal\CMakeCUDALinkerInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Internal\CMakeCXXLinkerInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Internal\CMakeCommonLinkerInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Linker\Windows-MSVC-CUDA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Linker\Windows-MSVC-CXX.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Linker\Windows-MSVC.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-Initialize.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-MSVC-CXX.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-MSVC.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-NVIDIA-CUDA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\WindowsPaths.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeCUDACompiler.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeCXXCompiler.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeRCCompiler.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeSystem.cmake;%(AdditionalInputs)</AdditionalInputs>
126
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\generate.stamp</Outputs>
127
+ <LinkObjects Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkObjects>
128
+ <Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Building Custom Rule E:/Fashion_MNIST_Optic_Evolution/CMakeLists.txt</Message>
129
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">setlocal
130
+ "C:\Program Files\CMake\bin\cmake.exe" -SE:/Fashion_MNIST_Optic_Evolution -BE:/Fashion_MNIST_Optic_Evolution/build --check-stamp-file E:/Fashion_MNIST_Optic_Evolution/build/CMakeFiles/generate.stamp
131
+ if %errorlevel% neq 0 goto :cmEnd
132
+ :cmEnd
133
+ endlocal &amp; call :cmErrorLevel %errorlevel% &amp; goto :cmDone
134
+ :cmErrorLevel
135
+ exit /b %1
136
+ :cmDone
137
+ if %errorlevel% neq 0 goto :VCEnd</Command>
138
+ <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeCUDAInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeCXXInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeCommonLanguageInclude.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeGenericSystem.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeInitializeConfigs.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeLanguageInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeRCInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeSystemSpecificInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeSystemSpecificInitialize.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CheckLanguage.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\CMakeCommonCompilerMacros.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\MSVC-CXX.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\MSVC.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\NVIDIA-CUDA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\NVIDIA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\FindCUDAToolkit.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\FindPackageHandleStandardArgs.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\FindPackageMessage.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Internal\CMakeCUDALinkerInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Internal\CMakeCXXLinkerInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Internal\CMakeCommonLinkerInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Linker\Windows-MSVC-CUDA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Linker\Windows-MSVC-CXX.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Linker\Windows-MSVC.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-Initialize.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-MSVC-CXX.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-MSVC.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-NVIDIA-CUDA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\WindowsPaths.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeCUDACompiler.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeCXXCompiler.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeRCCompiler.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeSystem.cmake;%(AdditionalInputs)</AdditionalInputs>
139
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\generate.stamp</Outputs>
140
+ <LinkObjects Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkObjects>
141
+ <Message Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">Building Custom Rule E:/Fashion_MNIST_Optic_Evolution/CMakeLists.txt</Message>
142
+ <Command Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">setlocal
143
+ "C:\Program Files\CMake\bin\cmake.exe" -SE:/Fashion_MNIST_Optic_Evolution -BE:/Fashion_MNIST_Optic_Evolution/build --check-stamp-file E:/Fashion_MNIST_Optic_Evolution/build/CMakeFiles/generate.stamp
144
+ if %errorlevel% neq 0 goto :cmEnd
145
+ :cmEnd
146
+ endlocal &amp; call :cmErrorLevel %errorlevel% &amp; goto :cmDone
147
+ :cmErrorLevel
148
+ exit /b %1
149
+ :cmDone
150
+ if %errorlevel% neq 0 goto :VCEnd</Command>
151
+ <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeCUDAInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeCXXInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeCommonLanguageInclude.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeGenericSystem.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeInitializeConfigs.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeLanguageInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeRCInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeSystemSpecificInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeSystemSpecificInitialize.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CheckLanguage.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\CMakeCommonCompilerMacros.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\MSVC-CXX.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\MSVC.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\NVIDIA-CUDA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\NVIDIA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\FindCUDAToolkit.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\FindPackageHandleStandardArgs.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\FindPackageMessage.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Internal\CMakeCUDALinkerInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Internal\CMakeCXXLinkerInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Internal\CMakeCommonLinkerInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Linker\Windows-MSVC-CUDA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Linker\Windows-MSVC-CXX.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Linker\Windows-MSVC.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-Initialize.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-MSVC-CXX.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-MSVC.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-NVIDIA-CUDA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\WindowsPaths.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeCUDACompiler.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeCXXCompiler.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeRCCompiler.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeSystem.cmake;%(AdditionalInputs)</AdditionalInputs>
152
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\generate.stamp</Outputs>
153
+ <LinkObjects Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">false</LinkObjects>
154
+ <Message Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">Building Custom Rule E:/Fashion_MNIST_Optic_Evolution/CMakeLists.txt</Message>
155
+ <Command Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">setlocal
156
+ "C:\Program Files\CMake\bin\cmake.exe" -SE:/Fashion_MNIST_Optic_Evolution -BE:/Fashion_MNIST_Optic_Evolution/build --check-stamp-file E:/Fashion_MNIST_Optic_Evolution/build/CMakeFiles/generate.stamp
157
+ if %errorlevel% neq 0 goto :cmEnd
158
+ :cmEnd
159
+ endlocal &amp; call :cmErrorLevel %errorlevel% &amp; goto :cmDone
160
+ :cmErrorLevel
161
+ exit /b %1
162
+ :cmDone
163
+ if %errorlevel% neq 0 goto :VCEnd</Command>
164
+ <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeCUDAInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeCXXInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeCommonLanguageInclude.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeGenericSystem.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeInitializeConfigs.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeLanguageInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeRCInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeSystemSpecificInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeSystemSpecificInitialize.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CheckLanguage.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\CMakeCommonCompilerMacros.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\MSVC-CXX.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\MSVC.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\NVIDIA-CUDA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\NVIDIA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\FindCUDAToolkit.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\FindPackageHandleStandardArgs.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\FindPackageMessage.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Internal\CMakeCUDALinkerInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Internal\CMakeCXXLinkerInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Internal\CMakeCommonLinkerInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Linker\Windows-MSVC-CUDA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Linker\Windows-MSVC-CXX.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Linker\Windows-MSVC.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-Initialize.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-MSVC-CXX.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-MSVC.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-NVIDIA-CUDA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\WindowsPaths.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeCUDACompiler.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeCXXCompiler.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeRCCompiler.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeSystem.cmake;%(AdditionalInputs)</AdditionalInputs>
165
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\generate.stamp</Outputs>
166
+ <LinkObjects Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">false</LinkObjects>
167
+ </CustomBuild>
168
+ </ItemGroup>
169
+ <ItemGroup>
170
+ </ItemGroup>
171
+ <ItemGroup />
172
+ <ItemGroup>
173
+ <ProjectReference Include="E:\Fashion_MNIST_Optic_Evolution\build\ZERO_CHECK.vcxproj">
174
+ <Project>{B4CD8D8C-908F-3E91-878E-AFB61C98E407}</Project>
175
+ <Name>ZERO_CHECK</Name>
176
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
177
+ <CopyToOutputDirectory>Never</CopyToOutputDirectory>
178
+ </ProjectReference>
179
+ <ProjectReference Include="E:\Fashion_MNIST_Optic_Evolution\build\fashion_mnist_trainer.vcxproj">
180
+ <Project>{2B82790A-4403-3D6B-A562-F30C253F0098}</Project>
181
+ <Name>fashion_mnist_trainer</Name>
182
+ </ProjectReference>
183
+ </ItemGroup>
184
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
185
+ <ImportGroup Label="ExtensionTargets">
186
+ <Import Project="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0\extras\visual_studio_integration\MSBuildExtensions\CUDA 13.0.targets" />
187
+ </ImportGroup>
188
+ </Project>
ALL_BUILD.vcxproj.filters ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <Project ToolsVersion="17.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+ <ItemGroup>
4
+ <CustomBuild Include="E:\Fashion_MNIST_Optic_Evolution\CMakeLists.txt" />
5
+ </ItemGroup>
6
+ <ItemGroup>
7
+ </ItemGroup>
8
+ </Project>
CMakeCache.txt ADDED
@@ -0,0 +1,716 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This is the CMakeCache file.
2
+ # For build in directory: e:/Fashion_MNIST_Optic_Evolution/build
3
+ # It was generated by CMake: C:/Program Files/CMake/bin/cmake.exe
4
+ # You can edit this file to change values found and used by cmake.
5
+ # If you do not want to change any of the values, simply exit the editor.
6
+ # If you do want to change a value, simply edit, save, and exit the editor.
7
+ # The syntax for the file is as follows:
8
+ # KEY:TYPE=VALUE
9
+ # KEY is the name of a variable in the cache.
10
+ # TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!.
11
+ # VALUE is the current value for the KEY.
12
+
13
+ ########################
14
+ # EXTERNAL cache entries
15
+ ########################
16
+
17
+ //Path to a program.
18
+ CMAKE_AR:FILEPATH=E:/VS2022/VC/Tools/MSVC/14.38.33130/bin/Hostx64/x64/lib.exe
19
+
20
+ //No help, variable specified on the command line.
21
+ CMAKE_BUILD_TYPE:UNINITIALIZED=Release
22
+
23
+ //Semicolon separated list of supported configuration types, only
24
+ // supports Debug, Release, MinSizeRel, and RelWithDebInfo, anything
25
+ // else will be ignored.
26
+ CMAKE_CONFIGURATION_TYPES:STRING=Debug;Release;MinSizeRel;RelWithDebInfo
27
+
28
+ //CUDA architectures
29
+ CMAKE_CUDA_ARCHITECTURES:STRING=75
30
+
31
+ //CUDA compiler
32
+ CMAKE_CUDA_COMPILER:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/bin/nvcc.exe
33
+
34
+ //Flags used by the CUDA compiler during all build types.
35
+ CMAKE_CUDA_FLAGS:STRING=-D_WINDOWS -Xcompiler=" /GR /EHsc"
36
+
37
+ //Flags used by the CUDA compiler during DEBUG builds.
38
+ CMAKE_CUDA_FLAGS_DEBUG:STRING=-Xcompiler=" -Zi -Ob0 -Od /RTC1"
39
+
40
+ //Flags used by the CUDA compiler during MINSIZEREL builds.
41
+ CMAKE_CUDA_FLAGS_MINSIZEREL:STRING=-Xcompiler="-O1 -Ob1" -DNDEBUG
42
+
43
+ //Flags used by the CUDA compiler during RELEASE builds.
44
+ CMAKE_CUDA_FLAGS_RELEASE:STRING=-Xcompiler="-O2 -Ob2" -DNDEBUG
45
+
46
+ //Flags used by the CUDA compiler during RELWITHDEBINFO builds.
47
+ CMAKE_CUDA_FLAGS_RELWITHDEBINFO:STRING=-Xcompiler=" -Zi -O2 -Ob1" -DNDEBUG
48
+
49
+ //Libraries linked by default with all CUDA applications.
50
+ CMAKE_CUDA_STANDARD_LIBRARIES:STRING=kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib
51
+
52
+ //Flags used by the CXX compiler during all build types.
53
+ CMAKE_CXX_FLAGS:STRING=/DWIN32 /D_WINDOWS /GR /EHsc
54
+
55
+ //Flags used by the CXX compiler during DEBUG builds.
56
+ CMAKE_CXX_FLAGS_DEBUG:STRING=/Zi /Ob0 /Od /RTC1
57
+
58
+ //Flags used by the CXX compiler during MINSIZEREL builds.
59
+ CMAKE_CXX_FLAGS_MINSIZEREL:STRING=/O1 /Ob1 /DNDEBUG
60
+
61
+ //Flags used by the CXX compiler during RELEASE builds.
62
+ CMAKE_CXX_FLAGS_RELEASE:STRING=/O2 /Ob2 /DNDEBUG
63
+
64
+ //Flags used by the CXX compiler during RELWITHDEBINFO builds.
65
+ CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=/Zi /O2 /Ob1 /DNDEBUG
66
+
67
+ //Libraries linked by default with all C++ applications.
68
+ CMAKE_CXX_STANDARD_LIBRARIES:STRING=kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib
69
+
70
+ //Flags used by the linker during all build types.
71
+ CMAKE_EXE_LINKER_FLAGS:STRING=
72
+
73
+ //Flags used by the linker during DEBUG builds.
74
+ CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL
75
+
76
+ //Flags used by the linker during MINSIZEREL builds.
77
+ CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO
78
+
79
+ //Flags used by the linker during RELEASE builds.
80
+ CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO
81
+
82
+ //Flags used by the linker during RELWITHDEBINFO builds.
83
+ CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL
84
+
85
+ //Value Computed by CMake.
86
+ CMAKE_FIND_PACKAGE_REDIRECTS_DIR:STATIC=E:/Fashion_MNIST_Optic_Evolution/build/CMakeFiles/pkgRedirects
87
+
88
+ //Install path prefix, prepended onto install directories.
89
+ CMAKE_INSTALL_PREFIX:PATH=C:/Program Files
90
+
91
+ //Path to a program.
92
+ CMAKE_LINKER:FILEPATH=C:/Program Files/Git/usr/bin/link.exe
93
+
94
+ //Flags used by the linker during the creation of modules during
95
+ // all build types.
96
+ CMAKE_MODULE_LINKER_FLAGS:STRING=
97
+
98
+ //Flags used by the linker during the creation of modules during
99
+ // DEBUG builds.
100
+ CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL
101
+
102
+ //Flags used by the linker during the creation of modules during
103
+ // MINSIZEREL builds.
104
+ CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO
105
+
106
+ //Flags used by the linker during the creation of modules during
107
+ // RELEASE builds.
108
+ CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO
109
+
110
+ //Flags used by the linker during the creation of modules during
111
+ // RELWITHDEBINFO builds.
112
+ CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL
113
+
114
+ //Path to a program.
115
+ CMAKE_MT:FILEPATH=CMAKE_MT-NOTFOUND
116
+
117
+ //Value Computed by CMake
118
+ CMAKE_PROJECT_DESCRIPTION:STATIC=
119
+
120
+ //Value Computed by CMake
121
+ CMAKE_PROJECT_HOMEPAGE_URL:STATIC=
122
+
123
+ //Value Computed by CMake
124
+ CMAKE_PROJECT_NAME:STATIC=fashion_mnist_trainer
125
+
126
+ //RC compiler
127
+ CMAKE_RC_COMPILER:FILEPATH=rc
128
+
129
+ //Flags for Windows Resource Compiler during all build types.
130
+ CMAKE_RC_FLAGS:STRING=-DWIN32
131
+
132
+ //Flags for Windows Resource Compiler during DEBUG builds.
133
+ CMAKE_RC_FLAGS_DEBUG:STRING=-D_DEBUG
134
+
135
+ //Flags for Windows Resource Compiler during MINSIZEREL builds.
136
+ CMAKE_RC_FLAGS_MINSIZEREL:STRING=
137
+
138
+ //Flags for Windows Resource Compiler during RELEASE builds.
139
+ CMAKE_RC_FLAGS_RELEASE:STRING=
140
+
141
+ //Flags for Windows Resource Compiler during RELWITHDEBINFO builds.
142
+ CMAKE_RC_FLAGS_RELWITHDEBINFO:STRING=
143
+
144
+ //Flags used by the linker during the creation of shared libraries
145
+ // during all build types.
146
+ CMAKE_SHARED_LINKER_FLAGS:STRING=
147
+
148
+ //Flags used by the linker during the creation of shared libraries
149
+ // during DEBUG builds.
150
+ CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL
151
+
152
+ //Flags used by the linker during the creation of shared libraries
153
+ // during MINSIZEREL builds.
154
+ CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO
155
+
156
+ //Flags used by the linker during the creation of shared libraries
157
+ // during RELEASE builds.
158
+ CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO
159
+
160
+ //Flags used by the linker during the creation of shared libraries
161
+ // during RELWITHDEBINFO builds.
162
+ CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL
163
+
164
+ //If set, runtime paths are not added when installing shared libraries,
165
+ // but are added when building.
166
+ CMAKE_SKIP_INSTALL_RPATH:BOOL=NO
167
+
168
+ //If set, runtime paths are not added when using shared libraries.
169
+ CMAKE_SKIP_RPATH:BOOL=NO
170
+
171
+ //Flags used by the linker during the creation of static libraries
172
+ // during all build types.
173
+ CMAKE_STATIC_LINKER_FLAGS:STRING=
174
+
175
+ //Flags used by the linker during the creation of static libraries
176
+ // during DEBUG builds.
177
+ CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING=
178
+
179
+ //Flags used by the linker during the creation of static libraries
180
+ // during MINSIZEREL builds.
181
+ CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING=
182
+
183
+ //Flags used by the linker during the creation of static libraries
184
+ // during RELEASE builds.
185
+ CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING=
186
+
187
+ //Flags used by the linker during the creation of static libraries
188
+ // during RELWITHDEBINFO builds.
189
+ CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING=
190
+
191
+ //If this value is on, makefiles will be generated without the
192
+ // .SILENT directive, and all commands will be echoed to the console
193
+ // during the make. This is useful for debugging only. With Visual
194
+ // Studio IDE projects all commands are done without /nologo.
195
+ CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE
196
+
197
+ //Path to a file.
198
+ CUDAToolkit_CUPTI_INCLUDE_DIR:PATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/include/../extras/CUPTI/include
199
+
200
+ //Path to a library.
201
+ CUDA_CUDART:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64/cudart.lib
202
+
203
+ //Path to a library.
204
+ CUDA_OpenCL_LIBRARY:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64/OpenCL.lib
205
+
206
+ //Path to a library.
207
+ CUDA_cuFile_LIBRARY:FILEPATH=CUDA_cuFile_LIBRARY-NOTFOUND
208
+
209
+ //Path to a library.
210
+ CUDA_cuFile_rdma_LIBRARY:FILEPATH=CUDA_cuFile_rdma_LIBRARY-NOTFOUND
211
+
212
+ //Path to a library.
213
+ CUDA_cuFile_rdma_static_LIBRARY:FILEPATH=CUDA_cuFile_rdma_static_LIBRARY-NOTFOUND
214
+
215
+ //Path to a library.
216
+ CUDA_cuFile_static_LIBRARY:FILEPATH=CUDA_cuFile_static_LIBRARY-NOTFOUND
217
+
218
+ //Path to a library.
219
+ CUDA_cublasLt_LIBRARY:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64/cublasLt.lib
220
+
221
+ //Path to a library.
222
+ CUDA_cublasLt_static_LIBRARY:FILEPATH=CUDA_cublasLt_static_LIBRARY-NOTFOUND
223
+
224
+ //Path to a library.
225
+ CUDA_cublas_LIBRARY:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64/cublas.lib
226
+
227
+ //Path to a library.
228
+ CUDA_cublas_static_LIBRARY:FILEPATH=CUDA_cublas_static_LIBRARY-NOTFOUND
229
+
230
+ //Path to a library.
231
+ CUDA_cuda_driver_LIBRARY:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64/cuda.lib
232
+
233
+ //Path to a library.
234
+ CUDA_cudart_LIBRARY:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64/cudart.lib
235
+
236
+ //Path to a library.
237
+ CUDA_cudart_static_LIBRARY:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64/cudart_static.lib
238
+
239
+ //Path to a library.
240
+ CUDA_cudla_LIBRARY:FILEPATH=CUDA_cudla_LIBRARY-NOTFOUND
241
+
242
+ //Path to a library.
243
+ CUDA_cufft_LIBRARY:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64/cufft.lib
244
+
245
+ //Path to a library.
246
+ CUDA_cufft_static_LIBRARY:FILEPATH=CUDA_cufft_static_LIBRARY-NOTFOUND
247
+
248
+ //Path to a library.
249
+ CUDA_cufft_static_nocallback_LIBRARY:FILEPATH=CUDA_cufft_static_nocallback_LIBRARY-NOTFOUND
250
+
251
+ //Path to a library.
252
+ CUDA_cufftw_LIBRARY:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64/cufftw.lib
253
+
254
+ //Path to a library.
255
+ CUDA_cufftw_static_LIBRARY:FILEPATH=CUDA_cufftw_static_LIBRARY-NOTFOUND
256
+
257
+ //Path to a library.
258
+ CUDA_culibos_LIBRARY:FILEPATH=CUDA_culibos_LIBRARY-NOTFOUND
259
+
260
+ //Path to a library.
261
+ CUDA_cupti_LIBRARY:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/extras/CUPTI/lib64/cupti.lib
262
+
263
+ //Path to a library.
264
+ CUDA_cupti_static_LIBRARY:FILEPATH=CUDA_cupti_static_LIBRARY-NOTFOUND
265
+
266
+ //Path to a library.
267
+ CUDA_curand_LIBRARY:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64/curand.lib
268
+
269
+ //Path to a library.
270
+ CUDA_curand_static_LIBRARY:FILEPATH=CUDA_curand_static_LIBRARY-NOTFOUND
271
+
272
+ //Path to a library.
273
+ CUDA_cusolver_LIBRARY:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64/cusolver.lib
274
+
275
+ //Path to a library.
276
+ CUDA_cusolver_lapack_static_LIBRARY:FILEPATH=CUDA_cusolver_lapack_static_LIBRARY-NOTFOUND
277
+
278
+ //Path to a library.
279
+ CUDA_cusolver_metis_static_LIBRARY:FILEPATH=CUDA_cusolver_metis_static_LIBRARY-NOTFOUND
280
+
281
+ //Path to a library.
282
+ CUDA_cusolver_static_LIBRARY:FILEPATH=CUDA_cusolver_static_LIBRARY-NOTFOUND
283
+
284
+ //Path to a library.
285
+ CUDA_cusparse_LIBRARY:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64/cusparse.lib
286
+
287
+ //Path to a library.
288
+ CUDA_cusparse_static_LIBRARY:FILEPATH=CUDA_cusparse_static_LIBRARY-NOTFOUND
289
+
290
+ //Path to a library.
291
+ CUDA_nppc_LIBRARY:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64/nppc.lib
292
+
293
+ //Path to a library.
294
+ CUDA_nppc_static_LIBRARY:FILEPATH=CUDA_nppc_static_LIBRARY-NOTFOUND
295
+
296
+ //Path to a library.
297
+ CUDA_nppial_LIBRARY:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64/nppial.lib
298
+
299
+ //Path to a library.
300
+ CUDA_nppial_static_LIBRARY:FILEPATH=CUDA_nppial_static_LIBRARY-NOTFOUND
301
+
302
+ //Path to a library.
303
+ CUDA_nppicc_LIBRARY:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64/nppicc.lib
304
+
305
+ //Path to a library.
306
+ CUDA_nppicc_static_LIBRARY:FILEPATH=CUDA_nppicc_static_LIBRARY-NOTFOUND
307
+
308
+ //Path to a library.
309
+ CUDA_nppicom_LIBRARY:FILEPATH=CUDA_nppicom_LIBRARY-NOTFOUND
310
+
311
+ //Path to a library.
312
+ CUDA_nppicom_static_LIBRARY:FILEPATH=CUDA_nppicom_static_LIBRARY-NOTFOUND
313
+
314
+ //Path to a library.
315
+ CUDA_nppidei_LIBRARY:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64/nppidei.lib
316
+
317
+ //Path to a library.
318
+ CUDA_nppidei_static_LIBRARY:FILEPATH=CUDA_nppidei_static_LIBRARY-NOTFOUND
319
+
320
+ //Path to a library.
321
+ CUDA_nppif_LIBRARY:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64/nppif.lib
322
+
323
+ //Path to a library.
324
+ CUDA_nppif_static_LIBRARY:FILEPATH=CUDA_nppif_static_LIBRARY-NOTFOUND
325
+
326
+ //Path to a library.
327
+ CUDA_nppig_LIBRARY:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64/nppig.lib
328
+
329
+ //Path to a library.
330
+ CUDA_nppig_static_LIBRARY:FILEPATH=CUDA_nppig_static_LIBRARY-NOTFOUND
331
+
332
+ //Path to a library.
333
+ CUDA_nppim_LIBRARY:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64/nppim.lib
334
+
335
+ //Path to a library.
336
+ CUDA_nppim_static_LIBRARY:FILEPATH=CUDA_nppim_static_LIBRARY-NOTFOUND
337
+
338
+ //Path to a library.
339
+ CUDA_nppist_LIBRARY:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64/nppist.lib
340
+
341
+ //Path to a library.
342
+ CUDA_nppist_static_LIBRARY:FILEPATH=CUDA_nppist_static_LIBRARY-NOTFOUND
343
+
344
+ //Path to a library.
345
+ CUDA_nppisu_LIBRARY:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64/nppisu.lib
346
+
347
+ //Path to a library.
348
+ CUDA_nppisu_static_LIBRARY:FILEPATH=CUDA_nppisu_static_LIBRARY-NOTFOUND
349
+
350
+ //Path to a library.
351
+ CUDA_nppitc_LIBRARY:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64/nppitc.lib
352
+
353
+ //Path to a library.
354
+ CUDA_nppitc_static_LIBRARY:FILEPATH=CUDA_nppitc_static_LIBRARY-NOTFOUND
355
+
356
+ //Path to a library.
357
+ CUDA_npps_LIBRARY:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64/npps.lib
358
+
359
+ //Path to a library.
360
+ CUDA_npps_static_LIBRARY:FILEPATH=CUDA_npps_static_LIBRARY-NOTFOUND
361
+
362
+ //Path to a library.
363
+ CUDA_nvJitLink_LIBRARY:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64/nvJitLink.lib
364
+
365
+ //Path to a library.
366
+ CUDA_nvJitLink_static_LIBRARY:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64/nvJitLink_static.lib
367
+
368
+ //Path to a library.
369
+ CUDA_nvToolsExt_LIBRARY:FILEPATH=CUDA_nvToolsExt_LIBRARY-NOTFOUND
370
+
371
+ //Path to a library.
372
+ CUDA_nvfatbin_LIBRARY:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64/nvfatbin.lib
373
+
374
+ //Path to a library.
375
+ CUDA_nvfatbin_static_LIBRARY:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64/nvfatbin_static.lib
376
+
377
+ //Path to a library.
378
+ CUDA_nvgraph_LIBRARY:FILEPATH=CUDA_nvgraph_LIBRARY-NOTFOUND
379
+
380
+ //Path to a library.
381
+ CUDA_nvgraph_static_LIBRARY:FILEPATH=CUDA_nvgraph_static_LIBRARY-NOTFOUND
382
+
383
+ //Path to a library.
384
+ CUDA_nvjpeg_LIBRARY:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64/nvjpeg.lib
385
+
386
+ //Path to a library.
387
+ CUDA_nvjpeg_static_LIBRARY:FILEPATH=CUDA_nvjpeg_static_LIBRARY-NOTFOUND
388
+
389
+ //Path to a library.
390
+ CUDA_nvml_LIBRARY:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64/nvml.lib
391
+
392
+ //Path to a library.
393
+ CUDA_nvml_static_LIBRARY:FILEPATH=CUDA_nvml_static_LIBRARY-NOTFOUND
394
+
395
+ //Path to a library.
396
+ CUDA_nvperf_host_LIBRARY:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/extras/CUPTI/lib64/nvperf_host.lib
397
+
398
+ //Path to a library.
399
+ CUDA_nvperf_host_static_LIBRARY:FILEPATH=CUDA_nvperf_host_static_LIBRARY-NOTFOUND
400
+
401
+ //Path to a library.
402
+ CUDA_nvperf_target_LIBRARY:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/extras/CUPTI/lib64/nvperf_target.lib
403
+
404
+ //Path to a library.
405
+ CUDA_nvptxcompiler_static_LIBRARY:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64/nvptxcompiler_static.lib
406
+
407
+ //Path to a library.
408
+ CUDA_nvrtc_LIBRARY:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64/nvrtc.lib
409
+
410
+ //Path to a library.
411
+ CUDA_nvrtc_builtins_LIBRARY:FILEPATH=CUDA_nvrtc_builtins_LIBRARY-NOTFOUND
412
+
413
+ //Path to a library.
414
+ CUDA_nvrtc_builtins_static_LIBRARY:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64/nvrtc-builtins_static.lib
415
+
416
+ //Path to a library.
417
+ CUDA_nvrtc_static_LIBRARY:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64/nvrtc_static.lib
418
+
419
+ //Path to a library.
420
+ CUDA_pcsamplingutil_LIBRARY:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/extras/CUPTI/lib64/pcsamplingutil.lib
421
+
422
+ //Value Computed by CMake
423
+ fashion_mnist_trainer_BINARY_DIR:STATIC=E:/Fashion_MNIST_Optic_Evolution/build
424
+
425
+ //Value Computed by CMake
426
+ fashion_mnist_trainer_IS_TOP_LEVEL:STATIC=ON
427
+
428
+ //Value Computed by CMake
429
+ fashion_mnist_trainer_SOURCE_DIR:STATIC=E:/Fashion_MNIST_Optic_Evolution
430
+
431
+
432
+ ########################
433
+ # INTERNAL cache entries
434
+ ########################
435
+
436
+ //ADVANCED property for variable: CMAKE_AR
437
+ CMAKE_AR-ADVANCED:INTERNAL=1
438
+ //This is the directory where this CMakeCache.txt was created
439
+ CMAKE_CACHEFILE_DIR:INTERNAL=e:/Fashion_MNIST_Optic_Evolution/build
440
+ //Major version of cmake used to create the current loaded cache
441
+ CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3
442
+ //Minor version of cmake used to create the current loaded cache
443
+ CMAKE_CACHE_MINOR_VERSION:INTERNAL=31
444
+ //Patch version of cmake used to create the current loaded cache
445
+ CMAKE_CACHE_PATCH_VERSION:INTERNAL=4
446
+ //Path to CMake executable.
447
+ CMAKE_COMMAND:INTERNAL=C:/Program Files/CMake/bin/cmake.exe
448
+ //Path to cpack program executable.
449
+ CMAKE_CPACK_COMMAND:INTERNAL=C:/Program Files/CMake/bin/cpack.exe
450
+ //Path to ctest program executable.
451
+ CMAKE_CTEST_COMMAND:INTERNAL=C:/Program Files/CMake/bin/ctest.exe
452
+ //ADVANCED property for variable: CMAKE_CUDA_COMPILER
453
+ CMAKE_CUDA_COMPILER-ADVANCED:INTERNAL=1
454
+ //ADVANCED property for variable: CMAKE_CUDA_FLAGS
455
+ CMAKE_CUDA_FLAGS-ADVANCED:INTERNAL=1
456
+ //ADVANCED property for variable: CMAKE_CUDA_FLAGS_DEBUG
457
+ CMAKE_CUDA_FLAGS_DEBUG-ADVANCED:INTERNAL=1
458
+ //ADVANCED property for variable: CMAKE_CUDA_FLAGS_MINSIZEREL
459
+ CMAKE_CUDA_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
460
+ //ADVANCED property for variable: CMAKE_CUDA_FLAGS_RELEASE
461
+ CMAKE_CUDA_FLAGS_RELEASE-ADVANCED:INTERNAL=1
462
+ //ADVANCED property for variable: CMAKE_CUDA_FLAGS_RELWITHDEBINFO
463
+ CMAKE_CUDA_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
464
+ //ADVANCED property for variable: CMAKE_CUDA_STANDARD_LIBRARIES
465
+ CMAKE_CUDA_STANDARD_LIBRARIES-ADVANCED:INTERNAL=1
466
+ //ADVANCED property for variable: CMAKE_CXX_FLAGS
467
+ CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1
468
+ //ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG
469
+ CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1
470
+ //ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL
471
+ CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
472
+ //ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE
473
+ CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1
474
+ //ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO
475
+ CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
476
+ //ADVANCED property for variable: CMAKE_CXX_STANDARD_LIBRARIES
477
+ CMAKE_CXX_STANDARD_LIBRARIES-ADVANCED:INTERNAL=1
478
+ //Executable file format
479
+ CMAKE_EXECUTABLE_FORMAT:INTERNAL=Unknown
480
+ //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS
481
+ CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1
482
+ //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG
483
+ CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
484
+ //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL
485
+ CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
486
+ //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE
487
+ CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
488
+ //ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
489
+ CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
490
+ //Name of external makefile project generator.
491
+ CMAKE_EXTRA_GENERATOR:INTERNAL=
492
+ //Name of generator.
493
+ CMAKE_GENERATOR:INTERNAL=Visual Studio 17 2022
494
+ //Generator instance identifier.
495
+ CMAKE_GENERATOR_INSTANCE:INTERNAL=E:/VS2022
496
+ //Name of generator platform.
497
+ CMAKE_GENERATOR_PLATFORM:INTERNAL=x64
498
+ //Name of generator toolset.
499
+ CMAKE_GENERATOR_TOOLSET:INTERNAL=cuda=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0
500
+ //Source directory with the top level CMakeLists.txt file for this
501
+ // project
502
+ CMAKE_HOME_DIRECTORY:INTERNAL=E:/Fashion_MNIST_Optic_Evolution
503
+ //ADVANCED property for variable: CMAKE_LINKER
504
+ CMAKE_LINKER-ADVANCED:INTERNAL=1
505
+ //ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS
506
+ CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1
507
+ //ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG
508
+ CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
509
+ //ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL
510
+ CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
511
+ //ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE
512
+ CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
513
+ //ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
514
+ CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
515
+ //ADVANCED property for variable: CMAKE_MT
516
+ CMAKE_MT-ADVANCED:INTERNAL=1
517
+ //number of local generators
518
+ CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1
519
+ //Platform information initialized
520
+ CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1
521
+ //noop for ranlib
522
+ CMAKE_RANLIB:INTERNAL=:
523
+ //ADVANCED property for variable: CMAKE_RC_COMPILER
524
+ CMAKE_RC_COMPILER-ADVANCED:INTERNAL=1
525
+ CMAKE_RC_COMPILER_WORKS:INTERNAL=1
526
+ //ADVANCED property for variable: CMAKE_RC_FLAGS
527
+ CMAKE_RC_FLAGS-ADVANCED:INTERNAL=1
528
+ //ADVANCED property for variable: CMAKE_RC_FLAGS_DEBUG
529
+ CMAKE_RC_FLAGS_DEBUG-ADVANCED:INTERNAL=1
530
+ //ADVANCED property for variable: CMAKE_RC_FLAGS_MINSIZEREL
531
+ CMAKE_RC_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
532
+ //ADVANCED property for variable: CMAKE_RC_FLAGS_RELEASE
533
+ CMAKE_RC_FLAGS_RELEASE-ADVANCED:INTERNAL=1
534
+ //ADVANCED property for variable: CMAKE_RC_FLAGS_RELWITHDEBINFO
535
+ CMAKE_RC_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
536
+ //Path to CMake installation.
537
+ CMAKE_ROOT:INTERNAL=C:/Program Files/CMake/share/cmake-3.31
538
+ //ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS
539
+ CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1
540
+ //ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG
541
+ CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
542
+ //ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL
543
+ CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
544
+ //ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE
545
+ CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
546
+ //ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
547
+ CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
548
+ //ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH
549
+ CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1
550
+ //ADVANCED property for variable: CMAKE_SKIP_RPATH
551
+ CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1
552
+ //ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS
553
+ CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1
554
+ //ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG
555
+ CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
556
+ //ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL
557
+ CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
558
+ //ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE
559
+ CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
560
+ //ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO
561
+ CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
562
+ //ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE
563
+ CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1
564
+ //ADVANCED property for variable: CUDAToolkit_CUPTI_INCLUDE_DIR
565
+ CUDAToolkit_CUPTI_INCLUDE_DIR-ADVANCED:INTERNAL=1
566
+ //ADVANCED property for variable: CUDA_CUDART
567
+ CUDA_CUDART-ADVANCED:INTERNAL=1
568
+ //ADVANCED property for variable: CUDA_OpenCL_LIBRARY
569
+ CUDA_OpenCL_LIBRARY-ADVANCED:INTERNAL=1
570
+ //ADVANCED property for variable: CUDA_cuFile_LIBRARY
571
+ CUDA_cuFile_LIBRARY-ADVANCED:INTERNAL=1
572
+ //ADVANCED property for variable: CUDA_cuFile_rdma_LIBRARY
573
+ CUDA_cuFile_rdma_LIBRARY-ADVANCED:INTERNAL=1
574
+ //ADVANCED property for variable: CUDA_cuFile_rdma_static_LIBRARY
575
+ CUDA_cuFile_rdma_static_LIBRARY-ADVANCED:INTERNAL=1
576
+ //ADVANCED property for variable: CUDA_cuFile_static_LIBRARY
577
+ CUDA_cuFile_static_LIBRARY-ADVANCED:INTERNAL=1
578
+ //ADVANCED property for variable: CUDA_cublasLt_LIBRARY
579
+ CUDA_cublasLt_LIBRARY-ADVANCED:INTERNAL=1
580
+ //ADVANCED property for variable: CUDA_cublasLt_static_LIBRARY
581
+ CUDA_cublasLt_static_LIBRARY-ADVANCED:INTERNAL=1
582
+ //ADVANCED property for variable: CUDA_cublas_LIBRARY
583
+ CUDA_cublas_LIBRARY-ADVANCED:INTERNAL=1
584
+ //ADVANCED property for variable: CUDA_cublas_static_LIBRARY
585
+ CUDA_cublas_static_LIBRARY-ADVANCED:INTERNAL=1
586
+ //ADVANCED property for variable: CUDA_cuda_driver_LIBRARY
587
+ CUDA_cuda_driver_LIBRARY-ADVANCED:INTERNAL=1
588
+ //ADVANCED property for variable: CUDA_cudart_LIBRARY
589
+ CUDA_cudart_LIBRARY-ADVANCED:INTERNAL=1
590
+ //ADVANCED property for variable: CUDA_cudart_static_LIBRARY
591
+ CUDA_cudart_static_LIBRARY-ADVANCED:INTERNAL=1
592
+ //ADVANCED property for variable: CUDA_cudla_LIBRARY
593
+ CUDA_cudla_LIBRARY-ADVANCED:INTERNAL=1
594
+ //ADVANCED property for variable: CUDA_cufft_LIBRARY
595
+ CUDA_cufft_LIBRARY-ADVANCED:INTERNAL=1
596
+ //ADVANCED property for variable: CUDA_cufft_static_LIBRARY
597
+ CUDA_cufft_static_LIBRARY-ADVANCED:INTERNAL=1
598
+ //ADVANCED property for variable: CUDA_cufft_static_nocallback_LIBRARY
599
+ CUDA_cufft_static_nocallback_LIBRARY-ADVANCED:INTERNAL=1
600
+ //ADVANCED property for variable: CUDA_cufftw_LIBRARY
601
+ CUDA_cufftw_LIBRARY-ADVANCED:INTERNAL=1
602
+ //ADVANCED property for variable: CUDA_cufftw_static_LIBRARY
603
+ CUDA_cufftw_static_LIBRARY-ADVANCED:INTERNAL=1
604
+ //ADVANCED property for variable: CUDA_culibos_LIBRARY
605
+ CUDA_culibos_LIBRARY-ADVANCED:INTERNAL=1
606
+ //ADVANCED property for variable: CUDA_cupti_LIBRARY
607
+ CUDA_cupti_LIBRARY-ADVANCED:INTERNAL=1
608
+ //ADVANCED property for variable: CUDA_cupti_static_LIBRARY
609
+ CUDA_cupti_static_LIBRARY-ADVANCED:INTERNAL=1
610
+ //ADVANCED property for variable: CUDA_curand_LIBRARY
611
+ CUDA_curand_LIBRARY-ADVANCED:INTERNAL=1
612
+ //ADVANCED property for variable: CUDA_curand_static_LIBRARY
613
+ CUDA_curand_static_LIBRARY-ADVANCED:INTERNAL=1
614
+ //ADVANCED property for variable: CUDA_cusolver_LIBRARY
615
+ CUDA_cusolver_LIBRARY-ADVANCED:INTERNAL=1
616
+ //ADVANCED property for variable: CUDA_cusolver_lapack_static_LIBRARY
617
+ CUDA_cusolver_lapack_static_LIBRARY-ADVANCED:INTERNAL=1
618
+ //ADVANCED property for variable: CUDA_cusolver_metis_static_LIBRARY
619
+ CUDA_cusolver_metis_static_LIBRARY-ADVANCED:INTERNAL=1
620
+ //ADVANCED property for variable: CUDA_cusolver_static_LIBRARY
621
+ CUDA_cusolver_static_LIBRARY-ADVANCED:INTERNAL=1
622
+ //ADVANCED property for variable: CUDA_cusparse_LIBRARY
623
+ CUDA_cusparse_LIBRARY-ADVANCED:INTERNAL=1
624
+ //ADVANCED property for variable: CUDA_cusparse_static_LIBRARY
625
+ CUDA_cusparse_static_LIBRARY-ADVANCED:INTERNAL=1
626
+ //ADVANCED property for variable: CUDA_nppc_LIBRARY
627
+ CUDA_nppc_LIBRARY-ADVANCED:INTERNAL=1
628
+ //ADVANCED property for variable: CUDA_nppc_static_LIBRARY
629
+ CUDA_nppc_static_LIBRARY-ADVANCED:INTERNAL=1
630
+ //ADVANCED property for variable: CUDA_nppial_LIBRARY
631
+ CUDA_nppial_LIBRARY-ADVANCED:INTERNAL=1
632
+ //ADVANCED property for variable: CUDA_nppial_static_LIBRARY
633
+ CUDA_nppial_static_LIBRARY-ADVANCED:INTERNAL=1
634
+ //ADVANCED property for variable: CUDA_nppicc_LIBRARY
635
+ CUDA_nppicc_LIBRARY-ADVANCED:INTERNAL=1
636
+ //ADVANCED property for variable: CUDA_nppicc_static_LIBRARY
637
+ CUDA_nppicc_static_LIBRARY-ADVANCED:INTERNAL=1
638
+ //ADVANCED property for variable: CUDA_nppicom_LIBRARY
639
+ CUDA_nppicom_LIBRARY-ADVANCED:INTERNAL=1
640
+ //ADVANCED property for variable: CUDA_nppicom_static_LIBRARY
641
+ CUDA_nppicom_static_LIBRARY-ADVANCED:INTERNAL=1
642
+ //ADVANCED property for variable: CUDA_nppidei_LIBRARY
643
+ CUDA_nppidei_LIBRARY-ADVANCED:INTERNAL=1
644
+ //ADVANCED property for variable: CUDA_nppidei_static_LIBRARY
645
+ CUDA_nppidei_static_LIBRARY-ADVANCED:INTERNAL=1
646
+ //ADVANCED property for variable: CUDA_nppif_LIBRARY
647
+ CUDA_nppif_LIBRARY-ADVANCED:INTERNAL=1
648
+ //ADVANCED property for variable: CUDA_nppif_static_LIBRARY
649
+ CUDA_nppif_static_LIBRARY-ADVANCED:INTERNAL=1
650
+ //ADVANCED property for variable: CUDA_nppig_LIBRARY
651
+ CUDA_nppig_LIBRARY-ADVANCED:INTERNAL=1
652
+ //ADVANCED property for variable: CUDA_nppig_static_LIBRARY
653
+ CUDA_nppig_static_LIBRARY-ADVANCED:INTERNAL=1
654
+ //ADVANCED property for variable: CUDA_nppim_LIBRARY
655
+ CUDA_nppim_LIBRARY-ADVANCED:INTERNAL=1
656
+ //ADVANCED property for variable: CUDA_nppim_static_LIBRARY
657
+ CUDA_nppim_static_LIBRARY-ADVANCED:INTERNAL=1
658
+ //ADVANCED property for variable: CUDA_nppist_LIBRARY
659
+ CUDA_nppist_LIBRARY-ADVANCED:INTERNAL=1
660
+ //ADVANCED property for variable: CUDA_nppist_static_LIBRARY
661
+ CUDA_nppist_static_LIBRARY-ADVANCED:INTERNAL=1
662
+ //ADVANCED property for variable: CUDA_nppisu_LIBRARY
663
+ CUDA_nppisu_LIBRARY-ADVANCED:INTERNAL=1
664
+ //ADVANCED property for variable: CUDA_nppisu_static_LIBRARY
665
+ CUDA_nppisu_static_LIBRARY-ADVANCED:INTERNAL=1
666
+ //ADVANCED property for variable: CUDA_nppitc_LIBRARY
667
+ CUDA_nppitc_LIBRARY-ADVANCED:INTERNAL=1
668
+ //ADVANCED property for variable: CUDA_nppitc_static_LIBRARY
669
+ CUDA_nppitc_static_LIBRARY-ADVANCED:INTERNAL=1
670
+ //ADVANCED property for variable: CUDA_npps_LIBRARY
671
+ CUDA_npps_LIBRARY-ADVANCED:INTERNAL=1
672
+ //ADVANCED property for variable: CUDA_npps_static_LIBRARY
673
+ CUDA_npps_static_LIBRARY-ADVANCED:INTERNAL=1
674
+ //ADVANCED property for variable: CUDA_nvJitLink_LIBRARY
675
+ CUDA_nvJitLink_LIBRARY-ADVANCED:INTERNAL=1
676
+ //ADVANCED property for variable: CUDA_nvJitLink_static_LIBRARY
677
+ CUDA_nvJitLink_static_LIBRARY-ADVANCED:INTERNAL=1
678
+ //ADVANCED property for variable: CUDA_nvToolsExt_LIBRARY
679
+ CUDA_nvToolsExt_LIBRARY-ADVANCED:INTERNAL=1
680
+ //ADVANCED property for variable: CUDA_nvfatbin_LIBRARY
681
+ CUDA_nvfatbin_LIBRARY-ADVANCED:INTERNAL=1
682
+ //ADVANCED property for variable: CUDA_nvfatbin_static_LIBRARY
683
+ CUDA_nvfatbin_static_LIBRARY-ADVANCED:INTERNAL=1
684
+ //ADVANCED property for variable: CUDA_nvgraph_LIBRARY
685
+ CUDA_nvgraph_LIBRARY-ADVANCED:INTERNAL=1
686
+ //ADVANCED property for variable: CUDA_nvgraph_static_LIBRARY
687
+ CUDA_nvgraph_static_LIBRARY-ADVANCED:INTERNAL=1
688
+ //ADVANCED property for variable: CUDA_nvjpeg_LIBRARY
689
+ CUDA_nvjpeg_LIBRARY-ADVANCED:INTERNAL=1
690
+ //ADVANCED property for variable: CUDA_nvjpeg_static_LIBRARY
691
+ CUDA_nvjpeg_static_LIBRARY-ADVANCED:INTERNAL=1
692
+ //ADVANCED property for variable: CUDA_nvml_LIBRARY
693
+ CUDA_nvml_LIBRARY-ADVANCED:INTERNAL=1
694
+ //ADVANCED property for variable: CUDA_nvml_static_LIBRARY
695
+ CUDA_nvml_static_LIBRARY-ADVANCED:INTERNAL=1
696
+ //ADVANCED property for variable: CUDA_nvperf_host_LIBRARY
697
+ CUDA_nvperf_host_LIBRARY-ADVANCED:INTERNAL=1
698
+ //ADVANCED property for variable: CUDA_nvperf_host_static_LIBRARY
699
+ CUDA_nvperf_host_static_LIBRARY-ADVANCED:INTERNAL=1
700
+ //ADVANCED property for variable: CUDA_nvperf_target_LIBRARY
701
+ CUDA_nvperf_target_LIBRARY-ADVANCED:INTERNAL=1
702
+ //ADVANCED property for variable: CUDA_nvptxcompiler_static_LIBRARY
703
+ CUDA_nvptxcompiler_static_LIBRARY-ADVANCED:INTERNAL=1
704
+ //ADVANCED property for variable: CUDA_nvrtc_LIBRARY
705
+ CUDA_nvrtc_LIBRARY-ADVANCED:INTERNAL=1
706
+ //ADVANCED property for variable: CUDA_nvrtc_builtins_LIBRARY
707
+ CUDA_nvrtc_builtins_LIBRARY-ADVANCED:INTERNAL=1
708
+ //ADVANCED property for variable: CUDA_nvrtc_builtins_static_LIBRARY
709
+ CUDA_nvrtc_builtins_static_LIBRARY-ADVANCED:INTERNAL=1
710
+ //ADVANCED property for variable: CUDA_nvrtc_static_LIBRARY
711
+ CUDA_nvrtc_static_LIBRARY-ADVANCED:INTERNAL=1
712
+ //ADVANCED property for variable: CUDA_pcsamplingutil_LIBRARY
713
+ CUDA_pcsamplingutil_LIBRARY-ADVANCED:INTERNAL=1
714
+ //Details about finding CUDAToolkit
715
+ FIND_PACKAGE_MESSAGE_DETAILS_CUDAToolkit:INTERNAL=[C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/include;C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/include/cccl][C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64/cudart.lib][C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/bin][v13.0.48()]
716
+
CMakeLists.txt ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ cmake_minimum_required(VERSION 3.18)
2
+ project(cancer_trainer LANGUAGES CXX CUDA)
3
+
4
+ set(CMAKE_CXX_STANDARD 17)
5
+ set(CMAKE_CUDA_STANDARD 17)
6
+
7
+ if (MSVC)
8
+ add_compile_options(/O2 /W4)
9
+ else()
10
+ add_compile_options(-O3 -ffast-math -fno-math-errno -fno-trapping-math -Wall -Wextra -Wno-unused-parameter)
11
+ endif()
12
+
13
+ enable_language(CUDA)
14
+ set(CMAKE_CUDA_ARCHITECTURES 75 80 86) # Turing, Ampere
15
+
16
+ find_package(CUDAToolkit REQUIRED)
17
+ add_definitions(-D_FORCE_INLINES)
18
+
19
+ # Tell CMake where to find stb_image.h
20
+ target_include_directories(cancer_trainer PRIVATE vendor)
21
+
22
+ file(GLOB SRC "src/*.cpp" "src/*.hpp" "src/*.cu")
23
+ add_executable(cancer_trainer ${SRC})
24
+ target_link_libraries(cancer_trainer PRIVATE CUDA::cudart CUDA::cufft)
25
+ target_compile_options(cancer_trainer PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:-use_fast_math>)
26
+
27
+ # Define STB_IMAGE_IMPLEMENTATION in only one compilation unit
28
+ set_source_files_properties(src/data_loader.cpp PROPERTIES
29
+ COMPILE_DEFINITIONS STB_IMAGE_IMPLEMENTATION
30
+ )```
31
+
32
+ #### `vendor/stb_image.h`
33
+ *Descarga y coloca el fichero `stb_image.h` de la [fuente oficial](https://github.com/nothings/stb/blob/master/stb_image.h) en esta carpeta.*
34
+
35
+ #### `src/utils.hpp`
36
+ ```cpp
37
+ #pragma once
38
+ #include <string>
39
+ #include <vector>
40
+ #include <cuda_runtime.h>
41
+
42
+ void check_cuda(cudaError_t st, const char* msg);
43
+ void write_submission_csv(const std::string& path,
44
+ const std::vector<std::string>& ids,
45
+ const std::vector<float>& probabilities);
Structure.txt ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ cancer_detection/
2
+ ├─ CMakeLists.txt
3
+ ├─ README_RUN.md
4
+ ├─ vendor/
5
+ │ └─ stb_image.h <-- (Debes descargar y colocar este fichero aquí)
6
+ ├─ src/
7
+ │ ├─ main.cpp
8
+ │ ├─ data_loader.hpp
9
+ │ ├─ data_loader.cpp
10
+ │ ├─ optical_model.hpp
11
+ │ ├─ optical_model.cu
12
+ │ ├─ fungi.hpp
13
+ │ ├─ fungi.cu
14
+ │ ├─ training.hpp
15
+ │ ├─ training.cpp
16
+ │ └─ utils.hpp
17
+ └─ data/
18
+ ├─ train_labels.csv
19
+ ├─ train/
20
+ │ ├─ abc...123.tif
21
+ │ └─ ...
22
+ └─ test/
23
+ ├─ def...456.tif
24
+ └─ ...
25
+
26
+ Aquí tienes el programa completo en C++17/CUDA, diseñado para la competición Histopathologic Cancer Detection de Kaggle. Está totalmente en inglés, optimizado para una RTX 3090, y no utiliza ninguna capa convencional como CNNs o Transformers.
27
+ Puntos Clave de la Adaptación
28
+ Carga de Datos: El programa utiliza la librería stb_image.h (un solo fichero, sin dependencias) para leer las imágenes TIFF directamente desde el disco. Carga las etiquetas del train_labels.csv y asocia los IDs.
29
+ Manejo de Color (RGB): Para mantener la simplicidad y la eficiencia del bloque óptico, las imágenes de 96x96x3 (RGB) se convierten a escala de grises (96x96x1) promediando los canales. Esto enfoca el modelo en la estructura y textura, que son clave en histopatología.
30
+ Modelo de Clasificación: La salida es un único logit (un valor real), ya que es una clasificación binaria. Usamos una función de pérdida Binary Cross-Entropy (BCE), que es el estándar para esta tarea.
31
+ Sistema Micelar: La población de "hongos" evoluciona para generar las máscaras ópticas de 96x96 que mejor discriminan entre tejido sano y tumoral. La "comida" se asigna en función de cómo cada hongo ayuda a reducir el error de clasificación.
32
+ Generación de CSV por Época: Después de cada época de entrenamiento, el programa ejecuta la inferencia sobre todo el conjunto de test y genera un fichero submission_epoch_XX.csv listo para subir a Kaggle. Esto te permite monitorizar el progreso y elegir tu mejor modelo.
33
+ 📦 Estructura del Proyecto
34
+ code
35
+ Code
36
+ cancer_detection/
37
+ ├─ CMakeLists.txt
38
+ ├─ README_RUN.md
39
+ ├─ vendor/
40
+ │ └─ stb_image.h <-- (Debes descargar y colocar este fichero aquí)
41
+ ├─ src/
42
+ │ ├─ main.cpp
43
+ │ ├─ data_loader.hpp
44
+ │ ├─ data_loader.cpp
45
+ │ ├─ optical_model.hpp
46
+ │ ├─ optical_model.cu
47
+ │ ├─ fungi.hpp
48
+ │ ├─ fungi.cu
49
+ │ ├─ training.hpp
50
+ │ ├─ training.cpp
51
+ │ └─ utils.hpp
52
+ └─ data/
53
+ ├─ train_labels.csv
54
+ ├─ train/
55
+ │ ├─ abc...123.tif
56
+ │ └─ ...
57
+ └─ test/
58
+ ├─ def...456.tif
59
+ └─ ...
60
+ 🛠️ Build & Run (Instructions in English)
61
+ (Contenido del fichero README_RUN.md)
62
+ Mycelium-Optical Cancer Detection (C++/CUDA)
63
+ This project implements a non-conventional optical/evolutionary model for the Kaggle Histopathologic Cancer Detection competition.
64
+ Architecture:
65
+ Input: 96x96 RGB images, converted to grayscale.
66
+ Optical Block: A population of evolving "fungi" generates 96x96 amplitude and phase masks.
67
+ Propagation: 2D FFT propagation using batched cuFFT.
68
+ Detector: Intensity |U|^2 -> log1p non-linearity -> single logit output.
69
+ Training: Custom backpropagation + Mycelial evolution (reward, gravity, reproduction).
70
+ Loss: Binary Cross-Entropy with Logits.
71
+ Requirements:
72
+ Linux (recommended) or Windows with WSL2.
73
+ CUDA Toolkit 11.4+ (optimized for Ampere, e.g., RTX 3090).
74
+ A recent CMake (>= 3.18).
75
+ Download stb_image.h from the official GitHub repo and place it in the vendor/ directory.
76
+ Build:
77
+ code
78
+ Bash
79
+ mkdir build && cd build
80
+ cmake -DCMAKE_BUILD_TYPE=Release ..
81
+ cmake --build . -j
82
+ Run Training & Inference:
83
+ Place the Kaggle data in the data/ directory as shown in the project layout.
84
+ code
85
+ Bash
86
+ ./cancer_trainer --data_dir ../data --epochs 50 --batch 256 --lr 1e-3 --fungi 256
87
+ --data_dir: Path to the directory containing train/, test/, and train_labels.csv.
88
+ --batch: Adjust based on VRAM. 256 works well on an RTX 3090 (24GB).
89
+ --fungi: Number of fungi in the mycelial population.
90
+ The program will save submission_epoch_01.csv, submission_epoch_02.csv, etc., in the execution directory after each epoch.
ZERO_CHECK.vcxproj ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <Project DefaultTargets="Build" ToolsVersion="17.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+ <PropertyGroup>
4
+ <PreferredToolArchitecture>x64</PreferredToolArchitecture>
5
+ </PropertyGroup>
6
+ <PropertyGroup>
7
+ <ResolveNugetPackages>false</ResolveNugetPackages>
8
+ </PropertyGroup>
9
+ <ItemGroup Label="ProjectConfigurations">
10
+ <ProjectConfiguration Include="Debug|x64">
11
+ <Configuration>Debug</Configuration>
12
+ <Platform>x64</Platform>
13
+ </ProjectConfiguration>
14
+ <ProjectConfiguration Include="Release|x64">
15
+ <Configuration>Release</Configuration>
16
+ <Platform>x64</Platform>
17
+ </ProjectConfiguration>
18
+ <ProjectConfiguration Include="MinSizeRel|x64">
19
+ <Configuration>MinSizeRel</Configuration>
20
+ <Platform>x64</Platform>
21
+ </ProjectConfiguration>
22
+ <ProjectConfiguration Include="RelWithDebInfo|x64">
23
+ <Configuration>RelWithDebInfo</Configuration>
24
+ <Platform>x64</Platform>
25
+ </ProjectConfiguration>
26
+ </ItemGroup>
27
+ <PropertyGroup Label="Globals">
28
+ <ProjectGuid>{B4CD8D8C-908F-3E91-878E-AFB61C98E407}</ProjectGuid>
29
+ <Keyword>Win32Proj</Keyword>
30
+ <WindowsTargetPlatformVersion>10.0.26100.0</WindowsTargetPlatformVersion>
31
+ <Platform>x64</Platform>
32
+ <ProjectName>ZERO_CHECK</ProjectName>
33
+ <CudaToolkitCustomDir>C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0\</CudaToolkitCustomDir>
34
+ <VCProjectUpgraderObjectName>NoUpgrade</VCProjectUpgraderObjectName>
35
+ </PropertyGroup>
36
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
37
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
38
+ <ConfigurationType>Utility</ConfigurationType>
39
+ <CharacterSet>MultiByte</CharacterSet>
40
+ <PlatformToolset>v143</PlatformToolset>
41
+ </PropertyGroup>
42
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
43
+ <ConfigurationType>Utility</ConfigurationType>
44
+ <CharacterSet>MultiByte</CharacterSet>
45
+ <PlatformToolset>v143</PlatformToolset>
46
+ </PropertyGroup>
47
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'" Label="Configuration">
48
+ <ConfigurationType>Utility</ConfigurationType>
49
+ <CharacterSet>MultiByte</CharacterSet>
50
+ <PlatformToolset>v143</PlatformToolset>
51
+ </PropertyGroup>
52
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'" Label="Configuration">
53
+ <ConfigurationType>Utility</ConfigurationType>
54
+ <CharacterSet>MultiByte</CharacterSet>
55
+ <PlatformToolset>v143</PlatformToolset>
56
+ </PropertyGroup>
57
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
58
+ <ImportGroup Label="ExtensionSettings">
59
+ <Import Project="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0\extras\visual_studio_integration\MSBuildExtensions\CUDA 13.0.props" />
60
+ </ImportGroup>
61
+ <ImportGroup Label="PropertySheets">
62
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
63
+ </ImportGroup>
64
+ <PropertyGroup Label="UserMacros" />
65
+ <PropertyGroup>
66
+ <_ProjectFileVersion>10.0.20506.1</_ProjectFileVersion>
67
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
68
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
69
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
70
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
71
+ </PropertyGroup>
72
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
73
+ <Midl>
74
+ <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
75
+ <OutputDirectory>$(ProjectDir)/$(IntDir)</OutputDirectory>
76
+ <HeaderFileName>%(Filename).h</HeaderFileName>
77
+ <TypeLibraryName>%(Filename).tlb</TypeLibraryName>
78
+ <InterfaceIdentifierFileName>%(Filename)_i.c</InterfaceIdentifierFileName>
79
+ <ProxyFileName>%(Filename)_p.c</ProxyFileName>
80
+ </Midl>
81
+ </ItemDefinitionGroup>
82
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
83
+ <Midl>
84
+ <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
85
+ <OutputDirectory>$(ProjectDir)/$(IntDir)</OutputDirectory>
86
+ <HeaderFileName>%(Filename).h</HeaderFileName>
87
+ <TypeLibraryName>%(Filename).tlb</TypeLibraryName>
88
+ <InterfaceIdentifierFileName>%(Filename)_i.c</InterfaceIdentifierFileName>
89
+ <ProxyFileName>%(Filename)_p.c</ProxyFileName>
90
+ </Midl>
91
+ </ItemDefinitionGroup>
92
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">
93
+ <Midl>
94
+ <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
95
+ <OutputDirectory>$(ProjectDir)/$(IntDir)</OutputDirectory>
96
+ <HeaderFileName>%(Filename).h</HeaderFileName>
97
+ <TypeLibraryName>%(Filename).tlb</TypeLibraryName>
98
+ <InterfaceIdentifierFileName>%(Filename)_i.c</InterfaceIdentifierFileName>
99
+ <ProxyFileName>%(Filename)_p.c</ProxyFileName>
100
+ </Midl>
101
+ </ItemDefinitionGroup>
102
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">
103
+ <Midl>
104
+ <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
105
+ <OutputDirectory>$(ProjectDir)/$(IntDir)</OutputDirectory>
106
+ <HeaderFileName>%(Filename).h</HeaderFileName>
107
+ <TypeLibraryName>%(Filename).tlb</TypeLibraryName>
108
+ <InterfaceIdentifierFileName>%(Filename)_i.c</InterfaceIdentifierFileName>
109
+ <ProxyFileName>%(Filename)_p.c</ProxyFileName>
110
+ </Midl>
111
+ </ItemDefinitionGroup>
112
+ <ItemGroup>
113
+ <CustomBuild Include="E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\6e114a7c9e7b8616a743eb7ed1a38c30\generate.stamp.rule">
114
+ <UseUtf8Encoding>Always</UseUtf8Encoding>
115
+ <BuildInParallel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</BuildInParallel>
116
+ <Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Checking Build System</Message>
117
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">setlocal
118
+ "C:\Program Files\CMake\bin\cmake.exe" -SE:/Fashion_MNIST_Optic_Evolution -BE:/Fashion_MNIST_Optic_Evolution/build --check-stamp-list CMakeFiles/generate.stamp.list --vs-solution-file E:/Fashion_MNIST_Optic_Evolution/build/fashion_mnist_trainer.sln
119
+ if %errorlevel% neq 0 goto :cmEnd
120
+ :cmEnd
121
+ endlocal &amp; call :cmErrorLevel %errorlevel% &amp; goto :cmDone
122
+ :cmErrorLevel
123
+ exit /b %1
124
+ :cmDone
125
+ if %errorlevel% neq 0 goto :VCEnd</Command>
126
+ <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeCUDAInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeCXXInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeCommonLanguageInclude.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeGenericSystem.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeInitializeConfigs.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeLanguageInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeRCInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeSystemSpecificInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeSystemSpecificInitialize.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CheckLanguage.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\CMakeCommonCompilerMacros.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\MSVC-CXX.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\MSVC.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\NVIDIA-CUDA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\NVIDIA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\FindCUDAToolkit.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\FindPackageHandleStandardArgs.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\FindPackageMessage.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Internal\CMakeCUDALinkerInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Internal\CMakeCXXLinkerInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Internal\CMakeCommonLinkerInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Linker\Windows-MSVC-CUDA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Linker\Windows-MSVC-CXX.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Linker\Windows-MSVC.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-Initialize.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-MSVC-CXX.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-MSVC.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-NVIDIA-CUDA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\WindowsPaths.cmake;E:\Fashion_MNIST_Optic_Evolution\CMakeLists.txt;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeCUDACompiler.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeCXXCompiler.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeRCCompiler.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeSystem.cmake;%(AdditionalInputs)</AdditionalInputs>
127
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\generate.stamp</Outputs>
128
+ <LinkObjects Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkObjects>
129
+ <BuildInParallel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</BuildInParallel>
130
+ <Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Checking Build System</Message>
131
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">setlocal
132
+ "C:\Program Files\CMake\bin\cmake.exe" -SE:/Fashion_MNIST_Optic_Evolution -BE:/Fashion_MNIST_Optic_Evolution/build --check-stamp-list CMakeFiles/generate.stamp.list --vs-solution-file E:/Fashion_MNIST_Optic_Evolution/build/fashion_mnist_trainer.sln
133
+ if %errorlevel% neq 0 goto :cmEnd
134
+ :cmEnd
135
+ endlocal &amp; call :cmErrorLevel %errorlevel% &amp; goto :cmDone
136
+ :cmErrorLevel
137
+ exit /b %1
138
+ :cmDone
139
+ if %errorlevel% neq 0 goto :VCEnd</Command>
140
+ <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeCUDAInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeCXXInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeCommonLanguageInclude.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeGenericSystem.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeInitializeConfigs.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeLanguageInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeRCInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeSystemSpecificInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeSystemSpecificInitialize.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CheckLanguage.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\CMakeCommonCompilerMacros.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\MSVC-CXX.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\MSVC.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\NVIDIA-CUDA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\NVIDIA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\FindCUDAToolkit.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\FindPackageHandleStandardArgs.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\FindPackageMessage.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Internal\CMakeCUDALinkerInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Internal\CMakeCXXLinkerInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Internal\CMakeCommonLinkerInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Linker\Windows-MSVC-CUDA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Linker\Windows-MSVC-CXX.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Linker\Windows-MSVC.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-Initialize.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-MSVC-CXX.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-MSVC.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-NVIDIA-CUDA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\WindowsPaths.cmake;E:\Fashion_MNIST_Optic_Evolution\CMakeLists.txt;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeCUDACompiler.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeCXXCompiler.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeRCCompiler.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeSystem.cmake;%(AdditionalInputs)</AdditionalInputs>
141
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\generate.stamp</Outputs>
142
+ <LinkObjects Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkObjects>
143
+ <BuildInParallel Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">true</BuildInParallel>
144
+ <Message Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">Checking Build System</Message>
145
+ <Command Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">setlocal
146
+ "C:\Program Files\CMake\bin\cmake.exe" -SE:/Fashion_MNIST_Optic_Evolution -BE:/Fashion_MNIST_Optic_Evolution/build --check-stamp-list CMakeFiles/generate.stamp.list --vs-solution-file E:/Fashion_MNIST_Optic_Evolution/build/fashion_mnist_trainer.sln
147
+ if %errorlevel% neq 0 goto :cmEnd
148
+ :cmEnd
149
+ endlocal &amp; call :cmErrorLevel %errorlevel% &amp; goto :cmDone
150
+ :cmErrorLevel
151
+ exit /b %1
152
+ :cmDone
153
+ if %errorlevel% neq 0 goto :VCEnd</Command>
154
+ <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeCUDAInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeCXXInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeCommonLanguageInclude.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeGenericSystem.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeInitializeConfigs.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeLanguageInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeRCInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeSystemSpecificInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeSystemSpecificInitialize.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CheckLanguage.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\CMakeCommonCompilerMacros.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\MSVC-CXX.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\MSVC.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\NVIDIA-CUDA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\NVIDIA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\FindCUDAToolkit.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\FindPackageHandleStandardArgs.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\FindPackageMessage.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Internal\CMakeCUDALinkerInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Internal\CMakeCXXLinkerInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Internal\CMakeCommonLinkerInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Linker\Windows-MSVC-CUDA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Linker\Windows-MSVC-CXX.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Linker\Windows-MSVC.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-Initialize.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-MSVC-CXX.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-MSVC.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-NVIDIA-CUDA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\WindowsPaths.cmake;E:\Fashion_MNIST_Optic_Evolution\CMakeLists.txt;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeCUDACompiler.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeCXXCompiler.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeRCCompiler.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeSystem.cmake;%(AdditionalInputs)</AdditionalInputs>
155
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\generate.stamp</Outputs>
156
+ <LinkObjects Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">false</LinkObjects>
157
+ <BuildInParallel Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">true</BuildInParallel>
158
+ <Message Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">Checking Build System</Message>
159
+ <Command Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">setlocal
160
+ "C:\Program Files\CMake\bin\cmake.exe" -SE:/Fashion_MNIST_Optic_Evolution -BE:/Fashion_MNIST_Optic_Evolution/build --check-stamp-list CMakeFiles/generate.stamp.list --vs-solution-file E:/Fashion_MNIST_Optic_Evolution/build/fashion_mnist_trainer.sln
161
+ if %errorlevel% neq 0 goto :cmEnd
162
+ :cmEnd
163
+ endlocal &amp; call :cmErrorLevel %errorlevel% &amp; goto :cmDone
164
+ :cmErrorLevel
165
+ exit /b %1
166
+ :cmDone
167
+ if %errorlevel% neq 0 goto :VCEnd</Command>
168
+ <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeCUDAInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeCXXInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeCommonLanguageInclude.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeGenericSystem.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeInitializeConfigs.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeLanguageInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeRCInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeSystemSpecificInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeSystemSpecificInitialize.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CheckLanguage.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\CMakeCommonCompilerMacros.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\MSVC-CXX.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\MSVC.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\NVIDIA-CUDA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\NVIDIA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\FindCUDAToolkit.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\FindPackageHandleStandardArgs.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\FindPackageMessage.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Internal\CMakeCUDALinkerInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Internal\CMakeCXXLinkerInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Internal\CMakeCommonLinkerInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Linker\Windows-MSVC-CUDA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Linker\Windows-MSVC-CXX.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Linker\Windows-MSVC.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-Initialize.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-MSVC-CXX.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-MSVC.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-NVIDIA-CUDA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\WindowsPaths.cmake;E:\Fashion_MNIST_Optic_Evolution\CMakeLists.txt;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeCUDACompiler.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeCXXCompiler.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeRCCompiler.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeSystem.cmake;%(AdditionalInputs)</AdditionalInputs>
169
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\generate.stamp</Outputs>
170
+ <LinkObjects Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">false</LinkObjects>
171
+ </CustomBuild>
172
+ </ItemGroup>
173
+ <ItemGroup>
174
+ </ItemGroup>
175
+ <ItemGroup />
176
+ <ItemGroup>
177
+ </ItemGroup>
178
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
179
+ <ImportGroup Label="ExtensionTargets">
180
+ <Import Project="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0\extras\visual_studio_integration\MSBuildExtensions\CUDA 13.0.targets" />
181
+ </ImportGroup>
182
+ </Project>
ZERO_CHECK.vcxproj.filters ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <Project ToolsVersion="17.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+ <ItemGroup>
4
+ <CustomBuild Include="E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\6e114a7c9e7b8616a743eb7ed1a38c30\generate.stamp.rule">
5
+ <Filter>CMake Rules</Filter>
6
+ </CustomBuild>
7
+ </ItemGroup>
8
+ <ItemGroup>
9
+ <Filter Include="CMake Rules">
10
+ <UniqueIdentifier>{F8798282-D57C-369A-90EF-390B9340DAF2}</UniqueIdentifier>
11
+ </Filter>
12
+ </ItemGroup>
13
+ </Project>
cmake_install.cmake ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Install script for directory: E:/Fashion_MNIST_Optic_Evolution
2
+
3
+ # Set the install prefix
4
+ if(NOT DEFINED CMAKE_INSTALL_PREFIX)
5
+ set(CMAKE_INSTALL_PREFIX "C:/Program Files")
6
+ endif()
7
+ string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
8
+
9
+ # Set the install configuration name.
10
+ if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
11
+ if(BUILD_TYPE)
12
+ string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
13
+ CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
14
+ else()
15
+ set(CMAKE_INSTALL_CONFIG_NAME "Release")
16
+ endif()
17
+ message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
18
+ endif()
19
+
20
+ # Set the component getting installed.
21
+ if(NOT CMAKE_INSTALL_COMPONENT)
22
+ if(COMPONENT)
23
+ message(STATUS "Install component: \"${COMPONENT}\"")
24
+ set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
25
+ else()
26
+ set(CMAKE_INSTALL_COMPONENT)
27
+ endif()
28
+ endif()
29
+
30
+ # Is this installation the result of a crosscompile?
31
+ if(NOT DEFINED CMAKE_CROSSCOMPILING)
32
+ set(CMAKE_CROSSCOMPILING "FALSE")
33
+ endif()
34
+
35
+ string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
36
+ "${CMAKE_INSTALL_MANIFEST_FILES}")
37
+ if(CMAKE_INSTALL_LOCAL_ONLY)
38
+ file(WRITE "E:/Fashion_MNIST_Optic_Evolution/build/install_local_manifest.txt"
39
+ "${CMAKE_INSTALL_MANIFEST_CONTENT}")
40
+ endif()
41
+ if(CMAKE_INSTALL_COMPONENT)
42
+ if(CMAKE_INSTALL_COMPONENT MATCHES "^[a-zA-Z0-9_.+-]+$")
43
+ set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt")
44
+ else()
45
+ string(MD5 CMAKE_INST_COMP_HASH "${CMAKE_INSTALL_COMPONENT}")
46
+ set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INST_COMP_HASH}.txt")
47
+ unset(CMAKE_INST_COMP_HASH)
48
+ endif()
49
+ else()
50
+ set(CMAKE_INSTALL_MANIFEST "install_manifest.txt")
51
+ endif()
52
+
53
+ if(NOT CMAKE_INSTALL_LOCAL_ONLY)
54
+ file(WRITE "E:/Fashion_MNIST_Optic_Evolution/build/${CMAKE_INSTALL_MANIFEST}"
55
+ "${CMAKE_INSTALL_MANIFEST_CONTENT}")
56
+ endif()
data_loader.cpp ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include "data_loader.hpp"
2
+ #include <fstream>
3
+ #include <stdexcept>
4
+ #include <iostream>
5
+ #include "optical_model.hpp" // For IMG_SIZE
6
+
7
+ FashionMNISTSet load_fashion_mnist_data(const std::string& data_dir, bool is_train) {
8
+ FashionMNISTSet set;
9
+ const std::string prefix = is_train ? "train" : "test";
10
+ const std::string images_path = data_dir + "/" + prefix + "-images.bin";
11
+ const std::string labels_path = data_dir + "/" + prefix + "-labels.bin";
12
+
13
+ // Load images
14
+ std::ifstream f_images(images_path, std::ios::binary);
15
+ if (!f_images) throw std::runtime_error("Cannot open: " + images_path);
16
+ f_images.seekg(0, std::ios::end);
17
+ size_t num_bytes = f_images.tellg();
18
+ f_images.seekg(0, std::ios::beg);
19
+ set.N = num_bytes / (IMG_SIZE * sizeof(float));
20
+ set.images.resize(set.N * IMG_SIZE);
21
+ f_images.read(reinterpret_cast<char*>(set.images.data()), num_bytes);
22
+
23
+ // Load labels
24
+ std::ifstream f_labels(labels_path, std::ios::binary);
25
+ if (!f_labels) throw std::runtime_error("Cannot open: " + labels_path);
26
+ f_labels.seekg(0, std::ios::end);
27
+ num_bytes = f_labels.tellg();
28
+ f_labels.seekg(0, std::ios::beg);
29
+ if (set.N != num_bytes) throw std::runtime_error("Image and label count mismatch!");
30
+ set.labels.resize(set.N);
31
+ f_labels.read(reinterpret_cast<char*>(set.labels.data()), num_bytes);
32
+
33
+ std::cout << "[INFO] Loaded " << set.N << " " << prefix << " samples.\n";
34
+ return set;
35
+ }
data_loader.hpp ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #pragma once
2
+ #include <string>
3
+ #include <vector>
4
+
5
+ struct FashionMNISTSet {
6
+ // Images as floats in [0,1], row-major, size = N * 784
7
+ std::vector<float> images;
8
+ // Labels in {0..9}, size = N
9
+ std::vector<uint8_t> labels;
10
+ size_t N = 0;
11
+ };
12
+
13
+ // Loads the entire Fashion-MNIST dataset from the binary files
14
+ FashionMNISTSet load_fashion_mnist_data(const std::string& data_dir, bool is_train);
data_loader.obj ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2b5725ee80384ae3d99cfaa5bbc8626576043e15368ec7c03d216d97547776a6
3
+ size 111195
fashion_mnist_trainer.device-link.obj ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:af542334b1cebb545e362c72b5d6f5d83f6beec78fbdf04ac5f1e3bda06688ff
3
+ size 1151471
fashion_mnist_trainer.exe ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bae5556a38c217bef0d02bb369c6060c4d38265013bd82a4f6d8e58a090bc283
3
+ size 2371584
fashion_mnist_trainer.exe.recipe ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <Project>
3
+ <ProjectOutputs>
4
+ <ProjectOutput>
5
+ <FullPath>E:\Fashion_MNIST_Optic_Evolution\build\x64\Release\ZERO_CHECK</FullPath>
6
+ </ProjectOutput>
7
+ <ProjectOutput>
8
+ <FullPath>E:\Fashion_MNIST_Optic_Evolution\build\Release\fashion_mnist_trainer.exe</FullPath>
9
+ </ProjectOutput>
10
+ </ProjectOutputs>
11
+ <ContentFiles />
12
+ <SatelliteDlls />
13
+ <NonRecipeFileRefs />
14
+ </Project>
fashion_mnist_trainer.sln ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 
2
+ Microsoft Visual Studio Solution File, Format Version 12.00
3
+ # Visual Studio Version 17
4
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ALL_BUILD", "ALL_BUILD.vcxproj", "{EF40E32F-9DB8-3F09-9CAA-07717AF7BF99}"
5
+ ProjectSection(ProjectDependencies) = postProject
6
+ {B4CD8D8C-908F-3E91-878E-AFB61C98E407} = {B4CD8D8C-908F-3E91-878E-AFB61C98E407}
7
+ {2B82790A-4403-3D6B-A562-F30C253F0098} = {2B82790A-4403-3D6B-A562-F30C253F0098}
8
+ EndProjectSection
9
+ EndProject
10
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZERO_CHECK", "ZERO_CHECK.vcxproj", "{B4CD8D8C-908F-3E91-878E-AFB61C98E407}"
11
+ ProjectSection(ProjectDependencies) = postProject
12
+ EndProjectSection
13
+ EndProject
14
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fashion_mnist_trainer", "fashion_mnist_trainer.vcxproj", "{2B82790A-4403-3D6B-A562-F30C253F0098}"
15
+ ProjectSection(ProjectDependencies) = postProject
16
+ {B4CD8D8C-908F-3E91-878E-AFB61C98E407} = {B4CD8D8C-908F-3E91-878E-AFB61C98E407}
17
+ EndProjectSection
18
+ EndProject
19
+ Global
20
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
21
+ Debug|x64 = Debug|x64
22
+ Release|x64 = Release|x64
23
+ MinSizeRel|x64 = MinSizeRel|x64
24
+ RelWithDebInfo|x64 = RelWithDebInfo|x64
25
+ EndGlobalSection
26
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
27
+ {EF40E32F-9DB8-3F09-9CAA-07717AF7BF99}.Debug|x64.ActiveCfg = Debug|x64
28
+ {EF40E32F-9DB8-3F09-9CAA-07717AF7BF99}.Release|x64.ActiveCfg = Release|x64
29
+ {EF40E32F-9DB8-3F09-9CAA-07717AF7BF99}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
30
+ {EF40E32F-9DB8-3F09-9CAA-07717AF7BF99}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
31
+ {B4CD8D8C-908F-3E91-878E-AFB61C98E407}.Debug|x64.ActiveCfg = Debug|x64
32
+ {B4CD8D8C-908F-3E91-878E-AFB61C98E407}.Debug|x64.Build.0 = Debug|x64
33
+ {B4CD8D8C-908F-3E91-878E-AFB61C98E407}.Release|x64.ActiveCfg = Release|x64
34
+ {B4CD8D8C-908F-3E91-878E-AFB61C98E407}.Release|x64.Build.0 = Release|x64
35
+ {B4CD8D8C-908F-3E91-878E-AFB61C98E407}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
36
+ {B4CD8D8C-908F-3E91-878E-AFB61C98E407}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
37
+ {B4CD8D8C-908F-3E91-878E-AFB61C98E407}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
38
+ {B4CD8D8C-908F-3E91-878E-AFB61C98E407}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
39
+ {2B82790A-4403-3D6B-A562-F30C253F0098}.Debug|x64.ActiveCfg = Debug|x64
40
+ {2B82790A-4403-3D6B-A562-F30C253F0098}.Debug|x64.Build.0 = Debug|x64
41
+ {2B82790A-4403-3D6B-A562-F30C253F0098}.Release|x64.ActiveCfg = Release|x64
42
+ {2B82790A-4403-3D6B-A562-F30C253F0098}.Release|x64.Build.0 = Release|x64
43
+ {2B82790A-4403-3D6B-A562-F30C253F0098}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
44
+ {2B82790A-4403-3D6B-A562-F30C253F0098}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
45
+ {2B82790A-4403-3D6B-A562-F30C253F0098}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
46
+ {2B82790A-4403-3D6B-A562-F30C253F0098}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
47
+ EndGlobalSection
48
+ GlobalSection(ExtensibilityGlobals) = postSolution
49
+ SolutionGuid = {547978A7-D2DA-34ED-A106-C0E082D229F4}
50
+ EndGlobalSection
51
+ GlobalSection(ExtensibilityAddIns) = postSolution
52
+ EndGlobalSection
53
+ EndGlobal
fashion_mnist_trainer.vcxproj ADDED
@@ -0,0 +1,444 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <Project DefaultTargets="Build" ToolsVersion="17.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+ <PropertyGroup>
4
+ <PreferredToolArchitecture>x64</PreferredToolArchitecture>
5
+ </PropertyGroup>
6
+ <ItemGroup Label="ProjectConfigurations">
7
+ <ProjectConfiguration Include="Debug|x64">
8
+ <Configuration>Debug</Configuration>
9
+ <Platform>x64</Platform>
10
+ </ProjectConfiguration>
11
+ <ProjectConfiguration Include="Release|x64">
12
+ <Configuration>Release</Configuration>
13
+ <Platform>x64</Platform>
14
+ </ProjectConfiguration>
15
+ <ProjectConfiguration Include="MinSizeRel|x64">
16
+ <Configuration>MinSizeRel</Configuration>
17
+ <Platform>x64</Platform>
18
+ </ProjectConfiguration>
19
+ <ProjectConfiguration Include="RelWithDebInfo|x64">
20
+ <Configuration>RelWithDebInfo</Configuration>
21
+ <Platform>x64</Platform>
22
+ </ProjectConfiguration>
23
+ </ItemGroup>
24
+ <PropertyGroup Label="Globals">
25
+ <ProjectGuid>{2B82790A-4403-3D6B-A562-F30C253F0098}</ProjectGuid>
26
+ <Keyword>Win32Proj</Keyword>
27
+ <WindowsTargetPlatformVersion>10.0.26100.0</WindowsTargetPlatformVersion>
28
+ <Platform>x64</Platform>
29
+ <ProjectName>fashion_mnist_trainer</ProjectName>
30
+ <CudaToolkitCustomDir>C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0\</CudaToolkitCustomDir>
31
+ <VCProjectUpgraderObjectName>NoUpgrade</VCProjectUpgraderObjectName>
32
+ </PropertyGroup>
33
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
34
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
35
+ <ConfigurationType>Application</ConfigurationType>
36
+ <CharacterSet>MultiByte</CharacterSet>
37
+ <PlatformToolset>v143</PlatformToolset>
38
+ </PropertyGroup>
39
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
40
+ <ConfigurationType>Application</ConfigurationType>
41
+ <CharacterSet>MultiByte</CharacterSet>
42
+ <PlatformToolset>v143</PlatformToolset>
43
+ </PropertyGroup>
44
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'" Label="Configuration">
45
+ <ConfigurationType>Application</ConfigurationType>
46
+ <CharacterSet>MultiByte</CharacterSet>
47
+ <PlatformToolset>v143</PlatformToolset>
48
+ </PropertyGroup>
49
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'" Label="Configuration">
50
+ <ConfigurationType>Application</ConfigurationType>
51
+ <CharacterSet>MultiByte</CharacterSet>
52
+ <PlatformToolset>v143</PlatformToolset>
53
+ </PropertyGroup>
54
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
55
+ <ImportGroup Label="ExtensionSettings">
56
+ <Import Project="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0\extras\visual_studio_integration\MSBuildExtensions\CUDA 13.0.props" />
57
+ </ImportGroup>
58
+ <ImportGroup Label="PropertySheets">
59
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
60
+ </ImportGroup>
61
+ <PropertyGroup Label="UserMacros" />
62
+ <PropertyGroup>
63
+ <_ProjectFileVersion>10.0.20506.1</_ProjectFileVersion>
64
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">E:\Fashion_MNIST_Optic_Evolution\build\Debug\</OutDir>
65
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">fashion_mnist_trainer.dir\Debug\</IntDir>
66
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">fashion_mnist_trainer</TargetName>
67
+ <TargetExt Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.exe</TargetExt>
68
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
69
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</GenerateManifest>
70
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">E:\Fashion_MNIST_Optic_Evolution\build\Release\</OutDir>
71
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">fashion_mnist_trainer.dir\Release\</IntDir>
72
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">fashion_mnist_trainer</TargetName>
73
+ <TargetExt Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.exe</TargetExt>
74
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
75
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</GenerateManifest>
76
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">E:\Fashion_MNIST_Optic_Evolution\build\MinSizeRel\</OutDir>
77
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">fashion_mnist_trainer.dir\MinSizeRel\</IntDir>
78
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">fashion_mnist_trainer</TargetName>
79
+ <TargetExt Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">.exe</TargetExt>
80
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">false</LinkIncremental>
81
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">true</GenerateManifest>
82
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">E:\Fashion_MNIST_Optic_Evolution\build\RelWithDebInfo\</OutDir>
83
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">fashion_mnist_trainer.dir\RelWithDebInfo\</IntDir>
84
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">fashion_mnist_trainer</TargetName>
85
+ <TargetExt Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">.exe</TargetExt>
86
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">true</LinkIncremental>
87
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">true</GenerateManifest>
88
+ </PropertyGroup>
89
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
90
+ <ClCompile>
91
+ <AdditionalIncludeDirectories>E:\Fashion_MNIST_Optic_Evolution\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
92
+ <AdditionalOptions>%(AdditionalOptions) /external:I "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/include" /external:I "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/include/cccl" -O3 -ffast-math</AdditionalOptions>
93
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
94
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
95
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
96
+ <ExceptionHandling>Sync</ExceptionHandling>
97
+ <ExternalWarningLevel>TurnOffAllWarnings</ExternalWarningLevel>
98
+ <InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
99
+ <LanguageStandard>stdcpp17</LanguageStandard>
100
+ <MinimalRebuild></MinimalRebuild>
101
+ <Optimization>Disabled</Optimization>
102
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
103
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
104
+ <RuntimeTypeInfo>true</RuntimeTypeInfo>
105
+ <SupportJustMyCode></SupportJustMyCode>
106
+ <UseFullPaths>false</UseFullPaths>
107
+ <PreprocessorDefinitions>%(PreprocessorDefinitions);WIN32;_WINDOWS;CMAKE_INTDIR="Debug"</PreprocessorDefinitions>
108
+ <ObjectFileName>$(IntDir)</ObjectFileName>
109
+ <ScanSourceForModuleDependencies>false</ScanSourceForModuleDependencies>
110
+ </ClCompile>
111
+ <ResourceCompile>
112
+ <PreprocessorDefinitions>%(PreprocessorDefinitions);WIN32;_DEBUG;_WINDOWS;CMAKE_INTDIR=\"Debug\"</PreprocessorDefinitions>
113
+ <AdditionalIncludeDirectories>E:\Fashion_MNIST_Optic_Evolution\src;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\cccl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
114
+ </ResourceCompile>
115
+ <CudaCompile>
116
+ <Include>E:\Fashion_MNIST_Optic_Evolution\src;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\cccl;%(Include)</Include>
117
+ <Defines>%(Defines);_WINDOWS;CMAKE_INTDIR="Debug"</Defines>
118
+ <AdditionalOptions>%(AdditionalOptions) -std=c++17 --generate-code=arch=compute_75,code=[compute_75,sm_75] --generate-code=arch=compute_80,code=[compute_80,sm_80] --generate-code=arch=compute_86,code=[compute_86,sm_86] -Xcompiler="/EHsc -Zi -Ob0"</AdditionalOptions>
119
+ <CodeGeneration></CodeGeneration>
120
+ <CompileOut>$(IntDir)%(Filename).obj</CompileOut>
121
+ <CudaRuntime>Static</CudaRuntime>
122
+ <FastMath>true</FastMath>
123
+ <GPUDebugInfo>false</GPUDebugInfo>
124
+ <GenerateRelocatableDeviceCode>true</GenerateRelocatableDeviceCode>
125
+ <Optimization>Od</Optimization>
126
+ <Runtime>MDd</Runtime>
127
+ <RuntimeChecks>RTC1</RuntimeChecks>
128
+ <TargetMachinePlatform>64</TargetMachinePlatform>
129
+ <TypeInfo>true</TypeInfo>
130
+ <UseHostInclude>false</UseHostInclude>
131
+ </CudaCompile>
132
+ <Midl>
133
+ <AdditionalIncludeDirectories>E:\Fashion_MNIST_Optic_Evolution\src;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\cccl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
134
+ <OutputDirectory>$(ProjectDir)/$(IntDir)</OutputDirectory>
135
+ <HeaderFileName>%(Filename).h</HeaderFileName>
136
+ <TypeLibraryName>%(Filename).tlb</TypeLibraryName>
137
+ <InterfaceIdentifierFileName>%(Filename)_i.c</InterfaceIdentifierFileName>
138
+ <ProxyFileName>%(Filename)_p.c</ProxyFileName>
139
+ </Midl>
140
+ <Link>
141
+ <AdditionalDependencies>C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\lib\x64\cudart.lib;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\lib\x64\cufft.lib;cudadevrt.lib;cudart_static.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;comdlg32.lib;advapi32.lib</AdditionalDependencies>
142
+ <AdditionalLibraryDirectories>C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64;C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64/$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
143
+ <GenerateDebugInformation>true</GenerateDebugInformation>
144
+ <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
145
+ <ImportLibrary>E:/Fashion_MNIST_Optic_Evolution/build/Debug/fashion_mnist_trainer.lib</ImportLibrary>
146
+ <ProgramDataBaseFile>E:/Fashion_MNIST_Optic_Evolution/build/Debug/fashion_mnist_trainer.pdb</ProgramDataBaseFile>
147
+ <SubSystem>Console</SubSystem>
148
+ </Link>
149
+ <ProjectReference>
150
+ <LinkLibraryDependencies>false</LinkLibraryDependencies>
151
+ </ProjectReference>
152
+ <CudaLink>
153
+ <AdditionalOptions>-forward-unknown-to-host-compiler -Wno-deprecated-gpu-targets -D_WINDOWS -Xcompiler=" /GR /EHsc" -use_fast_math -Xcompiler=" -Zi -Ob0 -Od /RTC1" "--generate-code=arch=compute_75,code=[compute_75,sm_75]" "--generate-code=arch=compute_80,code=[compute_80,sm_80]" "--generate-code=arch=compute_86,code=[compute_86,sm_86]" -Xcompiler=-MDd</AdditionalOptions>
154
+ <PerformDeviceLink>true</PerformDeviceLink>
155
+ </CudaLink>
156
+ </ItemDefinitionGroup>
157
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
158
+ <ClCompile>
159
+ <AdditionalIncludeDirectories>E:\Fashion_MNIST_Optic_Evolution\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
160
+ <AdditionalOptions>%(AdditionalOptions) /external:I "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/include" /external:I "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/include/cccl" -O3 -ffast-math</AdditionalOptions>
161
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
162
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
163
+ <ExceptionHandling>Sync</ExceptionHandling>
164
+ <ExternalWarningLevel>TurnOffAllWarnings</ExternalWarningLevel>
165
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
166
+ <LanguageStandard>stdcpp17</LanguageStandard>
167
+ <MinimalRebuild></MinimalRebuild>
168
+ <Optimization>MaxSpeed</Optimization>
169
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
170
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
171
+ <RuntimeTypeInfo>true</RuntimeTypeInfo>
172
+ <SupportJustMyCode></SupportJustMyCode>
173
+ <UseFullPaths>false</UseFullPaths>
174
+ <PreprocessorDefinitions>%(PreprocessorDefinitions);WIN32;_WINDOWS;NDEBUG;CMAKE_INTDIR="Release"</PreprocessorDefinitions>
175
+ <ObjectFileName>$(IntDir)</ObjectFileName>
176
+ <DebugInformationFormat>
177
+ </DebugInformationFormat>
178
+ <ScanSourceForModuleDependencies>false</ScanSourceForModuleDependencies>
179
+ </ClCompile>
180
+ <ResourceCompile>
181
+ <PreprocessorDefinitions>%(PreprocessorDefinitions);WIN32;_WINDOWS;NDEBUG;CMAKE_INTDIR=\"Release\"</PreprocessorDefinitions>
182
+ <AdditionalIncludeDirectories>E:\Fashion_MNIST_Optic_Evolution\src;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\cccl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
183
+ </ResourceCompile>
184
+ <CudaCompile>
185
+ <Include>E:\Fashion_MNIST_Optic_Evolution\src;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\cccl;%(Include)</Include>
186
+ <Defines>%(Defines);_WINDOWS;NDEBUG;CMAKE_INTDIR="Release"</Defines>
187
+ <AdditionalOptions>%(AdditionalOptions) -std=c++17 --generate-code=arch=compute_75,code=[compute_75,sm_75] --generate-code=arch=compute_80,code=[compute_80,sm_80] --generate-code=arch=compute_86,code=[compute_86,sm_86] -Xcompiler="/EHsc -Ob2"</AdditionalOptions>
188
+ <CodeGeneration></CodeGeneration>
189
+ <CompileOut>$(IntDir)%(Filename).obj</CompileOut>
190
+ <CudaRuntime>Static</CudaRuntime>
191
+ <FastMath>true</FastMath>
192
+ <GPUDebugInfo>false</GPUDebugInfo>
193
+ <GenerateRelocatableDeviceCode>true</GenerateRelocatableDeviceCode>
194
+ <Optimization>O2</Optimization>
195
+ <Runtime>MD</Runtime>
196
+ <TargetMachinePlatform>64</TargetMachinePlatform>
197
+ <TypeInfo>true</TypeInfo>
198
+ <UseHostInclude>false</UseHostInclude>
199
+ </CudaCompile>
200
+ <Midl>
201
+ <AdditionalIncludeDirectories>E:\Fashion_MNIST_Optic_Evolution\src;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\cccl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
202
+ <OutputDirectory>$(ProjectDir)/$(IntDir)</OutputDirectory>
203
+ <HeaderFileName>%(Filename).h</HeaderFileName>
204
+ <TypeLibraryName>%(Filename).tlb</TypeLibraryName>
205
+ <InterfaceIdentifierFileName>%(Filename)_i.c</InterfaceIdentifierFileName>
206
+ <ProxyFileName>%(Filename)_p.c</ProxyFileName>
207
+ </Midl>
208
+ <Link>
209
+ <AdditionalDependencies>C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\lib\x64\cudart.lib;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\lib\x64\cufft.lib;cudadevrt.lib;cudart_static.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;comdlg32.lib;advapi32.lib</AdditionalDependencies>
210
+ <AdditionalLibraryDirectories>C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64;C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64/$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
211
+ <GenerateDebugInformation>false</GenerateDebugInformation>
212
+ <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
213
+ <ImportLibrary>E:/Fashion_MNIST_Optic_Evolution/build/Release/fashion_mnist_trainer.lib</ImportLibrary>
214
+ <ProgramDataBaseFile>E:/Fashion_MNIST_Optic_Evolution/build/Release/fashion_mnist_trainer.pdb</ProgramDataBaseFile>
215
+ <SubSystem>Console</SubSystem>
216
+ </Link>
217
+ <ProjectReference>
218
+ <LinkLibraryDependencies>false</LinkLibraryDependencies>
219
+ </ProjectReference>
220
+ <CudaLink>
221
+ <AdditionalOptions>-forward-unknown-to-host-compiler -Wno-deprecated-gpu-targets -D_WINDOWS -Xcompiler=" /GR /EHsc" -use_fast_math -Xcompiler="-O2 -Ob2" -DNDEBUG "--generate-code=arch=compute_75,code=[compute_75,sm_75]" "--generate-code=arch=compute_80,code=[compute_80,sm_80]" "--generate-code=arch=compute_86,code=[compute_86,sm_86]" -Xcompiler=-MD</AdditionalOptions>
222
+ <PerformDeviceLink>true</PerformDeviceLink>
223
+ </CudaLink>
224
+ </ItemDefinitionGroup>
225
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">
226
+ <ClCompile>
227
+ <AdditionalIncludeDirectories>E:\Fashion_MNIST_Optic_Evolution\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
228
+ <AdditionalOptions>%(AdditionalOptions) /external:I "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/include" /external:I "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/include/cccl" -O3 -ffast-math</AdditionalOptions>
229
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
230
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
231
+ <ExceptionHandling>Sync</ExceptionHandling>
232
+ <ExternalWarningLevel>TurnOffAllWarnings</ExternalWarningLevel>
233
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
234
+ <LanguageStandard>stdcpp17</LanguageStandard>
235
+ <MinimalRebuild></MinimalRebuild>
236
+ <Optimization>MinSpace</Optimization>
237
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
238
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
239
+ <RuntimeTypeInfo>true</RuntimeTypeInfo>
240
+ <SupportJustMyCode></SupportJustMyCode>
241
+ <UseFullPaths>false</UseFullPaths>
242
+ <PreprocessorDefinitions>%(PreprocessorDefinitions);WIN32;_WINDOWS;NDEBUG;CMAKE_INTDIR="MinSizeRel"</PreprocessorDefinitions>
243
+ <ObjectFileName>$(IntDir)</ObjectFileName>
244
+ <DebugInformationFormat>
245
+ </DebugInformationFormat>
246
+ <ScanSourceForModuleDependencies>false</ScanSourceForModuleDependencies>
247
+ </ClCompile>
248
+ <ResourceCompile>
249
+ <PreprocessorDefinitions>%(PreprocessorDefinitions);WIN32;_WINDOWS;NDEBUG;CMAKE_INTDIR=\"MinSizeRel\"</PreprocessorDefinitions>
250
+ <AdditionalIncludeDirectories>E:\Fashion_MNIST_Optic_Evolution\src;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\cccl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
251
+ </ResourceCompile>
252
+ <CudaCompile>
253
+ <Include>E:\Fashion_MNIST_Optic_Evolution\src;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\cccl;%(Include)</Include>
254
+ <Defines>%(Defines);_WINDOWS;NDEBUG;CMAKE_INTDIR="MinSizeRel"</Defines>
255
+ <AdditionalOptions>%(AdditionalOptions) -std=c++17 --generate-code=arch=compute_75,code=[compute_75,sm_75] --generate-code=arch=compute_80,code=[compute_80,sm_80] --generate-code=arch=compute_86,code=[compute_86,sm_86] -Xcompiler="/EHsc -Ob1"</AdditionalOptions>
256
+ <CodeGeneration></CodeGeneration>
257
+ <CompileOut>$(IntDir)%(Filename).obj</CompileOut>
258
+ <CudaRuntime>Static</CudaRuntime>
259
+ <FastMath>true</FastMath>
260
+ <GPUDebugInfo>false</GPUDebugInfo>
261
+ <GenerateRelocatableDeviceCode>true</GenerateRelocatableDeviceCode>
262
+ <Optimization>O1</Optimization>
263
+ <Runtime>MD</Runtime>
264
+ <TargetMachinePlatform>64</TargetMachinePlatform>
265
+ <TypeInfo>true</TypeInfo>
266
+ <UseHostInclude>false</UseHostInclude>
267
+ </CudaCompile>
268
+ <Midl>
269
+ <AdditionalIncludeDirectories>E:\Fashion_MNIST_Optic_Evolution\src;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\cccl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
270
+ <OutputDirectory>$(ProjectDir)/$(IntDir)</OutputDirectory>
271
+ <HeaderFileName>%(Filename).h</HeaderFileName>
272
+ <TypeLibraryName>%(Filename).tlb</TypeLibraryName>
273
+ <InterfaceIdentifierFileName>%(Filename)_i.c</InterfaceIdentifierFileName>
274
+ <ProxyFileName>%(Filename)_p.c</ProxyFileName>
275
+ </Midl>
276
+ <Link>
277
+ <AdditionalDependencies>C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\lib\x64\cudart.lib;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\lib\x64\cufft.lib;cudadevrt.lib;cudart_static.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;comdlg32.lib;advapi32.lib</AdditionalDependencies>
278
+ <AdditionalLibraryDirectories>C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64;C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64/$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
279
+ <GenerateDebugInformation>false</GenerateDebugInformation>
280
+ <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
281
+ <ImportLibrary>E:/Fashion_MNIST_Optic_Evolution/build/MinSizeRel/fashion_mnist_trainer.lib</ImportLibrary>
282
+ <ProgramDataBaseFile>E:/Fashion_MNIST_Optic_Evolution/build/MinSizeRel/fashion_mnist_trainer.pdb</ProgramDataBaseFile>
283
+ <SubSystem>Console</SubSystem>
284
+ </Link>
285
+ <ProjectReference>
286
+ <LinkLibraryDependencies>false</LinkLibraryDependencies>
287
+ </ProjectReference>
288
+ <CudaLink>
289
+ <AdditionalOptions>-forward-unknown-to-host-compiler -Wno-deprecated-gpu-targets -D_WINDOWS -Xcompiler=" /GR /EHsc" -use_fast_math -Xcompiler="-O1 -Ob1" -DNDEBUG "--generate-code=arch=compute_75,code=[compute_75,sm_75]" "--generate-code=arch=compute_80,code=[compute_80,sm_80]" "--generate-code=arch=compute_86,code=[compute_86,sm_86]" -Xcompiler=-MD</AdditionalOptions>
290
+ <PerformDeviceLink>true</PerformDeviceLink>
291
+ </CudaLink>
292
+ </ItemDefinitionGroup>
293
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">
294
+ <ClCompile>
295
+ <AdditionalIncludeDirectories>E:\Fashion_MNIST_Optic_Evolution\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
296
+ <AdditionalOptions>%(AdditionalOptions) /external:I "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/include" /external:I "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/include/cccl" -O3 -ffast-math</AdditionalOptions>
297
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
298
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
299
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
300
+ <ExceptionHandling>Sync</ExceptionHandling>
301
+ <ExternalWarningLevel>TurnOffAllWarnings</ExternalWarningLevel>
302
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
303
+ <LanguageStandard>stdcpp17</LanguageStandard>
304
+ <MinimalRebuild></MinimalRebuild>
305
+ <Optimization>MaxSpeed</Optimization>
306
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
307
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
308
+ <RuntimeTypeInfo>true</RuntimeTypeInfo>
309
+ <SupportJustMyCode></SupportJustMyCode>
310
+ <UseFullPaths>false</UseFullPaths>
311
+ <PreprocessorDefinitions>%(PreprocessorDefinitions);WIN32;_WINDOWS;NDEBUG;CMAKE_INTDIR="RelWithDebInfo"</PreprocessorDefinitions>
312
+ <ObjectFileName>$(IntDir)</ObjectFileName>
313
+ <ScanSourceForModuleDependencies>false</ScanSourceForModuleDependencies>
314
+ </ClCompile>
315
+ <ResourceCompile>
316
+ <PreprocessorDefinitions>%(PreprocessorDefinitions);WIN32;_WINDOWS;NDEBUG;CMAKE_INTDIR=\"RelWithDebInfo\"</PreprocessorDefinitions>
317
+ <AdditionalIncludeDirectories>E:\Fashion_MNIST_Optic_Evolution\src;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\cccl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
318
+ </ResourceCompile>
319
+ <CudaCompile>
320
+ <Include>E:\Fashion_MNIST_Optic_Evolution\src;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\cccl;%(Include)</Include>
321
+ <Defines>%(Defines);_WINDOWS;NDEBUG;CMAKE_INTDIR="RelWithDebInfo"</Defines>
322
+ <AdditionalOptions>%(AdditionalOptions) -std=c++17 --generate-code=arch=compute_75,code=[compute_75,sm_75] --generate-code=arch=compute_80,code=[compute_80,sm_80] --generate-code=arch=compute_86,code=[compute_86,sm_86] -Xcompiler="/EHsc -Zi -Ob1"</AdditionalOptions>
323
+ <CodeGeneration></CodeGeneration>
324
+ <CompileOut>$(IntDir)%(Filename).obj</CompileOut>
325
+ <CudaRuntime>Static</CudaRuntime>
326
+ <FastMath>true</FastMath>
327
+ <GPUDebugInfo>false</GPUDebugInfo>
328
+ <GenerateRelocatableDeviceCode>true</GenerateRelocatableDeviceCode>
329
+ <Optimization>O2</Optimization>
330
+ <Runtime>MD</Runtime>
331
+ <TargetMachinePlatform>64</TargetMachinePlatform>
332
+ <TypeInfo>true</TypeInfo>
333
+ <UseHostInclude>false</UseHostInclude>
334
+ </CudaCompile>
335
+ <Midl>
336
+ <AdditionalIncludeDirectories>E:\Fashion_MNIST_Optic_Evolution\src;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\cccl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
337
+ <OutputDirectory>$(ProjectDir)/$(IntDir)</OutputDirectory>
338
+ <HeaderFileName>%(Filename).h</HeaderFileName>
339
+ <TypeLibraryName>%(Filename).tlb</TypeLibraryName>
340
+ <InterfaceIdentifierFileName>%(Filename)_i.c</InterfaceIdentifierFileName>
341
+ <ProxyFileName>%(Filename)_p.c</ProxyFileName>
342
+ </Midl>
343
+ <Link>
344
+ <AdditionalDependencies>C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\lib\x64\cudart.lib;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\lib\x64\cufft.lib;cudadevrt.lib;cudart_static.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;comdlg32.lib;advapi32.lib</AdditionalDependencies>
345
+ <AdditionalLibraryDirectories>C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64;C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0/lib/x64/$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
346
+ <GenerateDebugInformation>true</GenerateDebugInformation>
347
+ <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
348
+ <ImportLibrary>E:/Fashion_MNIST_Optic_Evolution/build/RelWithDebInfo/fashion_mnist_trainer.lib</ImportLibrary>
349
+ <ProgramDataBaseFile>E:/Fashion_MNIST_Optic_Evolution/build/RelWithDebInfo/fashion_mnist_trainer.pdb</ProgramDataBaseFile>
350
+ <SubSystem>Console</SubSystem>
351
+ </Link>
352
+ <ProjectReference>
353
+ <LinkLibraryDependencies>false</LinkLibraryDependencies>
354
+ </ProjectReference>
355
+ <CudaLink>
356
+ <AdditionalOptions>-forward-unknown-to-host-compiler -Wno-deprecated-gpu-targets -D_WINDOWS -Xcompiler=" /GR /EHsc" -use_fast_math -Xcompiler=" -Zi -O2 -Ob1" -DNDEBUG "--generate-code=arch=compute_75,code=[compute_75,sm_75]" "--generate-code=arch=compute_80,code=[compute_80,sm_80]" "--generate-code=arch=compute_86,code=[compute_86,sm_86]" -Xcompiler=-MD</AdditionalOptions>
357
+ <PerformDeviceLink>true</PerformDeviceLink>
358
+ </CudaLink>
359
+ </ItemDefinitionGroup>
360
+ <ItemGroup>
361
+ <CustomBuild Include="E:\Fashion_MNIST_Optic_Evolution\CMakeLists.txt">
362
+ <UseUtf8Encoding>Always</UseUtf8Encoding>
363
+ <Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Building Custom Rule E:/Fashion_MNIST_Optic_Evolution/CMakeLists.txt</Message>
364
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">setlocal
365
+ "C:\Program Files\CMake\bin\cmake.exe" -SE:/Fashion_MNIST_Optic_Evolution -BE:/Fashion_MNIST_Optic_Evolution/build --check-stamp-file E:/Fashion_MNIST_Optic_Evolution/build/CMakeFiles/generate.stamp
366
+ if %errorlevel% neq 0 goto :cmEnd
367
+ :cmEnd
368
+ endlocal &amp; call :cmErrorLevel %errorlevel% &amp; goto :cmDone
369
+ :cmErrorLevel
370
+ exit /b %1
371
+ :cmDone
372
+ if %errorlevel% neq 0 goto :VCEnd</Command>
373
+ <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeCUDAInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeCXXInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeCommonLanguageInclude.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeGenericSystem.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeInitializeConfigs.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeLanguageInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeRCInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeSystemSpecificInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeSystemSpecificInitialize.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CheckLanguage.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\CMakeCommonCompilerMacros.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\MSVC-CXX.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\MSVC.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\NVIDIA-CUDA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\NVIDIA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\FindCUDAToolkit.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\FindPackageHandleStandardArgs.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\FindPackageMessage.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Internal\CMakeCUDALinkerInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Internal\CMakeCXXLinkerInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Internal\CMakeCommonLinkerInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Linker\Windows-MSVC-CUDA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Linker\Windows-MSVC-CXX.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Linker\Windows-MSVC.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-Initialize.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-MSVC-CXX.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-MSVC.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-NVIDIA-CUDA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\WindowsPaths.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeCUDACompiler.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeCXXCompiler.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeRCCompiler.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeSystem.cmake;%(AdditionalInputs)</AdditionalInputs>
374
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\generate.stamp</Outputs>
375
+ <LinkObjects Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkObjects>
376
+ <Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Building Custom Rule E:/Fashion_MNIST_Optic_Evolution/CMakeLists.txt</Message>
377
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">setlocal
378
+ "C:\Program Files\CMake\bin\cmake.exe" -SE:/Fashion_MNIST_Optic_Evolution -BE:/Fashion_MNIST_Optic_Evolution/build --check-stamp-file E:/Fashion_MNIST_Optic_Evolution/build/CMakeFiles/generate.stamp
379
+ if %errorlevel% neq 0 goto :cmEnd
380
+ :cmEnd
381
+ endlocal &amp; call :cmErrorLevel %errorlevel% &amp; goto :cmDone
382
+ :cmErrorLevel
383
+ exit /b %1
384
+ :cmDone
385
+ if %errorlevel% neq 0 goto :VCEnd</Command>
386
+ <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeCUDAInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeCXXInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeCommonLanguageInclude.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeGenericSystem.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeInitializeConfigs.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeLanguageInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeRCInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeSystemSpecificInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeSystemSpecificInitialize.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CheckLanguage.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\CMakeCommonCompilerMacros.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\MSVC-CXX.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\MSVC.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\NVIDIA-CUDA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\NVIDIA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\FindCUDAToolkit.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\FindPackageHandleStandardArgs.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\FindPackageMessage.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Internal\CMakeCUDALinkerInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Internal\CMakeCXXLinkerInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Internal\CMakeCommonLinkerInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Linker\Windows-MSVC-CUDA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Linker\Windows-MSVC-CXX.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Linker\Windows-MSVC.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-Initialize.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-MSVC-CXX.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-MSVC.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-NVIDIA-CUDA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\WindowsPaths.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeCUDACompiler.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeCXXCompiler.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeRCCompiler.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeSystem.cmake;%(AdditionalInputs)</AdditionalInputs>
387
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\generate.stamp</Outputs>
388
+ <LinkObjects Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkObjects>
389
+ <Message Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">Building Custom Rule E:/Fashion_MNIST_Optic_Evolution/CMakeLists.txt</Message>
390
+ <Command Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">setlocal
391
+ "C:\Program Files\CMake\bin\cmake.exe" -SE:/Fashion_MNIST_Optic_Evolution -BE:/Fashion_MNIST_Optic_Evolution/build --check-stamp-file E:/Fashion_MNIST_Optic_Evolution/build/CMakeFiles/generate.stamp
392
+ if %errorlevel% neq 0 goto :cmEnd
393
+ :cmEnd
394
+ endlocal &amp; call :cmErrorLevel %errorlevel% &amp; goto :cmDone
395
+ :cmErrorLevel
396
+ exit /b %1
397
+ :cmDone
398
+ if %errorlevel% neq 0 goto :VCEnd</Command>
399
+ <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeCUDAInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeCXXInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeCommonLanguageInclude.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeGenericSystem.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeInitializeConfigs.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeLanguageInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeRCInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeSystemSpecificInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeSystemSpecificInitialize.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CheckLanguage.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\CMakeCommonCompilerMacros.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\MSVC-CXX.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\MSVC.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\NVIDIA-CUDA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\NVIDIA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\FindCUDAToolkit.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\FindPackageHandleStandardArgs.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\FindPackageMessage.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Internal\CMakeCUDALinkerInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Internal\CMakeCXXLinkerInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Internal\CMakeCommonLinkerInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Linker\Windows-MSVC-CUDA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Linker\Windows-MSVC-CXX.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Linker\Windows-MSVC.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-Initialize.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-MSVC-CXX.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-MSVC.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-NVIDIA-CUDA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\WindowsPaths.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeCUDACompiler.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeCXXCompiler.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeRCCompiler.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeSystem.cmake;%(AdditionalInputs)</AdditionalInputs>
400
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\generate.stamp</Outputs>
401
+ <LinkObjects Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">false</LinkObjects>
402
+ <Message Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">Building Custom Rule E:/Fashion_MNIST_Optic_Evolution/CMakeLists.txt</Message>
403
+ <Command Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">setlocal
404
+ "C:\Program Files\CMake\bin\cmake.exe" -SE:/Fashion_MNIST_Optic_Evolution -BE:/Fashion_MNIST_Optic_Evolution/build --check-stamp-file E:/Fashion_MNIST_Optic_Evolution/build/CMakeFiles/generate.stamp
405
+ if %errorlevel% neq 0 goto :cmEnd
406
+ :cmEnd
407
+ endlocal &amp; call :cmErrorLevel %errorlevel% &amp; goto :cmDone
408
+ :cmErrorLevel
409
+ exit /b %1
410
+ :cmDone
411
+ if %errorlevel% neq 0 goto :VCEnd</Command>
412
+ <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeCUDAInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeCXXInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeCommonLanguageInclude.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeGenericSystem.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeInitializeConfigs.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeLanguageInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeRCInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeSystemSpecificInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CMakeSystemSpecificInitialize.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\CheckLanguage.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\CMakeCommonCompilerMacros.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\MSVC-CXX.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\MSVC.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\NVIDIA-CUDA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Compiler\NVIDIA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\FindCUDAToolkit.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\FindPackageHandleStandardArgs.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\FindPackageMessage.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Internal\CMakeCUDALinkerInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Internal\CMakeCXXLinkerInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Internal\CMakeCommonLinkerInformation.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Linker\Windows-MSVC-CUDA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Linker\Windows-MSVC-CXX.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Linker\Windows-MSVC.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-Initialize.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-MSVC-CXX.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-MSVC.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows-NVIDIA-CUDA.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\Windows.cmake;C:\Program Files\CMake\share\cmake-3.31\Modules\Platform\WindowsPaths.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeCUDACompiler.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeCXXCompiler.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeRCCompiler.cmake;E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\3.31.4\CMakeSystem.cmake;%(AdditionalInputs)</AdditionalInputs>
413
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">E:\Fashion_MNIST_Optic_Evolution\build\CMakeFiles\generate.stamp</Outputs>
414
+ <LinkObjects Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">false</LinkObjects>
415
+ </CustomBuild>
416
+ </ItemGroup>
417
+ <ItemGroup>
418
+ <ClCompile Include="E:\Fashion_MNIST_Optic_Evolution\src\data_loader.cpp" />
419
+ <ClCompile Include="E:\Fashion_MNIST_Optic_Evolution\src\main.cpp" />
420
+ <ClCompile Include="E:\Fashion_MNIST_Optic_Evolution\src\training.cpp" />
421
+ <ClCompile Include="E:\Fashion_MNIST_Optic_Evolution\src\utils.cpp" />
422
+ <CudaCompile Include="..\src\fungi.cu" />
423
+ <CudaCompile Include="..\src\optical_model.cu" />
424
+ <ClInclude Include="E:\Fashion_MNIST_Optic_Evolution\src\data_loader.hpp" />
425
+ <ClInclude Include="E:\Fashion_MNIST_Optic_Evolution\src\fungi.hpp" />
426
+ <ClInclude Include="E:\Fashion_MNIST_Optic_Evolution\src\fungi_Paremetres.hpp" />
427
+ <ClInclude Include="E:\Fashion_MNIST_Optic_Evolution\src\optical_model.hpp" />
428
+ <ClInclude Include="E:\Fashion_MNIST_Optic_Evolution\src\training.hpp" />
429
+ <ClInclude Include="E:\Fashion_MNIST_Optic_Evolution\src\utils.hpp" />
430
+ </ItemGroup>
431
+ <ItemGroup />
432
+ <ItemGroup>
433
+ <ProjectReference Include="E:\Fashion_MNIST_Optic_Evolution\build\ZERO_CHECK.vcxproj">
434
+ <Project>{B4CD8D8C-908F-3E91-878E-AFB61C98E407}</Project>
435
+ <Name>ZERO_CHECK</Name>
436
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
437
+ <CopyToOutputDirectory>Never</CopyToOutputDirectory>
438
+ </ProjectReference>
439
+ </ItemGroup>
440
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
441
+ <ImportGroup Label="ExtensionTargets">
442
+ <Import Project="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.0\extras\visual_studio_integration\MSBuildExtensions\CUDA 13.0.targets" />
443
+ </ImportGroup>
444
+ </Project>
fashion_mnist_trainer.vcxproj.filters ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <Project ToolsVersion="17.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+ <ItemGroup>
4
+ <ClCompile Include="E:\Fashion_MNIST_Optic_Evolution\src\data_loader.cpp">
5
+ <Filter>Source Files</Filter>
6
+ </ClCompile>
7
+ <ClCompile Include="E:\Fashion_MNIST_Optic_Evolution\src\main.cpp">
8
+ <Filter>Source Files</Filter>
9
+ </ClCompile>
10
+ <ClCompile Include="E:\Fashion_MNIST_Optic_Evolution\src\training.cpp">
11
+ <Filter>Source Files</Filter>
12
+ </ClCompile>
13
+ <ClCompile Include="E:\Fashion_MNIST_Optic_Evolution\src\utils.cpp">
14
+ <Filter>Source Files</Filter>
15
+ </ClCompile>
16
+ </ItemGroup>
17
+ <ItemGroup>
18
+ <ClInclude Include="E:\Fashion_MNIST_Optic_Evolution\src\data_loader.hpp">
19
+ <Filter>Header Files</Filter>
20
+ </ClInclude>
21
+ <ClInclude Include="E:\Fashion_MNIST_Optic_Evolution\src\fungi.hpp">
22
+ <Filter>Header Files</Filter>
23
+ </ClInclude>
24
+ <ClInclude Include="E:\Fashion_MNIST_Optic_Evolution\src\fungi_Paremetres.hpp">
25
+ <Filter>Header Files</Filter>
26
+ </ClInclude>
27
+ <ClInclude Include="E:\Fashion_MNIST_Optic_Evolution\src\optical_model.hpp">
28
+ <Filter>Header Files</Filter>
29
+ </ClInclude>
30
+ <ClInclude Include="E:\Fashion_MNIST_Optic_Evolution\src\training.hpp">
31
+ <Filter>Header Files</Filter>
32
+ </ClInclude>
33
+ <ClInclude Include="E:\Fashion_MNIST_Optic_Evolution\src\utils.hpp">
34
+ <Filter>Header Files</Filter>
35
+ </ClInclude>
36
+ </ItemGroup>
37
+ <ItemGroup>
38
+ <CudaCompile Include="..\src\fungi.cu">
39
+ <Filter>Source Files</Filter>
40
+ </CudaCompile>
41
+ <CudaCompile Include="..\src\optical_model.cu">
42
+ <Filter>Source Files</Filter>
43
+ </CudaCompile>
44
+ </ItemGroup>
45
+ <ItemGroup>
46
+ <CustomBuild Include="E:\Fashion_MNIST_Optic_Evolution\CMakeLists.txt" />
47
+ </ItemGroup>
48
+ <ItemGroup>
49
+ <Filter Include="Header Files">
50
+ <UniqueIdentifier>{44532C73-7FE8-32FC-B4E5-957A292A3CFC}</UniqueIdentifier>
51
+ </Filter>
52
+ <Filter Include="Source Files">
53
+ <UniqueIdentifier>{D89C3F0A-3ED6-31D3-BF76-113F82B1F136}</UniqueIdentifier>
54
+ </Filter>
55
+ </ItemGroup>
56
+ </Project>
fungi.cu ADDED
@@ -0,0 +1,615 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // ======================= Mycelial Evolution System ==========================
2
+ // Implements: reward->energy, gravity attraction, motion, growth/shrink,
3
+ // death, sexual reproduction with recombination (3 children), mutation.
4
+
5
+ // --- includes you likely already have ---
6
+ #include "fungi.hpp"
7
+ #include "fungi_Paremetres.hpp"
8
+ #include <cuda_runtime.h>
9
+ #include <curand_kernel.h>
10
+ #include <algorithm>
11
+ #include <random>
12
+ #include <numeric>
13
+ #include <cmath>
14
+ #include <stdexcept>
15
+
16
+ static inline void CK(cudaError_t st, const char* msg){
17
+ if (st != cudaSuccess) throw std::runtime_error(std::string("[CUDA] ")+msg+": "+cudaGetErrorString(st));
18
+ }
19
+
20
+ // ------------------------- 1) Reward from gradient --------------------------
21
+ __device__ inline float d_phi_gauss(int x, int y, float cx, float cy,
22
+ float s, float a, float th){
23
+ // same φ as in build-masks (elliptical Gaussian)
24
+ float dx = x - cx, dy = y - cy;
25
+ float c = cosf(th), s0 = sinf(th);
26
+ float rx = a/(s*s), ry = (1.f/a)/(s*s);
27
+ float xr = c*dx + s0*dy;
28
+ float yr = -s0*dx + c*dy;
29
+ float q = 0.5f*(xr*xr*rx + yr*yr*ry);
30
+ return __expf(-q);
31
+ }
32
+
33
+ /** R[h] = + Σ_{x,y} |grad(x,y)| * φ_h(x,y) (FIX: reward HIGH gradients for feature detection) */
34
+ __global__ void k_reward_map(const float* grad, int H,int W,
35
+ const float* fx,const float* fy,const float* fs,
36
+ const float* fa,const float* fth,
37
+ float* R, int F){
38
+ int h = blockIdx.x*blockDim.x + threadIdx.x; if (h>=F) return;
39
+ float cx=fx[h], cy=fy[h], s=fs[h], a=fa[h], th=fth[h];
40
+ float acc = 0.f;
41
+ for(int y=0;y<H;y++){
42
+ for(int x=0;x<W;x++){
43
+ float ph = d_phi_gauss(x,y,cx,cy,s,a,th);
44
+ acc += ph * fabsf(grad[y*W + x]);
45
+ }
46
+ }
47
+ R[h] = +acc; // FIX: Reward HIGH gradients (removed negative sign)
48
+ }
49
+
50
+ // ------------------------- 2) Gravity & Motion ------------------------------
51
+ /** Compute softened Newtonian attraction between fungi (O(F^2), fine up to ~1k). */
52
+ __global__ void k_gravity_forces(const float* fx,const float* fy,const float* mass,
53
+ float* ax,float* ay, int F, float G, float eps2){
54
+ int i = blockIdx.x*blockDim.x + threadIdx.x; if (i>=F) return;
55
+ float xi=fx[i], yi=fy[i], mi = fmaxf(mass[i], 1e-3f);
56
+ float ax_i=0.f, ay_i=0.f;
57
+ for(int j=0;j<F;j++){
58
+ if (j==i) continue;
59
+ float dx=fx[j]-xi, dy=fy[j]-yi;
60
+ float r2 = dx*dx + dy*dy + eps2;
61
+ float invr = rsqrtf(r2);
62
+ float invr3 = invr*invr*invr;
63
+ float Fg = G * mi * mass[j] * invr3;
64
+ ax_i += Fg * dx / mi;
65
+ ay_i += Fg * dy / mi;
66
+ }
67
+ ax[i]=ax_i; ay[i]=ay_i;
68
+ }
69
+
70
+ /** Simple velocity Verlet / Euler update with damping and box bounds. */
71
+ __global__ void k_apply_motion(float* fx,float* fy,
72
+ float* vx,float* vy,
73
+ const float* ax,const float* ay,
74
+ int F, int W,int H, float dt, float damp){
75
+ int i=blockIdx.x*blockDim.x+threadIdx.x; if(i>=F) return;
76
+ float vxi = (vx?vx[i]:0.f), vyi=(vy?vy[i]:0.f);
77
+ vxi = (vxi + dt*ax[i]) * damp;
78
+ vyi = (vyi + dt*ay[i]) * damp;
79
+ float xi = fx[i] + dt*vxi;
80
+ float yi = fy[i] + dt*vyi;
81
+ // reflect at borders
82
+ if (xi<0){ xi=0; vxi=-vxi; } if (xi>W-1){ xi=W-1; vxi=-vxi; }
83
+ if (yi<0){ yi=0; vyi=-vyi; } if (yi>H-1){ yi=H-1; vyi=-vyi; }
84
+ fx[i]=xi; fy[i]=yi; if(vx) vx[i]=vxi; if(vy) vy[i]=vyi;
85
+ }
86
+
87
+ // -------------------- 3) Energy, growth/shrink, death -----------------------
88
+ /**
89
+ * Update energy with decay/food/cost and adjust radius sigma via tanh(energy).
90
+ * Mark for death (flag=1) if energy < death_th.
91
+ */
92
+ __global__ void k_energy_growth_mark(float* fx,float* fy,float* fs,float* fa,float* fth,
93
+ float* a0,float* p0,
94
+ float* energy,float* mass,int* age,
95
+ const float* R, int* deathFlag, int F,
96
+ float food,float decay,float death_th,float cost){
97
+ int h=blockIdx.x*blockDim.x+threadIdx.x; if(h>=F) return;
98
+ float e = energy[h]*decay + food*R[h] - cost*(1.f + 0.01f*fs[h]*fs[h]);
99
+ energy[h]=e; age[h] += 1;
100
+ // growth/shrink
101
+ float g=tanhf(e);
102
+ fs[h] = fmaxf(1.0f, fs[h]*(1.f + 0.05f*g));
103
+ // death mark
104
+ deathFlag[h] = (e<death_th) ? 1 : 0;
105
+ }
106
+
107
+ // -------------------- 4) Host-side reproduction (pairing etc.) --------------
108
+ /** Helper: uniform crossover + Gaussian mutation of scalar gene. */
109
+ static inline float _xover_mut(float a, float b, std::mt19937& rng, float mut_std){
110
+ std::uniform_real_distribution<float> U(0.f,1.f);
111
+ std::normal_distribution<float> N(0.f, mut_std);
112
+ float t = U(rng) < 0.5f ? a : b; // uniform crossover
113
+ return t + N(rng); // mutation
114
+ }
115
+ static inline float _clip(float v, float lo, float hi){ return std::max(lo, std::min(hi, v)); }
116
+
117
+ /** Create one child from parents i,j; append to population (HOST memory). */
118
+ static void _spawn_child(const FungiSoA& P, int i, int j,
119
+ FungiSoA& out, std::mt19937& rng,
120
+ float mut_pos=0.5f, float mut_par=0.2f){
121
+ FungiSoA& R = out;
122
+ R.F += 1;
123
+ // Ensure capacity in vectors
124
+ auto reserveF = [&](std::vector<float>& v){ if((int)v.size()<R.F) v.resize(R.F); };
125
+ auto reserveI = [&](std::vector<int>& v){ if((int)v.size()<R.F) v.resize(R.F); };
126
+ reserveF(R.x); reserveF(R.y); reserveF(R.sigma); reserveF(R.alpha); reserveF(R.theta);
127
+ reserveF(R.a_base); reserveF(R.p_base); reserveF(R.energy); reserveF(R.mass); reserveI(R.age);
128
+
129
+ int k = R.F-1;
130
+ // genes
131
+ R.x[k] = _clip(_xover_mut(P.x[i], P.x[j], rng, mut_pos), 0.f, (float)(R.W-1));
132
+ R.y[k] = _clip(_xover_mut(P.y[i], P.y[j], rng, mut_pos), 0.f, (float)(R.H-1));
133
+ R.sigma[k] = _clip(_xover_mut(P.sigma[i], P.sigma[j], rng, mut_par), 1.0f, 10.0f);
134
+ R.alpha[k] = _clip(_xover_mut(P.alpha[i], P.alpha[j], rng, 0.1f), 0.3f, 3.0f);
135
+ R.theta[k] = _xover_mut(P.theta[i], P.theta[j], rng, 0.2f);
136
+ R.a_base[k] = _xover_mut(P.a_base[i],P.a_base[j], rng, 0.1f);
137
+ R.p_base[k] = _xover_mut(P.p_base[i],P.p_base[j], rng, 0.1f);
138
+ // newborn state
139
+ R.energy[k] = 0.0f;
140
+ R.mass[k] = 0.5f*(P.mass[i]+P.mass[j]) * 0.3f; // fraction of parents' mass
141
+ R.age[k] = 0;
142
+ }
143
+
144
+ /**
145
+ * Pairing: pick adults by energy, find close pairs (distance < pair_dist),
146
+ * spawn `offspring_per_pair` children per pair (3 recommended).
147
+ * Parents donate part of mass/energy (they "shrink" a bit).
148
+ */
149
+ static void _pair_and_reproduce(FungiSoA& P, const EvoParams& evo){
150
+ std::vector<int> ids(P.F); std::iota(ids.begin(), ids.end(), 0);
151
+ std::sort(ids.begin(), ids.end(), [&](int a,int b){ return P.energy[a] > P.energy[b]; });
152
+
153
+ std::mt19937 rng(evo.seed ^ 0xBADC0DEu);
154
+ FungiSoA out = P; // start with copy; children appended here
155
+
156
+ auto dist = [&](int i,int j){
157
+ float dx=P.x[i]-P.x[j], dy=P.y[i]-P.y[j];
158
+ return std::sqrt(dx*dx+dy*dy);
159
+ };
160
+
161
+ int maxPairs = std::max(1, P.F/8);
162
+ int made=0;
163
+ for (size_t idx=0; idx+1<ids.size() && made<maxPairs; ++idx){
164
+ int i = ids[idx], j = ids[idx+1];
165
+ if (i==j) continue;
166
+ // Consider as adults if energy positive
167
+ if (P.energy[i] <= 0.f || P.energy[j] <= 0.f) continue;
168
+ if (dist(i,j) > evo.pair_dist) continue;
169
+ // Spawn children
170
+ for (int c=0; c<evo.offspring_per_pair; ++c){
171
+ _spawn_child(P, i, j, out, rng);
172
+ }
173
+ // Parents donate some mass/energy → shrink a bit
174
+ P.mass[i] *= 0.85f; P.mass[j] *= 0.85f;
175
+ P.sigma[i]*= 0.95f; P.sigma[j]*= 0.95f;
176
+ P.energy[i]*= 0.7f; P.energy[j]*= 0.7f;
177
+ made++;
178
+ }
179
+
180
+ // Compact deaths and cap population
181
+ // First remove completely "dead" individuals: energy << 0 or mass very small
182
+ std::vector<int> keep(out.F, 1);
183
+ for(int h=0; h<out.F; ++h){
184
+ if (out.energy[h] < -2.0f || out.mass[h] < 0.05f) keep[h]=0;
185
+ }
186
+ // Create list of survivors
187
+ std::vector<int> order; order.reserve(out.F);
188
+ for(int h=0; h<out.F; ++h) if(keep[h]) order.push_back(h);
189
+
190
+ // Cap by energy (keep best) if necessary
191
+ int cap = evo.max_population>0 ? evo.max_population : (int)std::floor(1.5 * (double)P.F);
192
+ if ((int)order.size() > cap){
193
+ std::sort(order.begin(), order.end(), [&](int a,int b){ return out.energy[a] > out.energy[b]; });
194
+ order.resize(cap);
195
+ }
196
+
197
+ // Rewrite P with survivors in `order`
198
+ auto pick = [&](std::vector<float>& v){
199
+ std::vector<float> nv; nv.reserve(order.size());
200
+ for(int id: order) nv.push_back(v[id]); v.swap(nv);
201
+ };
202
+ auto picki = [&](std::vector<int>& v){
203
+ std::vector<int> nv; nv.reserve(order.size());
204
+ for(int id: order) nv.push_back(v[id]); v.swap(nv);
205
+ };
206
+ pick(out.x); pick(out.y); pick(out.sigma); pick(out.alpha); pick(out.theta);
207
+ pick(out.a_base); pick(out.p_base); pick(out.energy); pick(out.mass); picki(out.age);
208
+ out.F = (int)order.size();
209
+ P = std::move(out);
210
+ }
211
+
212
+ // ---------------------- 5) Full ecology step (public) -----------------------
213
+ void fungi_ecology_step(FungiSoA& pop, const float* d_grad_map, const EvoParams& evo){
214
+ const int F=pop.F, H=pop.H, W=pop.W;
215
+ if (F<=0) return;
216
+
217
+ // Upload SoA to device
218
+ float *fx,*fy,*fs,*fa,*fth,*a0,*p0,*E,*M; int *Age;
219
+ CK(cudaMalloc(&fx,sizeof(float)*F),"alloc fx");
220
+ CK(cudaMalloc(&fy,sizeof(float)*F),"alloc fy");
221
+ CK(cudaMalloc(&fs,sizeof(float)*F),"alloc fs");
222
+ CK(cudaMalloc(&fa,sizeof(float)*F),"alloc fa");
223
+ CK(cudaMalloc(&fth,sizeof(float)*F),"alloc th");
224
+ CK(cudaMalloc(&a0,sizeof(float)*F),"alloc a0");
225
+ CK(cudaMalloc(&p0,sizeof(float)*F),"alloc p0");
226
+ CK(cudaMalloc(&E, sizeof(float)*F),"alloc E");
227
+ CK(cudaMalloc(&M, sizeof(float)*F),"alloc M");
228
+ CK(cudaMalloc(&Age,sizeof(int)*F),"alloc Age");
229
+
230
+ CK(cudaMemcpy(fx, pop.x.data(), sizeof(float)*F, cudaMemcpyHostToDevice),"H2D fx");
231
+ CK(cudaMemcpy(fy, pop.y.data(), sizeof(float)*F, cudaMemcpyHostToDevice),"H2D fy");
232
+ CK(cudaMemcpy(fs, pop.sigma.data(), sizeof(float)*F, cudaMemcpyHostToDevice),"H2D fs");
233
+ CK(cudaMemcpy(fa, pop.alpha.data(), sizeof(float)*F, cudaMemcpyHostToDevice),"H2D fa");
234
+ CK(cudaMemcpy(fth,pop.theta.data(), sizeof(float)*F, cudaMemcpyHostToDevice),"H2D th");
235
+ CK(cudaMemcpy(a0, pop.a_base.data(),sizeof(float)*F, cudaMemcpyHostToDevice),"H2D a0");
236
+ CK(cudaMemcpy(p0, pop.p_base.data(),sizeof(float)*F, cudaMemcpyHostToDevice),"H2D p0");
237
+ CK(cudaMemcpy(E, pop.energy.data(),sizeof(float)*F, cudaMemcpyHostToDevice),"H2D E");
238
+ CK(cudaMemcpy(M, pop.mass.data(), sizeof(float)*F, cudaMemcpyHostToDevice),"H2D M");
239
+ CK(cudaMemcpy(Age,pop.age.data(), sizeof(int)*F, cudaMemcpyHostToDevice),"H2D Age");
240
+
241
+ // 1) Reward
242
+ float* dR=nullptr; CK(cudaMalloc(&dR,sizeof(float)*F),"alloc R");
243
+ k_reward_map<<<(F+255)/256,256>>>(d_grad_map, H,W, fx,fy,fs,fa,fth, dR, F);
244
+
245
+ // 2) Gravity & motion (alloc vel/acc)
246
+ float *ax,*ay,*vx,*vy; CK(cudaMalloc(&ax,sizeof(float)*F),"alloc ax");
247
+ CK(cudaMalloc(&ay,sizeof(float)*F),"alloc ay");
248
+ CK(cudaMalloc(&vx,sizeof(float)*F),"alloc vx");
249
+ CK(cudaMalloc(&vy,sizeof(float)*F),"alloc vy");
250
+ CK(cudaMemset(vx,0,sizeof(float)*F),"zero vx");
251
+ CK(cudaMemset(vy,0,sizeof(float)*F),"zero vy");
252
+
253
+ k_gravity_forces<<<(F+255)/256,256>>>(fx,fy,M, ax,ay, F, evo.G, evo.eps2);
254
+ k_apply_motion<<<(F+255)/256,256>>>(fx,fy, vx,vy, ax,ay, F, W,H, evo.dt, evo.damp);
255
+
256
+ // 3) Energy/growth + death flags
257
+ int* dDead=nullptr; CK(cudaMalloc(&dDead,sizeof(int)*F),"alloc deadFlag");
258
+ CK(cudaMemset(dDead,0,sizeof(int)*F),"zero deadFlag");
259
+ k_energy_growth_mark<<<(F+255)/256,256>>>(fx,fy,fs,fa,fth, a0,p0, E,M,Age,
260
+ dR, dDead, F,
261
+ evo.food,evo.decay,evo.death_th,evo.cost);
262
+
263
+ // Download updated arrays
264
+ std::vector<int> hDead(F);
265
+ CK(cudaMemcpy(pop.x.data(), fx, sizeof(float)*F, cudaMemcpyDeviceToHost),"D2H fx");
266
+ CK(cudaMemcpy(pop.y.data(), fy, sizeof(float)*F, cudaMemcpyDeviceToHost),"D2H fy");
267
+ CK(cudaMemcpy(pop.sigma.data(), fs, sizeof(float)*F, cudaMemcpyDeviceToHost),"D2H fs");
268
+ CK(cudaMemcpy(pop.alpha.data(), fa, sizeof(float)*F, cudaMemcpyDeviceToHost),"D2H fa");
269
+ CK(cudaMemcpy(pop.theta.data(), fth,sizeof(float)*F, cudaMemcpyDeviceToHost),"D2H th");
270
+ CK(cudaMemcpy(pop.a_base.data(),a0, sizeof(float)*F, cudaMemcpyDeviceToHost),"D2H a0");
271
+ CK(cudaMemcpy(pop.p_base.data(),p0, sizeof(float)*F, cudaMemcpyDeviceToHost),"D2H p0");
272
+ CK(cudaMemcpy(pop.energy.data(),E, sizeof(float)*F, cudaMemcpyDeviceToHost),"D2H E");
273
+ CK(cudaMemcpy(pop.mass.data(), M, sizeof(float)*F, cudaMemcpyDeviceToHost),"D2H M");
274
+ CK(cudaMemcpy(pop.age.data(), Age, sizeof(int)*F, cudaMemcpyDeviceToHost),"D2H Age");
275
+ CK(cudaMemcpy(hDead.data(), dDead, sizeof(int)*F, cudaMemcpyDeviceToHost),"D2H deadFlag");
276
+
277
+ // Free device temporaries
278
+ cudaFree(dR); cudaFree(ax); cudaFree(ay); cudaFree(vx); cudaFree(vy); cudaFree(dDead);
279
+ cudaFree(fx); cudaFree(fy); cudaFree(fs); cudaFree(fa); cudaFree(fth);
280
+ cudaFree(a0); cudaFree(p0); cudaFree(E); cudaFree(M); cudaFree(Age);
281
+
282
+ // Remove marked dead on HOST quickly
283
+ std::vector<int> keep; keep.reserve(pop.F);
284
+ for (int i=0;i<pop.F;i++) if(!hDead[i]) keep.push_back(i);
285
+ auto pick = [&](std::vector<float>& v){
286
+ std::vector<float> nv; nv.reserve(keep.size());
287
+ for(int id: keep) nv.push_back(v[id]); v.swap(nv);
288
+ };
289
+ auto picki=[&](std::vector<int>& v){
290
+ std::vector<int> nv; nv.reserve(keep.size());
291
+ for(int id: keep) nv.push_back(v[id]); v.swap(nv);
292
+ };
293
+ pick(pop.x); pick(pop.y); pick(pop.sigma); pick(pop.alpha); pick(pop.theta);
294
+ pick(pop.a_base); pick(pop.p_base); pick(pop.energy); pick(pop.mass); picki(pop.age);
295
+ pop.F = (int)keep.size();
296
+
297
+ // 4) Pairing & reproduction (3 children per pair by default)
298
+ _pair_and_reproduce(pop, evo);
299
+ }
300
+
301
+
302
+ #include "fungi.hpp"
303
+ #include <cuda_runtime.h>
304
+ #include <curand_kernel.h>
305
+ #include <algorithm>
306
+ #include <numeric>
307
+ #include <cmath>
308
+ #include <stdexcept>
309
+
310
+ static inline void ck(cudaError_t st, const char* msg){
311
+ if (st != cudaSuccess) { throw std::runtime_error(std::string("[CUDA] ")+msg+": "+cudaGetErrorString(st)); }
312
+ }
313
+
314
+ void FungiSoA::resize(int F_, int H_, int W_) {
315
+ F = F_; H=H_; W=W_;
316
+ x.resize(F); y.resize(F); sigma.resize(F); alpha.resize(F); theta.resize(F);
317
+ a_base.resize(F); p_base.resize(F);
318
+ energy.assign(F, 0.f); mass.assign(F, 1.f); age.assign(F, 0);
319
+ }
320
+ void FungiSoA::init_random(unsigned seed, float sigma_min, float sigma_max) {
321
+ std::mt19937 rng(seed);
322
+ std::uniform_real_distribution<float> Ux(0.f, (float)(W-1));
323
+ std::uniform_real_distribution<float> Uy(0.f, (float)(H-1));
324
+ std::uniform_real_distribution<float> Us(sigma_min, sigma_max);
325
+ std::uniform_real_distribution<float> Ua(0.7f, 1.3f);
326
+ std::uniform_real_distribution<float> Ut(-3.1415926f, 3.1415926f);
327
+ std::normal_distribution<float> N01(0.f, 0.15f);
328
+ for (int i=0;i<F;i++){
329
+ x[i]=Ux(rng); y[i]=Uy(rng); sigma[i]=Us(rng);
330
+ alpha[i]=Ua(rng); theta[i]=Ut(rng);
331
+ a_base[i]=N01(rng); p_base[i]=N01(rng);
332
+ }
333
+ }
334
+
335
+
336
+ void FungiSoA::adjust_population(int newF, unsigned seed) {
337
+ if (newF < 1) newF = 1;
338
+ if (newF == F) return;
339
+
340
+ if (newF < F) {
341
+ std::vector<int> idx(F);
342
+ std::iota(idx.begin(), idx.end(), 0);
343
+ std::partial_sort(idx.begin(), idx.begin() + newF, idx.end(), [&](int a, int b){
344
+ return energy[a] > energy[b];
345
+ });
346
+ idx.resize(newF);
347
+ auto reorderF = [&](std::vector<float>& v){
348
+ std::vector<float> nv; nv.reserve(newF);
349
+ for (int id : idx) nv.push_back(v[id]);
350
+ v.swap(nv);
351
+ };
352
+ auto reorderI = [&](std::vector<int>& v){
353
+ std::vector<int> nv; nv.reserve(newF);
354
+ for (int id : idx) nv.push_back(v[id]);
355
+ v.swap(nv);
356
+ };
357
+ reorderF(x); reorderF(y); reorderF(sigma); reorderF(alpha); reorderF(theta);
358
+ reorderF(a_base); reorderF(p_base); reorderF(energy); reorderF(mass);
359
+ reorderI(age);
360
+ F = newF;
361
+ return;
362
+ }
363
+
364
+ int oldF = F;
365
+ x.resize(newF); y.resize(newF); sigma.resize(newF); alpha.resize(newF); theta.resize(newF);
366
+ a_base.resize(newF); p_base.resize(newF); energy.resize(newF); mass.resize(newF); age.resize(newF);
367
+
368
+ std::mt19937 rng(seed ^ (unsigned)newF);
369
+ std::uniform_real_distribution<float> Ux(0.f, (float)(W>0?W-1:0));
370
+ std::uniform_real_distribution<float> Uy(0.f, (float)(H>0?H-1:0));
371
+ std::uniform_real_distribution<float> Us(1.5f, 6.5f);
372
+ std::uniform_real_distribution<float> Ua(0.5f, 1.6f);
373
+ std::uniform_real_distribution<float> Ut(-3.1415926f, 3.1415926f);
374
+ std::normal_distribution<float> Namp(0.f, 0.3f);
375
+
376
+ for (int i = oldF; i < newF; ++i) {
377
+ x[i] = (W > 0) ? Ux(rng) : 0.f;
378
+ y[i] = (H > 0) ? Uy(rng) : 0.f;
379
+ sigma[i] = Us(rng);
380
+ alpha[i] = Ua(rng);
381
+ theta[i] = Ut(rng);
382
+ a_base[i] = Namp(rng);
383
+ p_base[i] = Namp(rng);
384
+ energy[i] = 0.f;
385
+ mass[i] = 1.f;
386
+ age[i] = 0;
387
+ }
388
+ F = newF;
389
+ }
390
+
391
+ // ------------------ GPU kernels ------------------
392
+ __global__ void k_clear(float* A, int N, float v=0.f){ int i=blockIdx.x*blockDim.x+threadIdx.x; if(i<N) A[i]=v; }
393
+
394
+ /** Gaussian elliptical basis φ_h(x,y). */
395
+ __device__ inline float phi_gauss(int x, int y, float cx, float cy, float s, float a, float th){
396
+ float dx = x - cx, dy = y - cy;
397
+ float c = cosf(th), s0 = sinf(th);
398
+ float rx = a/(s*s), ry = (1.f/a)/(s*s);
399
+ // Rotate
400
+ float xr = c*dx + s0*dy;
401
+ float yr = -s0*dx + c*dy;
402
+ float q = 0.5f*(xr*xr*rx + yr*yr*ry);
403
+ return __expf(-q);
404
+ }
405
+
406
+ /** Accumulate masks from fungi (naive per-pixel; for 28x28 or small HxW it's fast). */
407
+ __global__ void k_build_masks(const float* fx,const float* fy,const float* fs,const float* fa,const float* fth,
408
+ const float* fa0,const float* fp0, int F,
409
+ float* A, float* P, int H, int W){
410
+ int idx = blockIdx.x * blockDim.x + threadIdx.x;
411
+ int N = H*W; if (idx>=N) return;
412
+ int y = idx / W, x = idx % W;
413
+ float sa=0.f, sp=0.f;
414
+ #pragma unroll 4
415
+ for(int h=0; h<F; ++h){
416
+ float ph = phi_gauss(x,y, fx[h],fy[h],fs[h],fa[h],fth[h]);
417
+ sa += fa0[h] * ph;
418
+ sp += fp0[h] * ph;
419
+ }
420
+ // Map to physical domain with CLAMPING to prevent oversaturation
421
+ // A = clamped_softplus(sa)+eps ; P = pi * tanh(sp)
422
+ float Araw = fminf(log1pf(expf(fminf(sa, 2.0f))), 2.0f) + 1e-3f; // FIX: Clamp amplitude max 2.0
423
+ float Praw = 3.1415926f * tanhf(fminf(fmaxf(sp, -1.0f), 1.0f)); // FIX: Clamp phase input
424
+ A[idx] = Araw;
425
+ P[idx] = Praw;
426
+ }
427
+
428
+ void fungi_build_masks_GPU(const FungiSoA& pop,
429
+ float* d_A, float* d_P,
430
+ int /*tiles_y*/, int /*tiles_x*/) {
431
+ // Upload minimal arrays (F is small ~128-512)
432
+ float *dx,*dy,*ds,*da,*dt,*dab,*dpb;
433
+ ck(cudaMalloc(&dx, sizeof(float)*pop.F), "alloc fx");
434
+ ck(cudaMalloc(&dy, sizeof(float)*pop.F), "alloc fy");
435
+ ck(cudaMalloc(&ds, sizeof(float)*pop.F), "alloc fs");
436
+ ck(cudaMalloc(&da, sizeof(float)*pop.F), "alloc fa");
437
+ ck(cudaMalloc(&dt, sizeof(float)*pop.F), "alloc fth");
438
+ ck(cudaMalloc(&dab,sizeof(float)*pop.F), "alloc a0");
439
+ ck(cudaMalloc(&dpb,sizeof(float)*pop.F), "alloc p0");
440
+ ck(cudaMemcpy(dx, pop.x.data(), sizeof(float)*pop.F, cudaMemcpyHostToDevice), "H2D fx");
441
+ ck(cudaMemcpy(dy, pop.y.data(), sizeof(float)*pop.F, cudaMemcpyHostToDevice), "H2D fy");
442
+ ck(cudaMemcpy(ds, pop.sigma.data(), sizeof(float)*pop.F, cudaMemcpyHostToDevice), "H2D fs");
443
+ ck(cudaMemcpy(da, pop.alpha.data(), sizeof(float)*pop.F, cudaMemcpyHostToDevice), "H2D fa");
444
+ ck(cudaMemcpy(dt, pop.theta.data(), sizeof(float)*pop.F, cudaMemcpyHostToDevice), "H2D fth");
445
+ ck(cudaMemcpy(dab,pop.a_base.data(), sizeof(float)*pop.F, cudaMemcpyHostToDevice), "H2D a0");
446
+ ck(cudaMemcpy(dpb,pop.p_base.data(), sizeof(float)*pop.F, cudaMemcpyHostToDevice), "H2D p0");
447
+
448
+ int N = pop.H*pop.W;
449
+ k_clear<<<(N+255)/256,256>>>(d_A, N, 0.f);
450
+ k_clear<<<(N+255)/256,256>>>(d_P, N, 0.f);
451
+ k_build_masks<<<(N+255)/256,256>>>(dx,dy,ds,da,dt, dab,dpb,pop.F, d_A,d_P, pop.H,pop.W);
452
+ cudaFree(dx); cudaFree(dy); cudaFree(ds); cudaFree(da); cudaFree(dt); cudaFree(dab); cudaFree(dpb);
453
+ }
454
+
455
+ // --- simple RNG on device for evolution ---
456
+ __global__ void k_rng_init(curandStatePhilox4_32_10_t* st, unsigned seed, int n){
457
+ int i=blockIdx.x*blockDim.x+threadIdx.x; if(i<n) curand_init(seed, i, 0, &st[i]);
458
+ }
459
+
460
+ // Reward accumulation: R_h = -sum φ_h * grad(x,y)
461
+ __global__ void k_reward(const float* grad, int H, int W,
462
+ const float* fx,const float* fy,const float* fs,const float* fa,const float* fth,
463
+ float* R, int F){
464
+ int h = blockIdx.x*blockDim.x+threadIdx.x; if(h>=F) return;
465
+ float cx=fx[h], cy=fy[h], s=fs[h], a=fa[h], th=fth[h];
466
+ float acc=0.f;
467
+ for(int y=0;y<H;y++){
468
+ for(int x=0;x<W;x++){
469
+ float ph = phi_gauss(x,y,cx,cy,s,a,th);
470
+ acc += ph * fabsf(grad[y*W+x]); // magnitude proxy
471
+ }
472
+ }
473
+ R[h] = +acc; // FIX: Reward HIGH gradients (removed negative sign) // want to reduce gradient magnitude
474
+ }
475
+
476
+ __global__ void k_evolve(float* fx,float* fy,float* fs,float* fa,float* fth,
477
+ float* a0,float* p0,float* energy,float* mass,int* age,
478
+ const float* R, int F, int H, int W,
479
+ float food,float decay,float death_th,float cost,
480
+ curandStatePhilox4_32_10_t* rng){
481
+ int h = blockIdx.x*blockDim.x+threadIdx.x; if(h>=F) return;
482
+ curandStatePhilox4_32_10_t st = rng[h];
483
+
484
+ float e = energy[h]*decay + food*R[h] - cost*(1.f + 0.01f*fs[h]*fs[h]); // penalize large radius
485
+ energy[h] = e;
486
+ age[h] += 1;
487
+
488
+ // Growth/Shrink
489
+ float g = tanhf(e); // [-1,1]
490
+ fs[h] = fmaxf(1.0f, fs[h] * (1.f + 0.05f*g));
491
+
492
+ // Small random drift (Brownian)
493
+ float dx=(curand_uniform(&st)-0.5f)*1.0f, dy=(curand_uniform(&st)-0.5f)*1.0f;
494
+ fx[h] = fminf(fmaxf(fx[h] + dx, 0.f), (float)(W-1));
495
+ fy[h] = fminf(fmaxf(fy[h] + dy, 0.f), (float)(H-1));
496
+
497
+ // Rejuvenate bad fungi
498
+ if(e < death_th){
499
+ fx[h]=curand_uniform(&st)*(W-1.f);
500
+ fy[h]=curand_uniform(&st)*(H-1.f);
501
+ fs[h]=1.5f + 4.0f*curand_uniform(&st);
502
+ fa[h]=0.8f + 0.6f*curand_uniform(&st);
503
+ fth[h]=(curand_uniform(&st)*2.f-1.f)*3.1415926f;
504
+ a0[h]+= (curand_uniform(&st)-0.5f)*0.2f;
505
+ p0[h]+= (curand_uniform(&st)-0.5f)*0.2f;
506
+ energy[h]=0.f; mass[h]=1.f; age[h]=0;
507
+ }
508
+ rng[h]=st;
509
+ }
510
+
511
+ void fungi_evolve_GPU(FungiSoA& pop,
512
+ const float* d_grad_map,
513
+ int evo_pairs,
514
+ float food, float decay, float death_th,
515
+ float cost, unsigned seed){
516
+ (void)evo_pairs; // (pairing/attraction left minimal; reward-based dynamics are cheap & robust)
517
+ // Upload SoA
518
+ float *fx,*fy,*fs,*fa,*fth,*a0,*p0,*E,*M; int *Age;
519
+ ck(cudaMalloc(&fx,sizeof(float)*pop.F),"alloc fx"); ck(cudaMalloc(&fy,sizeof(float)*pop.F),"alloc fy");
520
+ ck(cudaMalloc(&fs,sizeof(float)*pop.F),"alloc fs"); ck(cudaMalloc(&fa,sizeof(float)*pop.F),"alloc fa");
521
+ ck(cudaMalloc(&fth,sizeof(float)*pop.F),"alloc th"); ck(cudaMalloc(&a0,sizeof(float)*pop.F),"alloc a0");
522
+ ck(cudaMalloc(&p0,sizeof(float)*pop.F),"alloc p0"); ck(cudaMalloc(&E,sizeof(float)*pop.F),"alloc E");
523
+ ck(cudaMalloc(&M,sizeof(float)*pop.F),"alloc M"); ck(cudaMalloc(&Age,sizeof(int)*pop.F),"alloc age");
524
+
525
+ ck(cudaMemcpy(fx, pop.x.data(), sizeof(float)*pop.F, cudaMemcpyHostToDevice),"H2D fx");
526
+ ck(cudaMemcpy(fy, pop.y.data(), sizeof(float)*pop.F, cudaMemcpyHostToDevice),"H2D fy");
527
+ ck(cudaMemcpy(fs, pop.sigma.data(), sizeof(float)*pop.F, cudaMemcpyHostToDevice),"H2D fs");
528
+ ck(cudaMemcpy(fa, pop.alpha.data(), sizeof(float)*pop.F, cudaMemcpyHostToDevice),"H2D fa");
529
+ ck(cudaMemcpy(fth,pop.theta.data(), sizeof(float)*pop.F, cudaMemcpyHostToDevice),"H2D th");
530
+ ck(cudaMemcpy(a0, pop.a_base.data(), sizeof(float)*pop.F, cudaMemcpyHostToDevice),"H2D a0");
531
+ ck(cudaMemcpy(p0, pop.p_base.data(), sizeof(float)*pop.F, cudaMemcpyHostToDevice),"H2D p0");
532
+ ck(cudaMemcpy(E, pop.energy.data(),sizeof(float)*pop.F, cudaMemcpyHostToDevice),"H2D E");
533
+ ck(cudaMemcpy(M, pop.mass.data(), sizeof(float)*pop.F, cudaMemcpyHostToDevice),"H2D M");
534
+ ck(cudaMemcpy(Age,pop.age.data(), sizeof(int)*pop.F, cudaMemcpyHostToDevice),"H2D age");
535
+
536
+ // Reward
537
+ float* dR=nullptr; ck(cudaMalloc(&dR,sizeof(float)*pop.F),"alloc R");
538
+ k_reward<<<(pop.F+255)/256,256>>>(d_grad_map, pop.H,pop.W, fx,fy,fs,fa,fth, dR, pop.F);
539
+
540
+ // RNG & evolve
541
+ curandStatePhilox4_32_10_t* rng; ck(cudaMalloc(&rng,sizeof(curandStatePhilox4_32_10_t)*pop.F),"alloc rng");
542
+ k_rng_init<<<(pop.F+255)/256,256>>>(rng, seed, pop.F);
543
+ k_evolve<<<(pop.F+255)/256,256>>>(fx,fy,fs,fa,fth, a0,p0,E,M,Age, dR, pop.F, pop.H,pop.W, food,decay,death_th,cost, rng);
544
+
545
+ // Download
546
+ ck(cudaMemcpy(pop.x.data(), fx, sizeof(float)*pop.F, cudaMemcpyDeviceToHost),"D2H fx");
547
+ ck(cudaMemcpy(pop.y.data(), fy, sizeof(float)*pop.F, cudaMemcpyDeviceToHost),"D2H fy");
548
+ ck(cudaMemcpy(pop.sigma.data(), fs, sizeof(float)*pop.F, cudaMemcpyDeviceToHost),"D2H fs");
549
+ ck(cudaMemcpy(pop.alpha.data(), fa, sizeof(float)*pop.F, cudaMemcpyDeviceToHost),"D2H fa");
550
+ ck(cudaMemcpy(pop.theta.data(), fth,sizeof(float)*pop.F, cudaMemcpyDeviceToHost),"D2H th");
551
+ ck(cudaMemcpy(pop.a_base.data(), a0,sizeof(float)*pop.F, cudaMemcpyDeviceToHost),"D2H a0");
552
+ ck(cudaMemcpy(pop.p_base.data(), p0,sizeof(float)*pop.F, cudaMemcpyDeviceToHost),"D2H p0");
553
+ ck(cudaMemcpy(pop.energy.data(), E, sizeof(float)*pop.F, cudaMemcpyDeviceToHost),"D2H E");
554
+ ck(cudaMemcpy(pop.mass.data(), M, sizeof(float)*pop.F, cudaMemcpyDeviceToHost),"D2H M");
555
+ ck(cudaMemcpy(pop.age.data(), Age,sizeof(int)*pop.F, cudaMemcpyDeviceToHost),"D2H age");
556
+
557
+ cudaFree(dR); cudaFree(rng);
558
+ cudaFree(fx); cudaFree(fy); cudaFree(fs); cudaFree(fa); cudaFree(fth);
559
+ cudaFree(a0); cudaFree(p0); cudaFree(E); cudaFree(M); cudaFree(Age);
560
+ }
561
+
562
+ void download_mask(float* h, const float* d, int HW){
563
+ ck(cudaMemcpy(h,d,sizeof(float)*HW,cudaMemcpyDeviceToHost),"D2H mask");
564
+ }
565
+
566
+ // ================== DIAGNOSTIC TOOLS ==================
567
+
568
+ void fungi_create_test_pattern(float* h_pattern, int H, int W, int pattern_type) {
569
+ for (int y = 0; y < H; y++) {
570
+ for (int x = 0; x < W; x++) {
571
+ float val = 0.0f;
572
+ switch (pattern_type) {
573
+ case 0: // Checkerboard 4x4
574
+ val = ((x/4 + y/4) % 2) ? 1.0f : 0.0f;
575
+ break;
576
+ case 1: // Gradient horizontal
577
+ val = (float)x / (W-1);
578
+ break;
579
+ case 2: // Concentric circles
580
+ {
581
+ float cx = W/2.0f, cy = H/2.0f;
582
+ float r = sqrtf((x-cx)*(x-cx) + (y-cy)*(y-cy));
583
+ val = 0.5f + 0.5f * sinf(r * 0.5f);
584
+ }
585
+ break;
586
+ case 3: // Delta impulse (center)
587
+ val = (x == W/2 && y == H/2) ? 1.0f : 0.0f;
588
+ break;
589
+ }
590
+ h_pattern[y*W + x] = val;
591
+ }
592
+ }
593
+ }
594
+
595
+ void fungi_analyze_mask_statistics(const float* d_A, const float* d_P, int HW) {
596
+ std::vector<float> h_A(HW), h_P(HW);
597
+ ck(cudaMemcpy(h_A.data(), d_A, sizeof(float)*HW, cudaMemcpyDeviceToHost), "D2H A");
598
+ ck(cudaMemcpy(h_P.data(), d_P, sizeof(float)*HW, cudaMemcpyDeviceToHost), "D2H P");
599
+
600
+ // Estadísticas de Amplitud
601
+ float A_min = *std::min_element(h_A.begin(), h_A.end());
602
+ float A_max = *std::max_element(h_A.begin(), h_A.end());
603
+ float A_mean = std::accumulate(h_A.begin(), h_A.end(), 0.0f) / HW;
604
+
605
+ // Estadísticas de Fase
606
+ float P_min = *std::min_element(h_P.begin(), h_P.end());
607
+ float P_max = *std::max_element(h_P.begin(), h_P.end());
608
+ float P_mean = std::accumulate(h_P.begin(), h_P.end(), 0.0f) / HW;
609
+
610
+ printf("🔍 FUNGI MASK STATISTICS:\n");
611
+ printf(" Amplitude: min=%.3f, max=%.3f, mean=%.3f\n", A_min, A_max, A_mean);
612
+ printf(" Phase: min=%.3f, max=%.3f, mean=%.3f\n", P_min, P_max, P_mean);
613
+ printf(" A oversaturation: %s\n", (A_max > 1.9f) ? "⚠️ YES" : "✅ NO");
614
+ printf(" P range check: %s\n", (P_max > 3.2f || P_min < -3.2f) ? "⚠️ OUT OF RANGE" : "✅ OK");
615
+ }
fungi.cu.cache ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Identity=..\src\fungi.cu
2
+ AdditionalCompilerOptions=
3
+ AdditionalCompilerOptions=
4
+ AdditionalDependencies=
5
+ AdditionalDeps=
6
+ AdditionalLibraryDirectories=
7
+ AdditionalOptions= -std=c++17 --generate-code=arch=compute_75,code=[compute_75,sm_75] --generate-code=arch=compute_80,code=[compute_80,sm_80] --generate-code=arch=compute_86,code=[compute_86,sm_86] -Xcompiler="/EHsc -Ob2"
8
+ AdditionalOptions= -std=c++17 --generate-code=arch=compute_75,code=[compute_75,sm_75] --generate-code=arch=compute_80,code=[compute_80,sm_80] --generate-code=arch=compute_86,code=[compute_86,sm_86] -Xcompiler="/EHsc -Ob2"
9
+ CodeGeneration=
10
+ CodeGeneration=
11
+ CompileOut=fashion_mnist_trainer.dir\Release\fungi.obj
12
+ CudaRuntime=Static
13
+ CudaToolkitCustomDir=
14
+ DebugInformationFormat=None
15
+ DebugInformationFormat=None
16
+ Defines=;_WINDOWS;NDEBUG;CMAKE_INTDIR="Release";_MBCS;;WIN32;_WINDOWS;NDEBUG;CMAKE_INTDIR="Release"
17
+ Emulation=false
18
+ EnableVirtualArchInFatbin=true
19
+ ExtensibleWholeProgramCompilation=false
20
+ FastCompile=Off
21
+ FastMath=true
22
+ GenerateLineInfo=false
23
+ GenerateRelocatableDeviceCode=true
24
+ GPUDebugInfo=false
25
+ GPUDebugInfo=false
26
+ HostDebugInfo=false
27
+ Include=E:\Fashion_MNIST_Optic_Evolution\src;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\cccl
28
+ Inputs=
29
+ InterleaveSourceInPTX=false
30
+ Keep=false
31
+ KeepDir=fashion_.2B82790A\x64\Release
32
+ LinkOut=
33
+ MaxRegCount=0
34
+ NvccCompilation=compile
35
+ NvccPath=
36
+ Optimization=O2
37
+ Optimization=O2
38
+ PerformDeviceLink=
39
+ PerformDeviceLinkTimeOptimization=
40
+ PtxAsOptionV=false
41
+ RequiredIncludes=
42
+ Runtime=MD
43
+ Runtime=MD
44
+ RuntimeChecks=Default
45
+ RuntimeChecks=Default
46
+ SplitCompile=Default
47
+ SplitCompileCustomThreads=
48
+ TargetMachinePlatform=64
49
+ TargetMachinePlatform=64
50
+ TypeInfo=true
51
+ TypeInfo=true
52
+ UseHostDefines=true
53
+ UseHostInclude=false
54
+ UseHostLibraryDependencies=
55
+ UseHostLibraryDirectories=
56
+ Warning=W1
57
+ Warning=W1
fungi.cu1408063174.deps ADDED
@@ -0,0 +1,181 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\corecrt.h
2
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\corecrt_malloc.h
3
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\corecrt_math.h
4
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\corecrt_memcpy_s.h
5
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\corecrt_memory.h
6
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\corecrt_search.h
7
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\corecrt_share.h
8
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\corecrt_stdio_config.h
9
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\corecrt_terminate.h
10
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\corecrt_wconio.h
11
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\corecrt_wctype.h
12
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\corecrt_wdirect.h
13
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\corecrt_wio.h
14
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\corecrt_wprocess.h
15
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\corecrt_wstdio.h
16
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\corecrt_wstdlib.h
17
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\corecrt_wstring.h
18
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\corecrt_wtime.h
19
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\crtdbg.h
20
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\ctype.h
21
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\errno.h
22
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\float.h
23
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\locale.h
24
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\malloc.h
25
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\math.h
26
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\memory.h
27
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\share.h
28
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\stddef.h
29
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\stdio.h
30
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\stdlib.h
31
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\string.h
32
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\sys\stat.h
33
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\sys\types.h
34
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\time.h
35
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\wchar.h
36
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\builtin_types.h
37
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\channel_descriptor.h
38
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\crt\common_functions.h
39
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\crt\cudacc_ext.h
40
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\crt\device_double_functions.h
41
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\crt\device_double_functions.hpp
42
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\crt\device_functions.h
43
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\crt\device_functions.hpp
44
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\crt\host_config.h
45
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\crt\host_defines.h
46
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\crt\math_functions.h
47
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\crt\math_functions.hpp
48
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\crt\sm_100_rt.h
49
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\crt\sm_70_rt.h
50
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\crt\sm_80_rt.h
51
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\crt\sm_90_rt.h
52
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\cuda_device_runtime_api.h
53
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\cuda_runtime.h
54
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\cuda_runtime_api.h
55
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\curand.h
56
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\curand_discrete.h
57
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\curand_discrete2.h
58
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\curand_globals.h
59
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\curand_kernel.h
60
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\curand_lognormal.h
61
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\curand_mrg32k3a.h
62
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\curand_mtgp32.h
63
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\curand_mtgp32_kernel.h
64
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\curand_normal.h
65
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\curand_normal_static.h
66
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\curand_philox4x32_x.h
67
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\curand_poisson.h
68
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\curand_precalc.h
69
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\curand_uniform.h
70
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\device_atomic_functions.h
71
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\device_launch_parameters.h
72
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\device_types.h
73
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\driver_functions.h
74
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\driver_types.h
75
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\library_types.h
76
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\nv\detail\__preprocessor
77
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\nv\detail\__target_macros
78
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\nv\target
79
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\sm_20_atomic_functions.h
80
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\sm_20_intrinsics.h
81
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\sm_30_intrinsics.h
82
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\sm_32_atomic_functions.h
83
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\sm_32_intrinsics.h
84
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\sm_35_atomic_functions.h
85
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\sm_35_intrinsics.h
86
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\sm_60_atomic_functions.h
87
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\sm_61_intrinsics.h
88
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\surface_indirect_functions.h
89
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\surface_types.h
90
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\texture_indirect_functions.h
91
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\texture_types.h
92
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\vector_functions.h
93
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\vector_functions.hpp
94
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\vector_types.h
95
+ E:\Fashion_MNIST_Optic_Evolution\src\fungi.hpp
96
+ E:\Fashion_MNIST_Optic_Evolution\src\fungi_Paremetres.hpp
97
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\algorithm
98
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\ammintrin.h
99
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\atomic
100
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\cctype
101
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\cerrno
102
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\cfloat
103
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\climits
104
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\clocale
105
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\cmath
106
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\concurrencysal.h
107
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\crtdefs.h
108
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\cstddef
109
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\cstdint
110
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\cstdio
111
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\cstdlib
112
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\cstring
113
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\ctime
114
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\cwchar
115
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\eh.h
116
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\emmintrin.h
117
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\exception
118
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\immintrin.h
119
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\initializer_list
120
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\intrin.h
121
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\intrin0.h
122
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\intrin0.inl.h
123
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\ios
124
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\iosfwd
125
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\iterator
126
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\limits
127
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\limits.h
128
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\memory
129
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\mmintrin.h
130
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\new
131
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\nmmintrin.h
132
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\numeric
133
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\pmmintrin.h
134
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\random
135
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\sal.h
136
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\setjmp.h
137
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\smmintrin.h
138
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\stdexcept
139
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\stdint.h
140
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\streambuf
141
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\system_error
142
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\tmmintrin.h
143
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\typeinfo
144
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\type_traits
145
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\use_ansi.h
146
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\utility
147
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\vadefs.h
148
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\vcruntime.h
149
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\vcruntime_exception.h
150
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\vcruntime_new.h
151
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\vcruntime_new_debug.h
152
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\vcruntime_string.h
153
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\vcruntime_typeinfo.h
154
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\vector
155
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\wmmintrin.h
156
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\xatomic.h
157
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\xbit_ops.h
158
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\xcall_once.h
159
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\xerrc.h
160
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\xfacet
161
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\xiosbase
162
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\xkeycheck.h
163
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\xlocale
164
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\xlocinfo
165
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\xlocnum
166
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\xmemory
167
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\xmmintrin.h
168
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\xstring
169
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\xthreads.h
170
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\xtimec.h
171
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\xtr1common
172
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\xutility
173
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\yvals.h
174
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\yvals_core.h
175
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\zmmintrin.h
176
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\__msvc_bit_utils.hpp
177
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\__msvc_int128.hpp
178
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\__msvc_iter_core.hpp
179
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\__msvc_sanitizer_annotate_container.hpp
180
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\__msvc_system_error_abi.hpp
181
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\__msvc_xlocinfo_types.hpp
fungi.hpp ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #pragma once
2
+ #include <vector>
3
+ #include <cstdint>
4
+
5
+ /**
6
+ * Fungal (mycelium) population in SoA layout for coalesced GPU access.
7
+ * Each fungus contributes a local basis φ_h(x,y) to build amplitude/phase masks.
8
+ */
9
+ struct FungiSoA {
10
+ int F = 0; // number of fungi
11
+ int H = 0, W = 0; // mask geometry
12
+ // Genome / state
13
+ std::vector<float> x, y; // position in [0, W-1] & [0, H-1]
14
+ std::vector<float> sigma; // radius
15
+ std::vector<float> alpha; // anisotropy (ellipse)
16
+ std::vector<float> theta; // orientation
17
+ std::vector<float> a_base; // amplitude base coeff
18
+ std::vector<float> p_base; // phase base coeff
19
+ // Energy & life-cycle
20
+ std::vector<float> energy;
21
+ std::vector<float> mass;
22
+ std::vector<int> age;
23
+
24
+ void resize(int F_, int H_, int W_);
25
+ void init_random(unsigned seed, float sigma_min=1.5f, float sigma_max=5.5f);
26
+ void adjust_population(int newF, unsigned seed);
27
+ };
28
+
29
+ /** Build masks A(x,y), P(x,y) from fungi population (GPU). */
30
+ void fungi_build_masks_GPU(const FungiSoA& pop,
31
+ float* d_A, float* d_P, // [H*W]
32
+ int tiles_y=7, int tiles_x=7);
33
+
34
+ /** Evolution step (GPU): compute per-fungus reward and update energy, size, reproduction. */
35
+ void fungi_evolve_GPU(FungiSoA& pop,
36
+ const float* d_grad_map, // e.g., gradient magnitude per pixel [H*W]
37
+ int evo_pairs,
38
+ float food=0.05f, float decay=0.98f, float death_th=-0.5f,
39
+ float cost=1e-3f, unsigned seed=1337);
40
+
41
+ /** Host helpers: download masks (optional debug). */
42
+ void download_mask(float* h, const float* d, int HW);
43
+
44
+ /** DIAGNOSTIC TOOLS: Visual debugging for fungi evolution */
45
+ void fungi_export_debug_images(const FungiSoA& pop,
46
+ const float* d_A, const float* d_P,
47
+ const float* d_grad_map,
48
+ const char* prefix = "debug");
49
+
50
+ void fungi_create_test_pattern(float* h_pattern, int H, int W, int pattern_type = 0);
51
+ void fungi_analyze_mask_statistics(const float* d_A, const float* d_P, int HW);
fungi.obj ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:123d84b27a1106c530f09011a8086502de2325579bba75504f4bde07d9958e9a
3
+ size 1392711
fungi_Paremetres.hpp ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // --- Evolution parameters (tunable) ---
2
+ struct EvoParams {
3
+ float food = 0.05f; // reward scale ("food" per unit merit)
4
+ float decay = 0.98f; // energy decay per step
5
+ float death_th = -0.5f; // energy threshold for death/reseed
6
+ float cost = 5e-4f; // FIX: Reduced metabolic cost for stability
7
+ // Gravity & motion
8
+ float G = 1e-2f; // gravitational constant
9
+ float eps2 = 1e-1f; // softening (squared)
10
+ float dt = 0.5f; // integration step
11
+ float damp = 0.90f; // velocity damping
12
+ // Pairing & reproduction
13
+ float pair_dist = 6.0f; // FIX: Increased separation to reduce interference
14
+ int offspring_per_pair = 3;
15
+ int max_population = 0; // 0 = auto (cap at 1.5x current)
16
+ unsigned seed = 1337u;
17
+ };
18
+
19
+ /**
20
+ * Orchestrates a full ecology step:
21
+ * 1) Reward from gradient map (GPU)
22
+ * 2) Gravity forces & motion (GPU)
23
+ * 3) Energy update, growth/shrink, death marking (GPU)
24
+ * 4) Pairing & reproduction (HOST) with genetic recombination + mutation
25
+ * 5) Population capping and compaction (HOST)
26
+ */
27
+ void fungi_ecology_step(FungiSoA& pop,
28
+ const float* d_grad_map, // [H*W] (GPU pointer)
29
+ const EvoParams& evo);
main.cpp ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include "data_loader.hpp"
2
+ #include "training.hpp"
3
+ #include <iostream>
4
+
5
+ TrainConfig parse_cmd(int argc, char** argv) {
6
+ TrainConfig cfg;
7
+ for (int i = 1; i < argc; ++i) {
8
+ std::string a = argv[i];
9
+ auto next = [&](const char* name) -> std::string {
10
+ if (i + 1 >= argc) { std::cerr << "Missing value for " << name << "\n"; std::exit(1); }
11
+ return std::string(argv[++i]);
12
+ };
13
+ if (a == "--data_dir") cfg.data_dir = next("--data_dir");
14
+ else if (a == "--epochs") cfg.epochs = std::stoi(next("--epochs"));
15
+ else if (a == "--batch") cfg.batch = std::stoi(next("--batch"));
16
+ else if (a == "--lr") cfg.lr = std::stof(next("--lr"));
17
+ else if (a == "--fungi") cfg.fungi_count = std::stoi(next("--fungi"));
18
+ else if (a == "--wd") cfg.wd = std::stof(next("--wd"));
19
+ else if (a == "--accuracy_tolerance") cfg.accuracy_tolerance = std::stof(next("--accuracy_tolerance"));
20
+ else if (a == "--seed") cfg.seed = std::stoul(next("--seed")); // Original default seed was 1337u
21
+ else std::cerr << "Unknown arg: " << a << "\n";
22
+ }
23
+ return cfg;
24
+ }
25
+
26
+ int main(int argc, char** argv) {
27
+ try {
28
+ TrainConfig cfg = parse_cmd(argc, argv);
29
+
30
+ std::cout << "[INFO] Loading Fashion-MNIST training data from: " << cfg.data_dir << "\n";
31
+ FashionMNISTSet train = load_fashion_mnist_data(cfg.data_dir, true);
32
+
33
+ std::cout << "[INFO] Loading Fashion-MNIST test data from: " << cfg.data_dir << "\n";
34
+ FashionMNISTSet test = load_fashion_mnist_data(cfg.data_dir, false);
35
+
36
+ train_model(train, test, cfg);
37
+
38
+ std::cout << "[DONE] Training finished.\n";
39
+ return 0;
40
+ } catch (const std::exception& e) {
41
+ std::cerr << "[FATAL] " << e.what() << "\n";
42
+ return 1;
43
+ }
44
+ }
main.obj ADDED
Binary file (44.8 kB). View file
 
optical_model.cu ADDED
@@ -0,0 +1,937 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include "optical_model.hpp"
2
+ #include "utils.hpp"
3
+ #include <iostream>
4
+ #include <stdexcept>
5
+ #include <cmath>
6
+ #include <random>
7
+
8
+ // --- Kernel Declarations ---
9
+ __global__ void k_modulate(const float* x, const float* A, const float* P, cufftComplex* field, int N_pixels);
10
+ __global__ void k_intensity_log1p(const cufftComplex* freq, float* y, int N_elements);
11
+ // NEW: Two-layer MLP kernels
12
+ __global__ void k_linear_relu_forward(const float* input, const float* W, const float* b, float* output, int B, int input_size, int output_size);
13
+ __global__ void k_linear_forward_mlp(const float* input, const float* W, const float* b, float* output, int B, int input_size, int output_size);
14
+ __global__ void k_relu_backward(const float* grad_output, const float* forward_output, float* grad_input, int N);
15
+ __global__ void k_linear_backward_input(const float* grad_output, const float* W, float* grad_input, int B, int input_size, int output_size);
16
+ __global__ void k_accum_linear_grads(const float* input, const float* grad_output, float* gW, float* gb, int B, int input_size, int output_size);
17
+ __global__ void k_softmax_xent_loss_grad(const float* logits, const uint8_t* labels, float* grad_logits, float* total_loss, int B, int C);
18
+ __global__ void k_reduce_grad_map(const float* grad_y, int B, int S, float* grad_map);
19
+ __global__ void k_sigmoid(const float* logits, float* probs, int N);
20
+ // NEW: Multi-scale optical processing kernels
21
+ __global__ void k_downsample_2x2(const float* input, float* output, int input_h, int input_w, int B);
22
+ __global__ void k_concatenate_features(const float* scale1, const float* scale2, const float* scale3,
23
+ float* multiscale, int B, int s1_size, int s2_size, int s3_size);
24
+ // NEW: 6-scale mirror concatenation kernel
25
+ __global__ void k_concatenate_6scale_mirror(const float* s1, const float* s2, const float* s3,
26
+ const float* s1_mir, const float* s2_mir, const float* s3_mir,
27
+ float* multiscale, int B, int s1_size, int s2_size, int s3_size);
28
+ // NEW: Memory-efficient flip kernels for mirror architecture
29
+ __global__ void k_flip_horizontal(const float* input, float* output, int height, int width, int B);
30
+ __global__ void k_flip_vertical(const float* input, float* output, int height, int width, int B);
31
+ // NEW: Diagnostic kernels for bottleneck analysis
32
+ __global__ void k_analyze_activation_saturation(const float* activations, float* stats, int N);
33
+ __global__ void k_analyze_gradient_flow(const float* gradients, float* stats, int N);
34
+ __global__ void k_bottleneck_detector(const float* input_features, const float* hidden_act,
35
+ const float* logits, float* bottleneck_metrics,
36
+ int batch_size, int input_size, int hidden_size, int output_size);
37
+ // BREAKTHROUGH: Rich FFT extraction preserving ALL complex information
38
+ __global__ void k_intensity_magnitude_phase(const cufftComplex* freq, float* y, int N_elements);
39
+ __global__ void k_rich_fft_extraction(const cufftComplex* freq, float* magnitude_out, float* phase_out, int N_elements);
40
+ __global__ void k_concatenate_dual_channels(const float* magnitude_channel, const float* phase_channel,
41
+ float* rich_features, int B, int channel_size);
42
+
43
+ // --- Device Memory Management ---
44
+ // C++ OPTIMIZATION: Allocate persistent GPU buffers once
45
+ void allocate_device_buffers(DeviceBuffers& db, int B) {
46
+ const size_t S = IMG_SIZE, H = HIDDEN_SIZE, C = NUM_CLASSES;
47
+ const size_t MS = MULTISCALE_SIZE; // Enhanced 6-scale mirror feature size = 2058
48
+
49
+ // Batch-dependent buffers
50
+ check_cuda(cudaMalloc(&db.d_batch_in, sizeof(float) * B * S), "alloc d_batch_in");
51
+ check_cuda(cudaMalloc(&db.d_batch_lbl, sizeof(uint8_t) * B), "alloc d_batch_lbl");
52
+
53
+ // Multi-scale optical processing buffers
54
+ check_cuda(cudaMalloc(&db.d_field_scale1, sizeof(cufftComplex) * B * SCALE_1_SIZE), "alloc d_field_scale1");
55
+ check_cuda(cudaMalloc(&db.d_freq_scale1, sizeof(cufftComplex) * B * SCALE_1_SIZE), "alloc d_freq_scale1");
56
+ check_cuda(cudaMalloc(&db.d_features_scale1, sizeof(float) * B * SCALE_1_SIZE), "alloc d_features_scale1");
57
+
58
+ check_cuda(cudaMalloc(&db.d_field_scale2, sizeof(cufftComplex) * B * SCALE_2_SIZE), "alloc d_field_scale2");
59
+ check_cuda(cudaMalloc(&db.d_freq_scale2, sizeof(cufftComplex) * B * SCALE_2_SIZE), "alloc d_freq_scale2");
60
+ check_cuda(cudaMalloc(&db.d_features_scale2, sizeof(float) * B * SCALE_2_SIZE), "alloc d_features_scale2");
61
+
62
+ check_cuda(cudaMalloc(&db.d_field_scale3, sizeof(cufftComplex) * B * SCALE_3_SIZE), "alloc d_field_scale3");
63
+ check_cuda(cudaMalloc(&db.d_freq_scale3, sizeof(cufftComplex) * B * SCALE_3_SIZE), "alloc d_freq_scale3");
64
+ check_cuda(cudaMalloc(&db.d_features_scale3, sizeof(float) * B * SCALE_3_SIZE), "alloc d_features_scale3");
65
+
66
+ // Mirror architecture: allocate mirrored feature buffers
67
+ check_cuda(cudaMalloc(&db.d_features_scale1_mirror, sizeof(float) * B * SCALE_1_SIZE), "alloc d_features_scale1_mirror");
68
+ check_cuda(cudaMalloc(&db.d_features_scale2_mirror, sizeof(float) * B * SCALE_2_SIZE), "alloc d_features_scale2_mirror");
69
+ check_cuda(cudaMalloc(&db.d_features_scale3_mirror, sizeof(float) * B * SCALE_3_SIZE), "alloc d_features_scale3_mirror");
70
+
71
+ // LEGACY: Rich dual-channel processing buffers (not used in intelligent solution)
72
+ // check_cuda(cudaMalloc(&db.d_magnitude_features, sizeof(float) * B * MS), "alloc d_magnitude_features");
73
+ // check_cuda(cudaMalloc(&db.d_phase_features, sizeof(float) * B * MS), "alloc d_phase_features");
74
+
75
+ check_cuda(cudaMalloc(&db.d_multiscale_features, sizeof(float) * B * MS), "alloc d_multiscale_features");
76
+ check_cuda(cudaMalloc(&db.d_hidden, sizeof(float) * B * H), "alloc d_hidden");
77
+ check_cuda(cudaMalloc(&db.d_logits, sizeof(float) * B * C), "alloc d_logits");
78
+ check_cuda(cudaMalloc(&db.d_probs, sizeof(float) * B * C), "alloc d_probs");
79
+ check_cuda(cudaMalloc(&db.d_grad_logits, sizeof(float) * B * C), "alloc d_grad_logits");
80
+ check_cuda(cudaMalloc(&db.d_grad_hidden, sizeof(float) * B * H), "alloc d_grad_hidden");
81
+ check_cuda(cudaMalloc(&db.d_grad_multiscale, sizeof(float) * B * MS), "alloc d_grad_multiscale");
82
+
83
+ // Fungi buffers
84
+ check_cuda(cudaMalloc(&db.d_A, sizeof(float) * S), "alloc d_A");
85
+ check_cuda(cudaMalloc(&db.d_P, sizeof(float) * S), "alloc d_P");
86
+ check_cuda(cudaMalloc(&db.d_grad_map, sizeof(float) * S), "alloc d_grad_map");
87
+
88
+ // C++ OPTIMIZATION: Persistent weight buffers (allocated once, updated in-place)
89
+ check_cuda(cudaMalloc(&db.d_W1, sizeof(float) * H * MS), "alloc persistent d_W1");
90
+ check_cuda(cudaMalloc(&db.d_b1, sizeof(float) * H), "alloc persistent d_b1");
91
+ check_cuda(cudaMalloc(&db.d_W2, sizeof(float) * C * H), "alloc persistent d_W2");
92
+ check_cuda(cudaMalloc(&db.d_b2, sizeof(float) * C), "alloc persistent d_b2");
93
+ check_cuda(cudaMalloc(&db.d_gW1, sizeof(float) * H * MS), "alloc persistent d_gW1");
94
+ check_cuda(cudaMalloc(&db.d_gb1, sizeof(float) * H), "alloc persistent d_gb1");
95
+ check_cuda(cudaMalloc(&db.d_gW2, sizeof(float) * C * H), "alloc persistent d_gW2");
96
+ check_cuda(cudaMalloc(&db.d_gb2, sizeof(float) * C), "alloc persistent d_gb2");
97
+ check_cuda(cudaMalloc(&db.d_loss_scalar, sizeof(float)), "alloc persistent d_loss_scalar");
98
+
99
+ // CRITICAL: Bottleneck detection buffer - [4] metrics array
100
+ check_cuda(cudaMalloc(&db.d_bottleneck_metrics, sizeof(float) * 4), "alloc bottleneck_metrics");
101
+ }
102
+
103
+ void free_device_buffers(DeviceBuffers& db) {
104
+ // Free batch-dependent buffers
105
+ if (db.d_batch_in) cudaFree(db.d_batch_in);
106
+ if (db.d_batch_lbl) cudaFree(db.d_batch_lbl);
107
+
108
+ // Free multi-scale optical processing buffers
109
+ if (db.d_field_scale1) cudaFree(db.d_field_scale1);
110
+ if (db.d_freq_scale1) cudaFree(db.d_freq_scale1);
111
+ if (db.d_features_scale1) cudaFree(db.d_features_scale1);
112
+ if (db.d_field_scale2) cudaFree(db.d_field_scale2);
113
+ if (db.d_freq_scale2) cudaFree(db.d_freq_scale2);
114
+ if (db.d_features_scale2) cudaFree(db.d_features_scale2);
115
+ if (db.d_field_scale3) cudaFree(db.d_field_scale3);
116
+ if (db.d_freq_scale3) cudaFree(db.d_freq_scale3);
117
+ if (db.d_features_scale3) cudaFree(db.d_features_scale3);
118
+ // Free mirror architecture buffers
119
+ if (db.d_features_scale1_mirror) cudaFree(db.d_features_scale1_mirror);
120
+ if (db.d_features_scale2_mirror) cudaFree(db.d_features_scale2_mirror);
121
+ if (db.d_features_scale3_mirror) cudaFree(db.d_features_scale3_mirror);
122
+ if (db.d_multiscale_features) cudaFree(db.d_multiscale_features);
123
+
124
+ if (db.d_hidden) cudaFree(db.d_hidden);
125
+ if (db.d_logits) cudaFree(db.d_logits);
126
+ if (db.d_probs) cudaFree(db.d_probs);
127
+ if (db.d_grad_logits) cudaFree(db.d_grad_logits);
128
+ if (db.d_grad_hidden) cudaFree(db.d_grad_hidden);
129
+ if (db.d_grad_multiscale) cudaFree(db.d_grad_multiscale);
130
+
131
+ // Free fungi buffers
132
+ if (db.d_A) cudaFree(db.d_A);
133
+ if (db.d_P) cudaFree(db.d_P);
134
+ if (db.d_grad_map) cudaFree(db.d_grad_map);
135
+
136
+ // Free persistent weight buffers
137
+ if (db.d_W1) cudaFree(db.d_W1);
138
+ if (db.d_b1) cudaFree(db.d_b1);
139
+ if (db.d_W2) cudaFree(db.d_W2);
140
+ if (db.d_b2) cudaFree(db.d_b2);
141
+ if (db.d_gW1) cudaFree(db.d_gW1);
142
+ if (db.d_gb1) cudaFree(db.d_gb1);
143
+ if (db.d_gW2) cudaFree(db.d_gW2);
144
+ if (db.d_gb2) cudaFree(db.d_gb2);
145
+ if (db.d_loss_scalar) cudaFree(db.d_loss_scalar);
146
+
147
+ // CRITICAL: Free bottleneck detection buffer
148
+ if (db.d_bottleneck_metrics) cudaFree(db.d_bottleneck_metrics);
149
+
150
+ // LEGACY: Free rich dual-channel buffers (not used in intelligent solution)
151
+ // if (db.d_magnitude_features) cudaFree(db.d_magnitude_features);
152
+ // if (db.d_phase_features) cudaFree(db.d_phase_features);
153
+ }
154
+
155
+ // --- Adam Updater (Host) ---
156
+ static void adam_update(std::vector<float>& P, std::vector<float>& m, std::vector<float>& v,
157
+ const float* g_dev, size_t n, float lr, float wd, int t) {
158
+ std::vector<float> g(n);
159
+ check_cuda(cudaMemcpy(g.data(), g_dev, sizeof(float) * n, cudaMemcpyDeviceToHost), "D2H grads for Adam");
160
+ float b1 = 0.9f, b2 = 0.999f, eps = 1e-8f;
161
+ float b1t = 1.f - std::pow(b1, (float)t);
162
+ float b2t = 1.f - std::pow(b2, (float)t);
163
+ for (size_t i = 0; i < n; ++i) {
164
+ m[i] = b1 * m[i] + (1 - b1) * g[i];
165
+ v[i] = b2 * v[i] + (1 - b2) * g[i] * g[i];
166
+ float mh = m[i] / b1t;
167
+ float vh = v[i] / b2t;
168
+ P[i] -= lr * (mh / (std::sqrt(vh) + eps) + wd * P[i]);
169
+ }
170
+ }
171
+
172
+ // C++ OPTIMIZATION: Efficient GPU weight management
173
+ void upload_params_to_gpu(const OpticalParams& params, DeviceBuffers& db) {
174
+ const size_t MS = MULTISCALE_SIZE, H = HIDDEN_SIZE, C = NUM_CLASSES;
175
+
176
+ // Upload weights to persistent GPU buffers
177
+ check_cuda(cudaMemcpy(db.d_W1, params.W1.data(), sizeof(float) * H * MS, cudaMemcpyHostToDevice), "upload W1");
178
+ check_cuda(cudaMemcpy(db.d_b1, params.b1.data(), sizeof(float) * H, cudaMemcpyHostToDevice), "upload b1");
179
+ check_cuda(cudaMemcpy(db.d_W2, params.W2.data(), sizeof(float) * C * H, cudaMemcpyHostToDevice), "upload W2");
180
+ check_cuda(cudaMemcpy(db.d_b2, params.b2.data(), sizeof(float) * C, cudaMemcpyHostToDevice), "upload b2");
181
+ }
182
+
183
+ void download_params_from_gpu(OpticalParams& params, const DeviceBuffers& db) {
184
+ const size_t MS = MULTISCALE_SIZE, H = HIDDEN_SIZE, C = NUM_CLASSES;
185
+
186
+ // Download updated weights from GPU
187
+ check_cuda(cudaMemcpy(params.W1.data(), db.d_W1, sizeof(float) * H * MS, cudaMemcpyDeviceToHost), "download W1");
188
+ check_cuda(cudaMemcpy(params.b1.data(), db.d_b1, sizeof(float) * H, cudaMemcpyDeviceToHost), "download b1");
189
+ check_cuda(cudaMemcpy(params.W2.data(), db.d_W2, sizeof(float) * C * H, cudaMemcpyDeviceToHost), "download W2");
190
+ check_cuda(cudaMemcpy(params.b2.data(), db.d_b2, sizeof(float) * C, cudaMemcpyDeviceToHost), "download b2");
191
+ }
192
+
193
+ // --- Training Step for Multi-Scale Two-Layer MLP ---
194
+ // CHANGE LOG: Multi-scale optical processing for 90%+ accuracy
195
+ // FORWARD: multi_scale_features -> W1*features+b1 -> ReLU -> W2*hidden+b2 -> logits
196
+ // BACKWARD: Full backpropagation through both layers with multi-scale features
197
+ float train_batch(const float* h_batch_in, const uint8_t* h_batch_lbl,
198
+ int B, FungiSoA& fungi, OpticalParams& params,
199
+ DeviceBuffers& db, FFTPlan& fft,
200
+ float lr, float wd, int t_adam) {
201
+ const int S = IMG_SIZE, H = HIDDEN_SIZE, C = NUM_CLASSES, MS = MULTISCALE_SIZE;
202
+
203
+ check_cuda(cudaMemcpy(db.d_batch_in, h_batch_in, sizeof(float) * B * S, cudaMemcpyHostToDevice), "H2D input");
204
+ check_cuda(cudaMemcpy(db.d_batch_lbl, h_batch_lbl, sizeof(uint8_t) * B, cudaMemcpyHostToDevice), "H2D labels");
205
+
206
+ // Multi-scale optical processing for 90%+ accuracy
207
+ fungi_build_masks_GPU(fungi, db.d_A, db.d_P);
208
+
209
+ // DIAGNOSTIC: Analyze mask statistics every few epochs
210
+ static int debug_counter = 0;
211
+ if (debug_counter % 10 == 0) { // Every 10 batches
212
+ fungi_analyze_mask_statistics(db.d_A, db.d_P, IMG_SIZE);
213
+ }
214
+ debug_counter++;
215
+
216
+ // Scale 1: Full resolution 28x28 = 784 features
217
+ k_modulate<<<(B * S + 255) / 256, 256>>>(db.d_batch_in, db.d_A, db.d_P, db.d_field_scale1, B * S);
218
+ cufftExecC2C(fft.plan_fwd_scale1, db.d_field_scale1, db.d_freq_scale1, CUFFT_FORWARD);
219
+ k_intensity_magnitude_phase<<<(B * SCALE_1_SIZE + 255) / 256, 256>>>(db.d_freq_scale1, db.d_features_scale1, B * SCALE_1_SIZE);
220
+
221
+ // Scale 2: Half resolution 14x14 = 196 features
222
+ k_downsample_2x2<<<(B * SCALE_2_SIZE + 255) / 256, 256>>>(db.d_batch_in, reinterpret_cast<float*>(db.d_field_scale2), IMG_H, IMG_W, B);
223
+ k_modulate<<<(B * SCALE_2_SIZE + 255) / 256, 256>>>(reinterpret_cast<float*>(db.d_field_scale2), db.d_A, db.d_P, db.d_field_scale2, B * SCALE_2_SIZE);
224
+ cufftExecC2C(fft.plan_fwd_scale2, db.d_field_scale2, db.d_freq_scale2, CUFFT_FORWARD);
225
+ k_intensity_magnitude_phase<<<(B * SCALE_2_SIZE + 255) / 256, 256>>>(db.d_freq_scale2, db.d_features_scale2, B * SCALE_2_SIZE);
226
+
227
+ // Scale 3: Quarter resolution 7x7 = 49 features (downsample from scale2)
228
+ k_downsample_2x2<<<(B * SCALE_3_SIZE + 255) / 256, 256>>>(db.d_features_scale2, reinterpret_cast<float*>(db.d_field_scale3), SCALE_2, SCALE_2, B);
229
+ k_modulate<<<(B * SCALE_3_SIZE + 255) / 256, 256>>>(reinterpret_cast<float*>(db.d_field_scale3), db.d_A, db.d_P, db.d_field_scale3, B * SCALE_3_SIZE);
230
+ cufftExecC2C(fft.plan_fwd_scale3, db.d_field_scale3, db.d_freq_scale3, CUFFT_FORWARD);
231
+ k_intensity_magnitude_phase<<<(B * SCALE_3_SIZE + 255) / 256, 256>>>(db.d_freq_scale3, db.d_features_scale3, B * SCALE_3_SIZE);
232
+
233
+ // Mirror processing: create horizontally flipped versions for enhanced features
234
+ k_flip_horizontal<<<(B * SCALE_1_SIZE + 255) / 256, 256>>>(db.d_features_scale1, db.d_features_scale1_mirror, SCALE_1, SCALE_1, B);
235
+ k_flip_horizontal<<<(B * SCALE_2_SIZE + 255) / 256, 256>>>(db.d_features_scale2, db.d_features_scale2_mirror, SCALE_2, SCALE_2, B);
236
+ k_flip_horizontal<<<(B * SCALE_3_SIZE + 255) / 256, 256>>>(db.d_features_scale3, db.d_features_scale3_mirror, SCALE_3, SCALE_3, B);
237
+
238
+ // INTELLIGENT SOLUTION: Enhanced 6-scale mirror with optimized FFT kernel
239
+ k_concatenate_6scale_mirror<<<(B * MS + 255) / 256, 256>>>(
240
+ db.d_features_scale1, db.d_features_scale2, db.d_features_scale3,
241
+ db.d_features_scale1_mirror, db.d_features_scale2_mirror, db.d_features_scale3_mirror,
242
+ db.d_multiscale_features, B, SCALE_1_SIZE, SCALE_2_SIZE, SCALE_3_SIZE);
243
+
244
+ // C++ OPTIMIZATION: Use persistent GPU buffers (NO malloc/free per batch!)
245
+ // Forward pass: Layer 1 (with ReLU) - Enhanced 2058 features with better FFT extraction
246
+ k_linear_relu_forward<<<(B*H+255)/256, 256>>>(db.d_multiscale_features, db.d_W1, db.d_b1, db.d_hidden, B, MS, H);
247
+
248
+ // Forward pass: Layer 2 (linear)
249
+ k_linear_forward_mlp<<<(B*C+255)/256, 256>>>(db.d_hidden, db.d_W2, db.d_b2, db.d_logits, B, H, C);
250
+
251
+ // CRITICAL: Real-time bottleneck detection - analyze information flow
252
+ static int bottleneck_counter = 0;
253
+ if (bottleneck_counter % 5 == 0) { // Every 5 batches for performance
254
+ cudaMemset(db.d_bottleneck_metrics, 0, sizeof(float) * 4);
255
+ int max_threads = fmaxf(fmaxf(MS, H), C);
256
+ k_bottleneck_detector<<<(max_threads + 255) / 256, 256>>>(
257
+ db.d_multiscale_features, db.d_hidden, db.d_logits, db.d_bottleneck_metrics,
258
+ B, MS, H, C);
259
+
260
+ // Download metrics and report critical bottlenecks
261
+ float h_metrics[4] = {0};
262
+ cudaMemcpy(h_metrics, db.d_bottleneck_metrics, sizeof(float) * 4, cudaMemcpyDeviceToHost);
263
+
264
+ float dead_features_pct = (h_metrics[0] / MS) * 100.0f; // % dead input features
265
+ float dead_neurons_pct = (h_metrics[1] / H) * 100.0f; // % dead hidden neurons
266
+ float saturated_neurons_pct = (h_metrics[2] / H) * 100.0f; // % saturated hidden neurons
267
+ float poor_discrimination_pct = (h_metrics[3] / C) * 100.0f; // % poor output discrimination
268
+
269
+ // ALERT: Critical bottleneck detection
270
+ if (dead_features_pct > 20.0f || dead_neurons_pct > 30.0f ||
271
+ saturated_neurons_pct > 30.0f || poor_discrimination_pct > 40.0f) {
272
+ printf("🚨 CRITICAL BOTTLENECK DETECTED:\n");
273
+ printf(" 📉 Dead Features: %.1f%% | Dead Neurons: %.1f%% | Saturated: %.1f%% | Poor Discrim: %.1f%%\n",
274
+ dead_features_pct, dead_neurons_pct, saturated_neurons_pct, poor_discrimination_pct);
275
+ }
276
+ }
277
+ bottleneck_counter++;
278
+
279
+ // Loss computation (using persistent buffer)
280
+ cudaMemset(db.d_loss_scalar, 0, sizeof(float));
281
+ k_softmax_xent_loss_grad<<<(B + 255) / 256, 256>>>(db.d_logits, (const uint8_t*)db.d_batch_lbl, db.d_grad_logits, db.d_loss_scalar, B, C);
282
+
283
+ // Backward pass: Layer 2 gradients (using persistent buffers)
284
+ cudaMemset(db.d_gW2, 0, sizeof(float)*C*H);
285
+ cudaMemset(db.d_gb2, 0, sizeof(float)*C);
286
+ k_accum_linear_grads<<<(C+255)/256, 256>>>(db.d_hidden, db.d_grad_logits, db.d_gW2, db.d_gb2, B, H, C);
287
+
288
+ // Backward pass: Hidden layer gradient
289
+ k_linear_backward_input<<<(B*H+255)/256, 256>>>(db.d_grad_logits, db.d_W2, db.d_grad_hidden, B, H, C);
290
+
291
+ // Backward pass: ReLU gradient
292
+ k_relu_backward<<<(B*H+255)/256, 256>>>(db.d_grad_hidden, db.d_hidden, db.d_grad_hidden, B*H);
293
+
294
+ // Backward pass: Layer 1 gradients (using persistent buffers with multi-scale)
295
+ cudaMemset(db.d_gW1, 0, sizeof(float)*H*MS);
296
+ cudaMemset(db.d_gb1, 0, sizeof(float)*H);
297
+ k_accum_linear_grads<<<(H+255)/256, 256>>>(db.d_multiscale_features, db.d_grad_hidden, db.d_gW1, db.d_gb1, B, MS, H);
298
+
299
+ // Backward pass: Multi-scale gradient for fungi (simplified - use scale 1 gradient)
300
+ k_linear_backward_input<<<(B*MS+255)/256, 256>>>(db.d_grad_hidden, db.d_W1, db.d_grad_multiscale, B, MS, H);
301
+ k_reduce_grad_map<<<(S + 255) / 256, 256>>>(db.d_grad_multiscale, B, S, db.d_grad_map); // Only use first S elements
302
+
303
+ // Adam updates for all parameters (using persistent buffers with multi-scale)
304
+ adam_update(params.W1, params.m_W1, params.v_W1, db.d_gW1, H * MS, lr, wd, t_adam);
305
+ adam_update(params.b1, params.m_b1, params.v_b1, db.d_gb1, H, lr, 0.0f, t_adam);
306
+ adam_update(params.W2, params.m_W2, params.v_W2, db.d_gW2, C * H, lr, wd, t_adam);
307
+ adam_update(params.b2, params.m_b2, params.v_b2, db.d_gb2, C, lr, 0.0f, t_adam);
308
+
309
+ // BUGFIX: Upload updated weights back to GPU after Adam
310
+ upload_params_to_gpu(params, db);
311
+
312
+ float h_loss;
313
+ check_cuda(cudaMemcpy(&h_loss, db.d_loss_scalar, sizeof(float), cudaMemcpyDeviceToHost), "D2H loss");
314
+
315
+ return h_loss / B;
316
+ }
317
+
318
+ // --- Inference for Multi-Scale Two-Layer MLP ---
319
+ void infer_batch(const float* h_batch_in, int B,
320
+ const FungiSoA& fungi, const OpticalParams& params,
321
+ DeviceBuffers& db, FFTPlan& fft,
322
+ std::vector<int>& out_predictions) {
323
+ const int S = IMG_SIZE, H = HIDDEN_SIZE, C = NUM_CLASSES, MS = MULTISCALE_SIZE;
324
+ check_cuda(cudaMemcpy(db.d_batch_in, h_batch_in, sizeof(float) * B * S, cudaMemcpyHostToDevice), "H2D infer input");
325
+
326
+ // Multi-scale optical processing for inference
327
+ fungi_build_masks_GPU(const_cast<FungiSoA&>(fungi), db.d_A, db.d_P);
328
+
329
+ // Scale 1: Full resolution 28x28 = 784 features
330
+ k_modulate<<<(B * S + 255) / 256, 256>>>(db.d_batch_in, db.d_A, db.d_P, db.d_field_scale1, B * S);
331
+ cufftExecC2C(fft.plan_fwd_scale1, db.d_field_scale1, db.d_freq_scale1, CUFFT_FORWARD);
332
+ k_intensity_magnitude_phase<<<(B * SCALE_1_SIZE + 255) / 256, 256>>>(db.d_freq_scale1, db.d_features_scale1, B * SCALE_1_SIZE);
333
+
334
+ // Scale 2: Half resolution 14x14 = 196 features
335
+ k_downsample_2x2<<<(B * SCALE_2_SIZE + 255) / 256, 256>>>(db.d_batch_in, reinterpret_cast<float*>(db.d_field_scale2), IMG_H, IMG_W, B);
336
+ k_modulate<<<(B * SCALE_2_SIZE + 255) / 256, 256>>>(reinterpret_cast<float*>(db.d_field_scale2), db.d_A, db.d_P, db.d_field_scale2, B * SCALE_2_SIZE);
337
+ cufftExecC2C(fft.plan_fwd_scale2, db.d_field_scale2, db.d_freq_scale2, CUFFT_FORWARD);
338
+ k_intensity_magnitude_phase<<<(B * SCALE_2_SIZE + 255) / 256, 256>>>(db.d_freq_scale2, db.d_features_scale2, B * SCALE_2_SIZE);
339
+
340
+ // Scale 3: Quarter resolution 7x7 = 49 features (downsample from scale2)
341
+ k_downsample_2x2<<<(B * SCALE_3_SIZE + 255) / 256, 256>>>(db.d_features_scale2, reinterpret_cast<float*>(db.d_field_scale3), SCALE_2, SCALE_2, B);
342
+ k_modulate<<<(B * SCALE_3_SIZE + 255) / 256, 256>>>(reinterpret_cast<float*>(db.d_field_scale3), db.d_A, db.d_P, db.d_field_scale3, B * SCALE_3_SIZE);
343
+ cufftExecC2C(fft.plan_fwd_scale3, db.d_field_scale3, db.d_freq_scale3, CUFFT_FORWARD);
344
+ k_intensity_magnitude_phase<<<(B * SCALE_3_SIZE + 255) / 256, 256>>>(db.d_freq_scale3, db.d_features_scale3, B * SCALE_3_SIZE);
345
+
346
+ // Mirror processing: create horizontally flipped versions for enhanced features
347
+ k_flip_horizontal<<<(B * SCALE_1_SIZE + 255) / 256, 256>>>(db.d_features_scale1, db.d_features_scale1_mirror, SCALE_1, SCALE_1, B);
348
+ k_flip_horizontal<<<(B * SCALE_2_SIZE + 255) / 256, 256>>>(db.d_features_scale2, db.d_features_scale2_mirror, SCALE_2, SCALE_2, B);
349
+ k_flip_horizontal<<<(B * SCALE_3_SIZE + 255) / 256, 256>>>(db.d_features_scale3, db.d_features_scale3_mirror, SCALE_3, SCALE_3, B);
350
+
351
+ // INTELLIGENT SOLUTION: Enhanced 6-scale mirror with optimized FFT kernel (INFERENCE)
352
+ k_concatenate_6scale_mirror<<<(B * MS + 255) / 256, 256>>>(
353
+ db.d_features_scale1, db.d_features_scale2, db.d_features_scale3,
354
+ db.d_features_scale1_mirror, db.d_features_scale2_mirror, db.d_features_scale3_mirror,
355
+ db.d_multiscale_features, B, SCALE_1_SIZE, SCALE_2_SIZE, SCALE_3_SIZE);
356
+
357
+ // C++ OPTIMIZATION: Use persistent GPU buffers for inference
358
+ // Forward pass: Layer 1 (with ReLU) - Enhanced 2058 features with better FFT extraction
359
+ k_linear_relu_forward<<<(B*H+255)/256, 256>>>(db.d_multiscale_features, db.d_W1, db.d_b1, db.d_hidden, B, MS, H);
360
+
361
+ // Forward pass: Layer 2 (linear)
362
+ k_linear_forward_mlp<<<(B*C+255)/256, 256>>>(db.d_hidden, db.d_W2, db.d_b2, db.d_logits, B, H, C);
363
+
364
+ std::vector<float> h_logits(B * C);
365
+ check_cuda(cudaMemcpy(h_logits.data(), db.d_logits, sizeof(float) * B * C, cudaMemcpyDeviceToHost), "D2H logits");
366
+
367
+ out_predictions.resize(B);
368
+ for (int b = 0; b < B; ++b) {
369
+ int best_class = 0;
370
+ float max_logit = h_logits[b * C];
371
+ for (int c = 1; c < C; ++c) {
372
+ if (h_logits[b * C + c] > max_logit) {
373
+ max_logit = h_logits[b * C + c];
374
+ best_class = c;
375
+ }
376
+ }
377
+ out_predictions[b] = best_class;
378
+ }
379
+ }
380
+
381
+ // --- Kernels ---
382
+ __global__ void k_modulate(const float* x, const float* A, const float* P, cufftComplex* field, int N_pixels) {
383
+ int i = blockIdx.x * blockDim.x + threadIdx.x;
384
+ if (i >= N_pixels) return;
385
+
386
+ int pixel_idx = i % IMG_SIZE;
387
+
388
+ float input_val = x[i];
389
+ float amp = A[pixel_idx];
390
+ float phase = P[pixel_idx];
391
+
392
+ field[i].x = input_val * amp * cosf(phase);
393
+ field[i].y = input_val * amp * sinf(phase);
394
+ }
395
+
396
+ __global__ void k_intensity_log1p(const cufftComplex* freq, float* y, int N_elements) {
397
+ int i = blockIdx.x * blockDim.x + threadIdx.x;
398
+ if (i >= N_elements) return;
399
+
400
+ float intensity = freq[i].x * freq[i].x + freq[i].y * freq[i].y;
401
+ y[i] = log1pf(intensity);
402
+ }
403
+
404
+ // BOTTLENECK FIX: Enhanced extraction with magnitude and phase information
405
+ __global__ void k_intensity_magnitude_phase(const cufftComplex* freq, float* y, int N_elements) {
406
+ int i = blockIdx.x * blockDim.x + threadIdx.x;
407
+ if (i >= N_elements) return;
408
+
409
+ float real = freq[i].x;
410
+ float imag = freq[i].y;
411
+
412
+ // Preserve both magnitude and phase information
413
+ float magnitude = sqrtf(real * real + imag * imag);
414
+ float phase = atan2f(imag, real);
415
+
416
+ // BREAKTHROUGH FIX: Instead of crushing to 1D, preserve rich information
417
+ // Method 1: Enhanced representation with multiple components
418
+ y[i] = log1pf(magnitude) + 0.5f * tanhf(phase) + 0.2f * (real / (fabsf(real) + 1e-6f)) + 0.1f * (imag / (fabsf(imag) + 1e-6f));
419
+ }
420
+
421
+ // REVOLUTIONARY: Rich FFT extraction - DOUBLES information capacity
422
+ __global__ void k_rich_fft_extraction(const cufftComplex* freq, float* magnitude_out, float* phase_out, int N_elements) {
423
+ int i = blockIdx.x * blockDim.x + threadIdx.x;
424
+ if (i >= N_elements) return;
425
+
426
+ float real = freq[i].x;
427
+ float imag = freq[i].y;
428
+
429
+ // Preserve magnitude with enhanced dynamic range
430
+ float magnitude = sqrtf(real * real + imag * imag);
431
+ magnitude_out[i] = log1pf(magnitude) + 0.1f * atan2f(magnitude, 1.0f); // Enhanced magnitude
432
+
433
+ // Preserve phase with full resolution
434
+ float phase = atan2f(imag, real);
435
+ phase_out[i] = tanhf(2.0f * phase / 3.14159f); // Full phase preservation [-1,1]
436
+ }
437
+
438
+ // BREAKTHROUGH: Concatenate magnitude and phase channels into rich feature vector
439
+ __global__ void k_concatenate_dual_channels(const float* magnitude_channel, const float* phase_channel,
440
+ float* rich_features, int B, int channel_size) {
441
+ int idx = blockIdx.x * blockDim.x + threadIdx.x;
442
+ int total_size = 2 * channel_size; // magnitude + phase = double size
443
+
444
+ if (idx >= B * total_size) return;
445
+
446
+ int batch_idx = idx / total_size;
447
+ int feature_idx = idx % total_size;
448
+
449
+ if (feature_idx < channel_size) {
450
+ // First half: magnitude channel [0, channel_size)
451
+ rich_features[idx] = magnitude_channel[batch_idx * channel_size + feature_idx];
452
+ } else {
453
+ // Second half: phase channel [channel_size, 2*channel_size)
454
+ int phase_idx = feature_idx - channel_size;
455
+ rich_features[idx] = phase_channel[batch_idx * channel_size + phase_idx];
456
+ }
457
+ }
458
+
459
+ __global__ void k_linear_forward(const float* y, const float* W, const float* b, float* logits, int B, int S, int C) {
460
+ int batch_class = blockIdx.x * blockDim.x + threadIdx.x;
461
+ if (batch_class >= B * C) return;
462
+
463
+ int batch_idx = batch_class / C;
464
+ int class_idx = batch_class % C;
465
+
466
+ float sum = b[class_idx];
467
+ for (int s = 0; s < S; ++s) {
468
+ sum += W[class_idx * S + s] * y[batch_idx * S + s];
469
+ }
470
+ logits[batch_class] = sum;
471
+ }
472
+
473
+ __global__ void k_softmax_xent_loss_grad(const float* logits, const uint8_t* labels, float* grad_logits, float* total_loss, int B, int C) {
474
+ int b = blockIdx.x * blockDim.x + threadIdx.x;
475
+ if (b >= B) return;
476
+
477
+ const float* b_logits = logits + b * C;
478
+ float max_val = -1e20f;
479
+ for (int c = 0; c < C; ++c) {
480
+ if (b_logits[c] > max_val) max_val = b_logits[c];
481
+ }
482
+
483
+ float exp_sum = 0.f;
484
+ float exp_vals[10];
485
+ for (int c = 0; c < C; ++c) {
486
+ exp_vals[c] = expf(b_logits[c] - max_val);
487
+ exp_sum += exp_vals[c];
488
+ }
489
+
490
+ uint8_t true_label = labels[b];
491
+ float* b_grad = grad_logits + b * C;
492
+ float loss = 0.f;
493
+
494
+ for (int c = 0; c < C; ++c) {
495
+ float prob = exp_vals[c] / exp_sum;
496
+ b_grad[c] = prob - (c == true_label ? 1.f : 0.f);
497
+ if (c == true_label) {
498
+ loss = -logf(fmaxf(prob, 1e-9f));
499
+ }
500
+ }
501
+ atomicAdd(total_loss, loss);
502
+ }
503
+
504
+ __global__ void k_backprop_y(const float* grad_logits, const float* W, float* grad_y, int B, int S, int C) {
505
+ int batch_pixel = blockIdx.x * blockDim.x + threadIdx.x;
506
+ if (batch_pixel >= B * S) return;
507
+
508
+ int batch_idx = batch_pixel / S;
509
+ int pixel_idx = batch_pixel % S;
510
+
511
+ float sum = 0.f;
512
+ for (int c = 0; c < C; ++c) {
513
+ sum += grad_logits[batch_idx * C + c] * W[c * S + pixel_idx];
514
+ }
515
+ grad_y[batch_pixel] = sum;
516
+ }
517
+
518
+ __global__ void k_accum_grads_Wb(const float* y, const float* grad_logits, float* gW, float* gb, int B, int S, int C) {
519
+ int class_idx = blockIdx.x * blockDim.x + threadIdx.x;
520
+ if (class_idx >= C) return;
521
+
522
+ float gb_sum = 0.f;
523
+ for (int b = 0; b < B; ++b) {
524
+ gb_sum += grad_logits[b * C + class_idx];
525
+ }
526
+ gb[class_idx] = gb_sum;
527
+
528
+ for (int s = 0; s < S; ++s) {
529
+ float gw_sum = 0.f;
530
+ for (int b = 0; b < B; ++b) {
531
+ gw_sum += grad_logits[b * C + class_idx] * y[b * S + s];
532
+ }
533
+ gW[class_idx * S + s] = gw_sum;
534
+ }
535
+ }
536
+
537
+ __global__ void k_reduce_grad_map(const float* grad_y, int B, int S, float* grad_map) {
538
+ int pixel = blockIdx.x * blockDim.x + threadIdx.x;
539
+ if (pixel >= S) return;
540
+
541
+ float acc = 0.f;
542
+ for (int b = 0; b < B; ++b) {
543
+ acc += fabsf(grad_y[b * S + pixel]);
544
+ }
545
+ grad_map[pixel] = acc / static_cast<float>(B);
546
+ }
547
+
548
+ __global__ void k_sigmoid(const float* logits, float* probs, int N) {
549
+ int i = blockIdx.x * blockDim.x + threadIdx.x;
550
+ if (i >= N) return;
551
+ probs[i] = 1.f / (1.f + expf(-logits[i]));
552
+ }
553
+
554
+ void create_fft_plan(FFTPlan& fft, int batch) {
555
+ // Scale 1: 28x28 FFT plans
556
+ int n1[2] = {SCALE_1, SCALE_1};
557
+ cufftPlanMany(&fft.plan_fwd_scale1, 2, n1, nullptr, 1, SCALE_1_SIZE, nullptr, 1, SCALE_1_SIZE, CUFFT_C2C, batch);
558
+ cufftPlanMany(&fft.plan_inv_scale1, 2, n1, nullptr, 1, SCALE_1_SIZE, nullptr, 1, SCALE_1_SIZE, CUFFT_C2C, batch);
559
+
560
+ // Scale 2: 14x14 FFT plans
561
+ int n2[2] = {SCALE_2, SCALE_2};
562
+ cufftPlanMany(&fft.plan_fwd_scale2, 2, n2, nullptr, 1, SCALE_2_SIZE, nullptr, 1, SCALE_2_SIZE, CUFFT_C2C, batch);
563
+ cufftPlanMany(&fft.plan_inv_scale2, 2, n2, nullptr, 1, SCALE_2_SIZE, nullptr, 1, SCALE_2_SIZE, CUFFT_C2C, batch);
564
+
565
+ // Scale 3: 7x7 FFT plans
566
+ int n3[2] = {SCALE_3, SCALE_3};
567
+ cufftPlanMany(&fft.plan_fwd_scale3, 2, n3, nullptr, 1, SCALE_3_SIZE, nullptr, 1, SCALE_3_SIZE, CUFFT_C2C, batch);
568
+ cufftPlanMany(&fft.plan_inv_scale3, 2, n3, nullptr, 1, SCALE_3_SIZE, nullptr, 1, SCALE_3_SIZE, CUFFT_C2C, batch);
569
+ }
570
+
571
+ void destroy_fft_plan(FFTPlan& fft) {
572
+ if (fft.plan_fwd_scale1) cufftDestroy(fft.plan_fwd_scale1);
573
+ if (fft.plan_inv_scale1) cufftDestroy(fft.plan_inv_scale1);
574
+ if (fft.plan_fwd_scale2) cufftDestroy(fft.plan_fwd_scale2);
575
+ if (fft.plan_inv_scale2) cufftDestroy(fft.plan_inv_scale2);
576
+ if (fft.plan_fwd_scale3) cufftDestroy(fft.plan_fwd_scale3);
577
+ if (fft.plan_inv_scale3) cufftDestroy(fft.plan_inv_scale3);
578
+ }
579
+
580
+ // CHANGE LOG: Updated initialization for 6-scale mirror two-layer MLP
581
+ // ORIGINAL: Single layer initialization (IMG_SIZE=784)
582
+ // NEW: Xavier/Glorot initialization for both layers (MULTISCALE_SIZE=2058)
583
+ void init_params(OpticalParams& p, unsigned seed) {
584
+ std::mt19937 gen(seed);
585
+
586
+ // Xavier initialization: std = sqrt(2 / (fan_in + fan_out))
587
+ float std_W1 = std::sqrt(2.0f / (MULTISCALE_SIZE + HIDDEN_SIZE));
588
+ float std_W2 = std::sqrt(2.0f / (HIDDEN_SIZE + NUM_CLASSES));
589
+ std::normal_distribution<float> dist_W1(0.f, std_W1);
590
+ std::normal_distribution<float> dist_W2(0.f, std_W2);
591
+
592
+ // First layer: MULTISCALE_SIZE -> HIDDEN_SIZE
593
+ size_t W1_size = HIDDEN_SIZE * MULTISCALE_SIZE;
594
+ p.W1.resize(W1_size);
595
+ p.b1.resize(HIDDEN_SIZE);
596
+ p.m_W1.resize(W1_size);
597
+ p.v_W1.resize(W1_size);
598
+ p.m_b1.resize(HIDDEN_SIZE);
599
+ p.v_b1.resize(HIDDEN_SIZE);
600
+
601
+ for (size_t i = 0; i < W1_size; ++i) {
602
+ p.W1[i] = dist_W1(gen);
603
+ p.m_W1[i] = 0.f;
604
+ p.v_W1[i] = 0.f;
605
+ }
606
+ for (size_t i = 0; i < HIDDEN_SIZE; ++i) {
607
+ p.b1[i] = 0.f;
608
+ p.m_b1[i] = 0.f;
609
+ p.v_b1[i] = 0.f;
610
+ }
611
+
612
+ // Second layer: HIDDEN_SIZE -> NUM_CLASSES
613
+ size_t W2_size = NUM_CLASSES * HIDDEN_SIZE;
614
+ p.W2.resize(W2_size);
615
+ p.b2.resize(NUM_CLASSES);
616
+ p.m_W2.resize(W2_size);
617
+ p.v_W2.resize(W2_size);
618
+ p.m_b2.resize(NUM_CLASSES);
619
+ p.v_b2.resize(NUM_CLASSES);
620
+
621
+ for (size_t i = 0; i < W2_size; ++i) {
622
+ p.W2[i] = dist_W2(gen);
623
+ p.m_W2[i] = 0.f;
624
+ p.v_W2[i] = 0.f;
625
+ }
626
+ for (size_t i = 0; i < NUM_CLASSES; ++i) {
627
+ p.b2[i] = 0.f;
628
+ p.m_b2[i] = 0.f;
629
+ p.v_b2[i] = 0.f;
630
+ }
631
+ }
632
+
633
+ // --- NEW KERNELS FOR TWO-LAYER MLP ---
634
+
635
+ // Linear layer with ReLU activation: output = ReLU(W * input + b)
636
+ __global__ void k_linear_relu_forward(const float* input, const float* W, const float* b, float* output, int B, int input_size, int output_size) {
637
+ int idx = blockIdx.x * blockDim.x + threadIdx.x;
638
+ if (idx >= B * output_size) return;
639
+
640
+ int batch_idx = idx / output_size;
641
+ int out_idx = idx % output_size;
642
+
643
+ float sum = b[out_idx];
644
+ for (int i = 0; i < input_size; ++i) {
645
+ sum += W[out_idx * input_size + i] * input[batch_idx * input_size + i];
646
+ }
647
+ output[idx] = fmaxf(0.0f, sum); // ReLU activation
648
+ }
649
+
650
+ // Linear layer without activation: output = W * input + b
651
+ __global__ void k_linear_forward_mlp(const float* input, const float* W, const float* b, float* output, int B, int input_size, int output_size) {
652
+ int idx = blockIdx.x * blockDim.x + threadIdx.x;
653
+ if (idx >= B * output_size) return;
654
+
655
+ int batch_idx = idx / output_size;
656
+ int out_idx = idx % output_size;
657
+
658
+ float sum = b[out_idx];
659
+ for (int i = 0; i < input_size; ++i) {
660
+ sum += W[out_idx * input_size + i] * input[batch_idx * input_size + i];
661
+ }
662
+ output[idx] = sum;
663
+ }
664
+
665
+ // ReLU backward: grad_input = grad_output * (forward_output > 0)
666
+ __global__ void k_relu_backward(const float* grad_output, const float* forward_output, float* grad_input, int N) {
667
+ int i = blockIdx.x * blockDim.x + threadIdx.x;
668
+ if (i >= N) return;
669
+ grad_input[i] = grad_output[i] * (forward_output[i] > 0.0f ? 1.0f : 0.0f);
670
+ }
671
+
672
+ // Linear backward (input gradients): grad_input = W^T * grad_output
673
+ __global__ void k_linear_backward_input(const float* grad_output, const float* W, float* grad_input, int B, int input_size, int output_size) {
674
+ int idx = blockIdx.x * blockDim.x + threadIdx.x;
675
+ if (idx >= B * input_size) return;
676
+
677
+ int batch_idx = idx / input_size;
678
+ int in_idx = idx % input_size;
679
+
680
+ float sum = 0.0f;
681
+ for (int o = 0; o < output_size; ++o) {
682
+ sum += W[o * input_size + in_idx] * grad_output[batch_idx * output_size + o];
683
+ }
684
+ grad_input[idx] = sum;
685
+ }
686
+
687
+ // Accumulate gradients for linear layer weights and biases
688
+ __global__ void k_accum_linear_grads(const float* input, const float* grad_output, float* gW, float* gb, int B, int input_size, int output_size) {
689
+ int out_idx = blockIdx.x * blockDim.x + threadIdx.x;
690
+ if (out_idx >= output_size) return;
691
+
692
+ // Accumulate bias gradient
693
+ float gb_sum = 0.0f;
694
+ for (int b = 0; b < B; ++b) {
695
+ gb_sum += grad_output[b * output_size + out_idx];
696
+ }
697
+ gb[out_idx] = gb_sum;
698
+
699
+ // Accumulate weight gradients
700
+ for (int in_idx = 0; in_idx < input_size; ++in_idx) {
701
+ float gw_sum = 0.0f;
702
+ for (int b = 0; b < B; ++b) {
703
+ gw_sum += grad_output[b * output_size + out_idx] * input[b * input_size + in_idx];
704
+ }
705
+ gW[out_idx * input_size + in_idx] = gw_sum;
706
+ }
707
+ }
708
+
709
+ // --- NEW KERNELS FOR MULTI-SCALE OPTICAL PROCESSING ---
710
+
711
+ // Downsample 28x28 to 14x14 using 2x2 average pooling
712
+ __global__ void k_downsample_2x2(const float* input, float* output, int input_h, int input_w, int B) {
713
+ int idx = blockIdx.x * blockDim.x + threadIdx.x;
714
+ int output_h = input_h / 2;
715
+ int output_w = input_w / 2;
716
+ int output_size = output_h * output_w;
717
+
718
+ if (idx >= B * output_size) return;
719
+
720
+ int batch_idx = idx / output_size;
721
+ int out_pixel = idx % output_size;
722
+ int out_y = out_pixel / output_w;
723
+ int out_x = out_pixel % output_w;
724
+
725
+ // Average 2x2 region
726
+ float sum = 0.0f;
727
+ for (int dy = 0; dy < 2; ++dy) {
728
+ for (int dx = 0; dx < 2; ++dx) {
729
+ int in_y = out_y * 2 + dy;
730
+ int in_x = out_x * 2 + dx;
731
+ int in_pixel = in_y * input_w + in_x;
732
+ sum += input[batch_idx * (input_h * input_w) + in_pixel];
733
+ }
734
+ }
735
+ output[idx] = sum * 0.25f; // Average of 4 pixels
736
+ }
737
+
738
+
739
+ // Concatenate multi-scale features: [scale1 | scale2 | scale3]
740
+ __global__ void k_concatenate_features(const float* scale1, const float* scale2, const float* scale3,
741
+ float* multiscale, int B, int s1_size, int s2_size, int s3_size) {
742
+ int idx = blockIdx.x * blockDim.x + threadIdx.x;
743
+ int total_size = s1_size + s2_size + s3_size;
744
+
745
+ if (idx >= B * total_size) return;
746
+
747
+ int batch_idx = idx / total_size;
748
+ int feature_idx = idx % total_size;
749
+
750
+ if (feature_idx < s1_size) {
751
+ // Copy from scale1
752
+ multiscale[idx] = scale1[batch_idx * s1_size + feature_idx];
753
+ } else if (feature_idx < s1_size + s2_size) {
754
+ // Copy from scale2
755
+ int s2_idx = feature_idx - s1_size;
756
+ multiscale[idx] = scale2[batch_idx * s2_size + s2_idx];
757
+ } else {
758
+ // Copy from scale3
759
+ int s3_idx = feature_idx - s1_size - s2_size;
760
+ multiscale[idx] = scale3[batch_idx * s3_size + s3_idx];
761
+ }
762
+ }
763
+
764
+ // Memory-efficient horizontal flip: flip left-right in place
765
+ __global__ void k_flip_horizontal(const float* input, float* output, int height, int width, int B) {
766
+ int idx = blockIdx.x * blockDim.x + threadIdx.x;
767
+ int total_pixels = B * height * width;
768
+
769
+ if (idx >= total_pixels) return;
770
+
771
+ int batch_idx = idx / (height * width);
772
+ int pixel_idx = idx % (height * width);
773
+ int row = pixel_idx / width;
774
+ int col = pixel_idx % width;
775
+
776
+ // Flip column: new_col = width - 1 - col
777
+ int flipped_col = width - 1 - col;
778
+ int flipped_idx = batch_idx * (height * width) + row * width + flipped_col;
779
+
780
+ output[idx] = input[flipped_idx];
781
+ }
782
+
783
+ // Memory-efficient vertical flip: flip top-bottom in place
784
+ __global__ void k_flip_vertical(const float* input, float* output, int height, int width, int B) {
785
+ int idx = blockIdx.x * blockDim.x + threadIdx.x;
786
+ int total_pixels = B * height * width;
787
+
788
+ if (idx >= total_pixels) return;
789
+
790
+ int batch_idx = idx / (height * width);
791
+ int pixel_idx = idx % (height * width);
792
+ int row = pixel_idx / width;
793
+ int col = pixel_idx % width;
794
+
795
+ // Flip row: new_row = height - 1 - row
796
+ int flipped_row = height - 1 - row;
797
+ int flipped_idx = batch_idx * (height * width) + flipped_row * width + col;
798
+
799
+ output[idx] = input[flipped_idx];
800
+ }
801
+
802
+ // 6-scale mirror concatenation: [s1 | s2 | s3 | s1_mir | s2_mir | s3_mir]
803
+ __global__ void k_concatenate_6scale_mirror(const float* s1, const float* s2, const float* s3,
804
+ const float* s1_mir, const float* s2_mir, const float* s3_mir,
805
+ float* multiscale, int B, int s1_size, int s2_size, int s3_size) {
806
+ int idx = blockIdx.x * blockDim.x + threadIdx.x;
807
+ int single_size = s1_size + s2_size + s3_size; // 1029
808
+ int total_size = 2 * single_size; // 2058
809
+
810
+ if (idx >= B * total_size) return;
811
+
812
+ int batch_idx = idx / total_size;
813
+ int feature_idx = idx % total_size;
814
+
815
+ if (feature_idx < single_size) {
816
+ // First half: normal features [s1 | s2 | s3]
817
+ if (feature_idx < s1_size) {
818
+ // Copy from scale1
819
+ multiscale[idx] = s1[batch_idx * s1_size + feature_idx];
820
+ } else if (feature_idx < s1_size + s2_size) {
821
+ // Copy from scale2
822
+ int s2_idx = feature_idx - s1_size;
823
+ multiscale[idx] = s2[batch_idx * s2_size + s2_idx];
824
+ } else {
825
+ // Copy from scale3
826
+ int s3_idx = feature_idx - s1_size - s2_size;
827
+ multiscale[idx] = s3[batch_idx * s3_size + s3_idx];
828
+ }
829
+ } else {
830
+ // Second half: mirrored features [s1_mir | s2_mir | s3_mir]
831
+ int mirror_idx = feature_idx - single_size;
832
+ if (mirror_idx < s1_size) {
833
+ // Copy from mirrored scale1
834
+ multiscale[idx] = s1_mir[batch_idx * s1_size + mirror_idx];
835
+ } else if (mirror_idx < s1_size + s2_size) {
836
+ // Copy from mirrored scale2
837
+ int s2_idx = mirror_idx - s1_size;
838
+ multiscale[idx] = s2_mir[batch_idx * s2_size + s2_idx];
839
+ } else {
840
+ // Copy from mirrored scale3
841
+ int s3_idx = mirror_idx - s1_size - s2_size;
842
+ multiscale[idx] = s3_mir[batch_idx * s3_size + s3_idx];
843
+ }
844
+ }
845
+ }
846
+
847
+
848
+ // ================= BOTTLENECK ANALYSIS KERNELS =================
849
+
850
+ // Analyze activation saturation (ReLU dead neurons)
851
+ __global__ void k_analyze_activation_saturation(const float* activations, float* stats, int N) {
852
+ int idx = blockIdx.x * blockDim.x + threadIdx.x;
853
+ if (idx >= N) return;
854
+
855
+ float val = activations[idx];
856
+
857
+ // Use atomic operations to gather statistics
858
+ if (val <= 1e-6f) {
859
+ atomicAdd(&stats[0], 1.0f); // Dead neurons (ReLU=0)
860
+ } else if (val >= 0.99f) {
861
+ atomicAdd(&stats[1], 1.0f); // Saturated neurons
862
+ }
863
+ atomicAdd(&stats[2], val); // Sum for mean
864
+ atomicAdd(&stats[3], val*val); // Sum squares for variance
865
+ }
866
+
867
+ // Analyze gradient flow (vanishing/exploding gradients)
868
+ __global__ void k_analyze_gradient_flow(const float* gradients, float* stats, int N) {
869
+ int idx = blockIdx.x * blockDim.x + threadIdx.x;
870
+ if (idx >= N) return;
871
+
872
+ float grad = gradients[idx];
873
+ float abs_grad = fabsf(grad);
874
+
875
+ if (abs_grad < 1e-6f) {
876
+ atomicAdd(&stats[0], 1.0f); // Vanishing gradients
877
+ } else if (abs_grad > 10.0f) {
878
+ atomicAdd(&stats[1], 1.0f); // Exploding gradients
879
+ }
880
+ atomicAdd(&stats[2], abs_grad); // Sum for mean
881
+ }
882
+
883
+ // CRITICAL: Real-time bottleneck detection - identifies where information is lost
884
+ __global__ void k_bottleneck_detector(const float* input_features, const float* hidden_act,
885
+ const float* logits, float* bottleneck_metrics,
886
+ int batch_size, int input_size, int hidden_size, int output_size) {
887
+ int tid = blockIdx.x * blockDim.x + threadIdx.x;
888
+
889
+ // Feature diversity analysis (input layer) - detect information collapse
890
+ if (tid < input_size) {
891
+ float feature_sum = 0.0f, feature_var = 0.0f;
892
+ for (int b = 0; b < batch_size; b++) {
893
+ float val = input_features[b * input_size + tid];
894
+ feature_sum += val;
895
+ }
896
+ float mean = feature_sum / batch_size;
897
+
898
+ for (int b = 0; b < batch_size; b++) {
899
+ float val = input_features[b * input_size + tid];
900
+ feature_var += (val - mean) * (val - mean);
901
+ }
902
+ feature_var /= batch_size;
903
+
904
+ // Low variance = information loss (features all the same value)
905
+ if (feature_var < 1e-4f) atomicAdd(&bottleneck_metrics[0], 1.0f); // Dead features count
906
+ }
907
+
908
+ // Hidden activation analysis - detect neural saturation
909
+ if (tid < hidden_size) {
910
+ float hidden_sum = 0.0f;
911
+ for (int b = 0; b < batch_size; b++) {
912
+ hidden_sum += hidden_act[b * hidden_size + tid];
913
+ }
914
+ float hidden_mean = hidden_sum / batch_size;
915
+
916
+ // Saturation detection (critical bottleneck indicators)
917
+ if (hidden_mean < 0.01f) atomicAdd(&bottleneck_metrics[1], 1.0f); // Dead neurons
918
+ if (hidden_mean > 0.99f) atomicAdd(&bottleneck_metrics[2], 1.0f); // Saturated neurons
919
+ }
920
+
921
+ // Logits analysis (output bottleneck) - detect poor class discrimination
922
+ if (tid < output_size) {
923
+ float logit_range = 0.0f;
924
+ float min_logit = 1e10f, max_logit = -1e10f;
925
+
926
+ for (int b = 0; b < batch_size; b++) {
927
+ float val = logits[b * output_size + tid];
928
+ min_logit = fminf(min_logit, val);
929
+ max_logit = fmaxf(max_logit, val);
930
+ }
931
+ logit_range = max_logit - min_logit;
932
+
933
+ // Small range = poor discrimination ability (critical bottleneck)
934
+ if (logit_range < 0.1f) atomicAdd(&bottleneck_metrics[3], 1.0f); // Poor discrimination count
935
+ }
936
+ }
937
+
optical_model.cu-1057474305.deps ADDED
@@ -0,0 +1,168 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\corecrt.h
2
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\corecrt_malloc.h
3
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\corecrt_math.h
4
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\corecrt_memcpy_s.h
5
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\corecrt_memory.h
6
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\corecrt_search.h
7
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\corecrt_share.h
8
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\corecrt_stdio_config.h
9
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\corecrt_terminate.h
10
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\corecrt_wconio.h
11
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\corecrt_wctype.h
12
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\corecrt_wdirect.h
13
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\corecrt_wio.h
14
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\corecrt_wprocess.h
15
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\corecrt_wstdio.h
16
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\corecrt_wstdlib.h
17
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\corecrt_wstring.h
18
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\corecrt_wtime.h
19
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\crtdbg.h
20
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\ctype.h
21
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\errno.h
22
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\float.h
23
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\locale.h
24
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\malloc.h
25
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\math.h
26
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\share.h
27
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\stddef.h
28
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\stdio.h
29
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\stdlib.h
30
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\string.h
31
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\sys\stat.h
32
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\sys\types.h
33
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\time.h
34
+ C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\wchar.h
35
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\builtin_types.h
36
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\channel_descriptor.h
37
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\crt\common_functions.h
38
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\crt\cudacc_ext.h
39
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\crt\device_double_functions.h
40
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\crt\device_double_functions.hpp
41
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\crt\device_functions.h
42
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\crt\device_functions.hpp
43
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\crt\host_config.h
44
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\crt\host_defines.h
45
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\crt\math_functions.h
46
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\crt\math_functions.hpp
47
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\crt\sm_100_rt.h
48
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\crt\sm_70_rt.h
49
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\crt\sm_80_rt.h
50
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\crt\sm_90_rt.h
51
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\cuComplex.h
52
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\cuda_device_runtime_api.h
53
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\cuda_runtime.h
54
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\cuda_runtime_api.h
55
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\cufft.h
56
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\device_atomic_functions.h
57
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\device_launch_parameters.h
58
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\device_types.h
59
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\driver_functions.h
60
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\driver_types.h
61
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\library_types.h
62
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\sm_20_atomic_functions.h
63
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\sm_20_intrinsics.h
64
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\sm_30_intrinsics.h
65
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\sm_32_atomic_functions.h
66
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\sm_32_intrinsics.h
67
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\sm_35_atomic_functions.h
68
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\sm_35_intrinsics.h
69
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\sm_60_atomic_functions.h
70
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\sm_61_intrinsics.h
71
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\surface_indirect_functions.h
72
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\surface_types.h
73
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\texture_indirect_functions.h
74
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\texture_types.h
75
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\vector_functions.h
76
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\vector_functions.hpp
77
+ C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\vector_types.h
78
+ E:\Fashion_MNIST_Optic_Evolution\src\fungi.hpp
79
+ E:\Fashion_MNIST_Optic_Evolution\src\optical_model.hpp
80
+ E:\Fashion_MNIST_Optic_Evolution\src\utils.hpp
81
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\algorithm
82
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\ammintrin.h
83
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\atomic
84
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\cctype
85
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\cerrno
86
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\cfloat
87
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\climits
88
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\clocale
89
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\cmath
90
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\concurrencysal.h
91
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\crtdefs.h
92
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\cstddef
93
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\cstdint
94
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\cstdio
95
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\cstdlib
96
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\cstring
97
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\ctime
98
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\cwchar
99
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\eh.h
100
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\emmintrin.h
101
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\exception
102
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\immintrin.h
103
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\initializer_list
104
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\intrin.h
105
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\intrin0.h
106
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\intrin0.inl.h
107
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\ios
108
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\iosfwd
109
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\iostream
110
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\istream
111
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\iterator
112
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\limits
113
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\limits.h
114
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\memory
115
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\mmintrin.h
116
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\new
117
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\nmmintrin.h
118
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\ostream
119
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\pmmintrin.h
120
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\random
121
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\sal.h
122
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\setjmp.h
123
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\smmintrin.h
124
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\stdexcept
125
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\stdint.h
126
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\streambuf
127
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\string
128
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\system_error
129
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\tmmintrin.h
130
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\typeinfo
131
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\type_traits
132
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\use_ansi.h
133
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\utility
134
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\vadefs.h
135
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\vcruntime.h
136
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\vcruntime_exception.h
137
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\vcruntime_new.h
138
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\vcruntime_new_debug.h
139
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\vcruntime_string.h
140
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\vcruntime_typeinfo.h
141
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\vector
142
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\wmmintrin.h
143
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\xatomic.h
144
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\xbit_ops.h
145
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\xcall_once.h
146
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\xerrc.h
147
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\xfacet
148
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\xiosbase
149
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\xkeycheck.h
150
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\xlocale
151
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\xlocinfo
152
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\xlocnum
153
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\xmemory
154
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\xmmintrin.h
155
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\xstring
156
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\xthreads.h
157
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\xtimec.h
158
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\xtr1common
159
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\xutility
160
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\yvals.h
161
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\yvals_core.h
162
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\zmmintrin.h
163
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\__msvc_bit_utils.hpp
164
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\__msvc_int128.hpp
165
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\__msvc_iter_core.hpp
166
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\__msvc_sanitizer_annotate_container.hpp
167
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\__msvc_system_error_abi.hpp
168
+ E:\VS2022\VC\Tools\MSVC\14.38.33130\include\__msvc_xlocinfo_types.hpp
optical_model.cu.cache ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Identity=..\src\optical_model.cu
2
+ AdditionalCompilerOptions=
3
+ AdditionalCompilerOptions=
4
+ AdditionalDependencies=
5
+ AdditionalDeps=
6
+ AdditionalLibraryDirectories=
7
+ AdditionalOptions= -std=c++17 --generate-code=arch=compute_75,code=[compute_75,sm_75] --generate-code=arch=compute_80,code=[compute_80,sm_80] --generate-code=arch=compute_86,code=[compute_86,sm_86] -Xcompiler="/EHsc -Ob2"
8
+ AdditionalOptions= -std=c++17 --generate-code=arch=compute_75,code=[compute_75,sm_75] --generate-code=arch=compute_80,code=[compute_80,sm_80] --generate-code=arch=compute_86,code=[compute_86,sm_86] -Xcompiler="/EHsc -Ob2"
9
+ CodeGeneration=
10
+ CodeGeneration=
11
+ CompileOut=fashion_mnist_trainer.dir\Release\optical_model.obj
12
+ CudaRuntime=Static
13
+ CudaToolkitCustomDir=
14
+ DebugInformationFormat=None
15
+ DebugInformationFormat=None
16
+ Defines=;_WINDOWS;NDEBUG;CMAKE_INTDIR="Release";_MBCS;;WIN32;_WINDOWS;NDEBUG;CMAKE_INTDIR="Release"
17
+ Emulation=false
18
+ EnableVirtualArchInFatbin=true
19
+ ExtensibleWholeProgramCompilation=false
20
+ FastCompile=Off
21
+ FastMath=true
22
+ GenerateLineInfo=false
23
+ GenerateRelocatableDeviceCode=true
24
+ GPUDebugInfo=false
25
+ GPUDebugInfo=false
26
+ HostDebugInfo=false
27
+ Include=E:\Fashion_MNIST_Optic_Evolution\src;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\include\cccl
28
+ Inputs=
29
+ InterleaveSourceInPTX=false
30
+ Keep=false
31
+ KeepDir=fashion_.2B82790A\x64\Release
32
+ LinkOut=
33
+ MaxRegCount=0
34
+ NvccCompilation=compile
35
+ NvccPath=
36
+ Optimization=O2
37
+ Optimization=O2
38
+ PerformDeviceLink=
39
+ PerformDeviceLinkTimeOptimization=
40
+ PtxAsOptionV=false
41
+ RequiredIncludes=
42
+ Runtime=MD
43
+ Runtime=MD
44
+ RuntimeChecks=Default
45
+ RuntimeChecks=Default
46
+ SplitCompile=Default
47
+ SplitCompileCustomThreads=
48
+ TargetMachinePlatform=64
49
+ TargetMachinePlatform=64
50
+ TypeInfo=true
51
+ TypeInfo=true
52
+ UseHostDefines=true
53
+ UseHostInclude=false
54
+ UseHostLibraryDependencies=
55
+ UseHostLibraryDirectories=
56
+ Warning=W1
57
+ Warning=W1
optical_model.hpp ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #pragma once
2
+ #include <vector>
3
+ #include <cuda_runtime.h>
4
+ #include <cufft.h>
5
+ #include "fungi.hpp"
6
+
7
+ // Image geometry - Fashion-MNIST
8
+ constexpr int IMG_H = 28;
9
+ constexpr int IMG_W = 28;
10
+ constexpr int IMG_SIZE = IMG_H * IMG_W;
11
+ constexpr int NUM_CLASSES = 10; // Fashion-MNIST -> 10 classes
12
+
13
+ // INTELLIGENT ROLLBACK: Enhanced FFT with stable 2058-feature architecture
14
+ // ORIGINAL: Single scale FFT (28x28 = 784 features)
15
+ // PREVIOUS: 3-scale FFT (28x28 + 14x14 + 7x7 = 1029 features)
16
+ // CURRENT: Enhanced 6-scale mirror FFT (3 normal + 3 mirrored = 2058 features) - OPTIMIZED INFORMATION
17
+ constexpr int SCALE_1 = 28; // Full resolution - fine details
18
+ constexpr int SCALE_2 = 14; // Half resolution - texture patterns
19
+ constexpr int SCALE_3 = 7; // Quarter resolution - edge patterns
20
+ constexpr int SCALE_1_SIZE = SCALE_1 * SCALE_1; // 784
21
+ constexpr int SCALE_2_SIZE = SCALE_2 * SCALE_2; // 196
22
+ constexpr int SCALE_3_SIZE = SCALE_3 * SCALE_3; // 49
23
+ constexpr int SINGLE_SCALE_SIZE = SCALE_1_SIZE + SCALE_2_SIZE + SCALE_3_SIZE; // 1029 single features
24
+ constexpr int MULTISCALE_SIZE = 2 * SINGLE_SCALE_SIZE; // 2058 total features (normal + mirrored)
25
+
26
+ constexpr int HIDDEN_SIZE = 1800; // BALANCED: Optimal capacity for enhanced 2058-feature architecture
27
+
28
+ struct OpticalParams {
29
+ // Multi-scale MLP: hidden = ReLU(W1 * multiscale_features + b1), logits = W2 * hidden + b2
30
+ std::vector<float> W1; // [HIDDEN_SIZE, MULTISCALE_SIZE] - First layer weights (2058 inputs)
31
+ std::vector<float> b1; // [HIDDEN_SIZE] - First layer bias
32
+ std::vector<float> W2; // [NUM_CLASSES, HIDDEN_SIZE] - Second layer weights
33
+ std::vector<float> b2; // [NUM_CLASSES] - Second layer bias
34
+ // Adam moments for all parameters
35
+ std::vector<float> m_W1, v_W1, m_b1, v_b1;
36
+ std::vector<float> m_W2, v_W2, m_b2, v_b2;
37
+ };
38
+
39
+ struct DeviceBuffers {
40
+ float* d_batch_in = nullptr; // [B, IMG_SIZE]
41
+ uint8_t* d_batch_lbl = nullptr; // [B]
42
+
43
+ // Multi-scale optical processing buffers
44
+ cufftComplex* d_field_scale1 = nullptr; // [B, SCALE_1_SIZE] - Full resolution field
45
+ cufftComplex* d_freq_scale1 = nullptr; // [B, SCALE_1_SIZE] - Full resolution frequency
46
+ float* d_features_scale1 = nullptr; // [B, SCALE_1_SIZE] - Full resolution features
47
+
48
+ cufftComplex* d_field_scale2 = nullptr; // [B, SCALE_2_SIZE] - Half resolution field (14x14)
49
+ cufftComplex* d_freq_scale2 = nullptr; // [B, SCALE_2_SIZE] - Half resolution frequency
50
+ float* d_features_scale2 = nullptr; // [B, SCALE_2_SIZE] - Half resolution features
51
+
52
+ cufftComplex* d_field_scale3 = nullptr; // [B, SCALE_3_SIZE] - Quarter resolution field (7x7)
53
+ cufftComplex* d_freq_scale3 = nullptr; // [B, SCALE_3_SIZE] - Quarter resolution frequency
54
+ float* d_features_scale3 = nullptr; // [B, SCALE_3_SIZE] - Quarter resolution features
55
+
56
+ // Mirror architecture: flipped versions for enhanced feature extraction
57
+ float* d_features_scale1_mirror = nullptr; // [B, SCALE_1_SIZE] - Mirrored scale1 features
58
+ float* d_features_scale2_mirror = nullptr; // [B, SCALE_2_SIZE] - Mirrored scale2 features
59
+ float* d_features_scale3_mirror = nullptr; // [B, SCALE_3_SIZE] - Mirrored scale3 features
60
+
61
+ // BREAKTHROUGH: Rich dual-channel processing - separate magnitude and phase
62
+ float* d_magnitude_features = nullptr; // [B, MIRROR_SCALE_SIZE] - All magnitude features (2058)
63
+ float* d_phase_features = nullptr; // [B, MIRROR_SCALE_SIZE] - All phase features (2058)
64
+
65
+ float* d_multiscale_features = nullptr; // [B, MULTISCALE_SIZE] - Enhanced mirror features (2058)
66
+ float* d_hidden = nullptr; // [B, HIDDEN_SIZE] - Hidden layer activations
67
+ float* d_logits = nullptr; // [B, NUM_CLASSES]
68
+ float* d_probs = nullptr; // [B, NUM_CLASSES]
69
+ float* d_grad_logits = nullptr; // [B, NUM_CLASSES]
70
+ float* d_grad_hidden = nullptr; // [B, HIDDEN_SIZE] - Hidden layer gradients
71
+ float* d_grad_multiscale = nullptr; // [B, MULTISCALE_SIZE] - Multi-scale gradients
72
+
73
+ float* d_A = nullptr; // [IMG_SIZE]
74
+ float* d_P = nullptr; // [IMG_SIZE]
75
+ float* d_grad_map = nullptr; // [IMG_SIZE]
76
+
77
+ // C++ OPTIMIZATION: Persistent weight buffers in GPU memory
78
+ float* d_W1 = nullptr; // [HIDDEN_SIZE, MULTISCALE_SIZE] - Persistent weights
79
+ float* d_b1 = nullptr; // [HIDDEN_SIZE] - Persistent biases
80
+ float* d_W2 = nullptr; // [NUM_CLASSES, HIDDEN_SIZE] - Persistent weights
81
+ float* d_b2 = nullptr; // [NUM_CLASSES] - Persistent biases
82
+ float* d_gW1 = nullptr; // [HIDDEN_SIZE, MULTISCALE_SIZE] - Persistent gradients
83
+ float* d_gb1 = nullptr; // [HIDDEN_SIZE] - Persistent gradients
84
+ float* d_gW2 = nullptr; // [NUM_CLASSES, HIDDEN_SIZE] - Persistent gradients
85
+ float* d_gb2 = nullptr; // [NUM_CLASSES] - Persistent gradients
86
+ float* d_loss_scalar = nullptr; // [1] - Persistent loss buffer
87
+
88
+ // CRITICAL: Bottleneck detection buffers
89
+ float* d_bottleneck_metrics = nullptr; // [4] - Real-time bottleneck analysis
90
+ };
91
+
92
+ struct FFTPlan {
93
+ cufftHandle plan_fwd_scale1{}; // 28x28 FFT plan
94
+ cufftHandle plan_inv_scale1{};
95
+ cufftHandle plan_fwd_scale2{}; // 14x14 FFT plan
96
+ cufftHandle plan_inv_scale2{};
97
+ cufftHandle plan_fwd_scale3{}; // 7x7 FFT plan
98
+ cufftHandle plan_inv_scale3{};
99
+ };
100
+
101
+ void allocate_device_buffers(DeviceBuffers& db, int batch);
102
+ void free_device_buffers(DeviceBuffers& db);
103
+ void create_fft_plan(FFTPlan& fft, int batch);
104
+ void destroy_fft_plan(FFTPlan& fft);
105
+
106
+ void init_params(OpticalParams& p, unsigned seed);
107
+
108
+ // C++ OPTIMIZATION: Initialize weights in GPU memory once
109
+ void upload_params_to_gpu(const OpticalParams& params, DeviceBuffers& db);
110
+ void download_params_from_gpu(OpticalParams& params, const DeviceBuffers& db);
111
+
112
+ // C++ OPTIMIZATION: GPU-side Adam updates (no CPU transfers!)
113
+ void adam_update_gpu(OpticalParams& params, const DeviceBuffers& db, float lr, float wd, int t_adam);
114
+
115
+ float train_batch(const float* h_batch_in, const uint8_t* h_batch_lbl,
116
+ int B, FungiSoA& fungi, OpticalParams& params,
117
+ DeviceBuffers& db, FFTPlan& fft,
118
+ float lr, float wd, int t_adam);
119
+
120
+ void infer_batch(const float* h_batch_in, int B,
121
+ const FungiSoA& fungi, const OpticalParams& params,
122
+ DeviceBuffers& db, FFTPlan& fft,
123
+ std::vector<int>& out_predictions);
optical_model.obj ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3d4ebdb32d56b8f675ef86c38cf333d7b2ad4947c7dbdb21116df2c1c3cb8d7a
3
+ size 326455
training.cpp ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include "training.hpp"
2
+ #include "utils.hpp"
3
+ #include "fungi_Paremetres.hpp"
4
+ #include <iostream>
5
+ #include <vector>
6
+ #include <string>
7
+ #include <numeric>
8
+ #include <algorithm>
9
+ #include <random>
10
+ #include <iomanip>
11
+
12
+ void train_model(const FashionMNISTSet& train, const FashionMNISTSet& test, TrainConfig& cfg) {
13
+ const int N_train = train.N;
14
+ const int N_test = test.N;
15
+
16
+ OpticalParams params;
17
+ init_params(params, cfg.seed);
18
+
19
+ FungiSoA fungi;
20
+ fungi.resize(cfg.fungi_count, IMG_H, IMG_W);
21
+ fungi.init_random(cfg.seed);
22
+
23
+ DeviceBuffers db;
24
+ allocate_device_buffers(db, cfg.batch);
25
+
26
+ // C++ OPTIMIZATION: Upload weights to GPU once at start
27
+ upload_params_to_gpu(params, db);
28
+
29
+ FFTPlan fft;
30
+ create_fft_plan(fft, cfg.batch);
31
+
32
+ std::vector<int> train_indices(N_train);
33
+ std::iota(train_indices.begin(), train_indices.end(), 0);
34
+ std::mt19937 rng(cfg.seed);
35
+
36
+ int adam_step = 0;
37
+ double prev_accuracy = -1.0;
38
+
39
+ for (int ep = 1; ep <= cfg.epochs; ++ep) {
40
+ std::shuffle(train_indices.begin(), train_indices.end(), rng);
41
+ double epoch_loss = 0.0;
42
+ int samples_seen = 0;
43
+
44
+ // --- Training Loop ---
45
+ for (int start = 0; start < N_train; start += cfg.batch) {
46
+ int current_B = std::min(cfg.batch, N_train - start);
47
+
48
+ std::vector<float> h_batch_in(current_B * IMG_SIZE);
49
+ std::vector<uint8_t> h_batch_lbl(current_B);
50
+
51
+ for (int i = 0; i < current_B; ++i) {
52
+ int idx = train_indices[start + i];
53
+ memcpy(&h_batch_in[i * IMG_SIZE], &train.images[idx * IMG_SIZE], IMG_SIZE * sizeof(float));
54
+ h_batch_lbl[i] = train.labels[idx];
55
+ }
56
+
57
+ adam_step++;
58
+ float loss = train_batch(h_batch_in.data(), h_batch_lbl.data(), current_B, fungi, params, db, fft, cfg.lr, cfg.wd, adam_step);
59
+
60
+ // Optional evolution step (disabled due to earlier memory issues)
61
+ /*
62
+ if (adam_step % 5 == 0) {
63
+ float* d_dummy_grad;
64
+ cudaMalloc(&d_dummy_grad, sizeof(float) * IMG_SIZE);
65
+ cudaMemset(d_dummy_grad, 0, sizeof(float) * IMG_SIZE);
66
+
67
+ EvoParams evo_cfg;
68
+ evo_cfg.seed = cfg.seed + adam_step;
69
+ fungi_ecology_step(fungi, d_dummy_grad, evo_cfg);
70
+
71
+ cudaFree(d_dummy_grad);
72
+ }
73
+ */
74
+
75
+ epoch_loss += loss * current_B;
76
+ samples_seen += current_B;
77
+ std::cout << "\r[Epoch " << ep << "] Progress: " << samples_seen << "/" << N_train
78
+ << " Avg Loss: " << std::fixed << std::setprecision(5) << (epoch_loss / samples_seen)
79
+ << std::flush;
80
+ }
81
+ std::cout << "\n";
82
+
83
+ // --- Evaluation ---
84
+ std::cout << "[INFO] Evaluating on test set for epoch " << ep << "...\n";
85
+ int correct_predictions = 0;
86
+ for (int start = 0; start < N_test; start += cfg.batch) {
87
+ int current_B = std::min(cfg.batch, N_test - start);
88
+
89
+ std::vector<float> h_batch_in(current_B * IMG_SIZE);
90
+ for (int i = 0; i < current_B; ++i) {
91
+ memcpy(&h_batch_in[i * IMG_SIZE], &test.images[(start + i) * IMG_SIZE], IMG_SIZE * sizeof(float));
92
+ }
93
+
94
+ std::vector<int> predictions;
95
+ infer_batch(h_batch_in.data(), current_B, fungi, params, db, fft, predictions);
96
+
97
+ for (int i = 0; i < current_B; ++i) {
98
+ if (predictions[i] == test.labels[start + i]) {
99
+ correct_predictions++;
100
+ }
101
+ }
102
+ }
103
+ double accuracy = static_cast<double>(correct_predictions) / N_test;
104
+ std::cout << "[Epoch " << ep << " RESULT] Test Accuracy: "
105
+ << std::fixed << std::setprecision(4) << (accuracy * 100.0) << "%\n";
106
+
107
+ if (prev_accuracy >= 0.0) {
108
+ double delta = accuracy - prev_accuracy;
109
+ if (delta > cfg.accuracy_tolerance) {
110
+ int target_fungi = static_cast<int>(std::ceil(static_cast<double>(fungi.F) * cfg.fungi_growth_rate));
111
+ target_fungi = std::max(cfg.fungi_min, std::min(cfg.fungi_max, target_fungi));
112
+ if (target_fungi > fungi.F) {
113
+ fungi.adjust_population(target_fungi, cfg.seed + static_cast<unsigned>(ep * 17));
114
+ cfg.fungi_count = fungi.F;
115
+ std::cout << "[ADAPT] Accuracy improved by " << delta * 100.0
116
+ << "% -> fungi population " << fungi.F << "\n";
117
+ }
118
+ } else if (delta < -cfg.accuracy_tolerance) {
119
+ int target_fungi = static_cast<int>(std::floor(static_cast<double>(fungi.F) * cfg.fungi_decay_rate));
120
+ target_fungi = std::max(cfg.fungi_min, std::min(cfg.fungi_max, target_fungi));
121
+ if (target_fungi < fungi.F) {
122
+ fungi.adjust_population(target_fungi, cfg.seed + static_cast<unsigned>(ep * 23));
123
+ cfg.fungi_count = fungi.F;
124
+ std::cout << "[ADAPT] Accuracy decreased by " << -delta * 100.0
125
+ << "% -> fungi population " << fungi.F << "\n";
126
+ }
127
+ }
128
+ }
129
+ prev_accuracy = accuracy;
130
+ }
131
+
132
+ free_device_buffers(db);
133
+ destroy_fft_plan(fft);
134
+ }
training.hpp ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #pragma once
2
+ #include "data_loader.hpp"
3
+ #include "optical_model.hpp"
4
+ #include "fungi.hpp"
5
+
6
+ struct TrainConfig {
7
+ std::string data_dir = "data";
8
+ int epochs = 100;
9
+ int batch = 256;
10
+ float lr = 1e-3f;
11
+ int fungi_count = 256;
12
+ int fungi_min = 128;
13
+ int fungi_max = 1024;
14
+ float fungi_growth_rate = 1.15f;
15
+ float fungi_decay_rate = 0.9f;
16
+ float accuracy_tolerance = 100.0f;
17
+ int smooth_accuracy_window = 5;
18
+ unsigned seed = 1337u;
19
+ float wd = 0.0f;
20
+ };
21
+
22
+ void train_model(const FashionMNISTSet& train, const FashionMNISTSet& test, TrainConfig& cfg);
training.obj ADDED
Binary file (54.6 kB). View file
 
utils.cpp ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #include "utils.hpp"
2
+ #include <iostream>
3
+ #include <fstream>
4
+ #include <stdexcept>
5
+ #include <iomanip>
6
+
7
+ void check_cuda(cudaError_t st, const char* msg) {
8
+ if (st != cudaSuccess) {
9
+ std::cerr << "[CUDA ERROR] " << msg << ": " << cudaGetErrorString(st) << "\n";
10
+ std::exit(1);
11
+ }
12
+ }
13
+
14
+ void write_submission_csv(const std::string& path,
15
+ const std::vector<std::string>& ids,
16
+ const std::vector<float>& probabilities) {
17
+ std::ofstream ofs(path);
18
+ if (!ofs.is_open()) {
19
+ throw std::runtime_error("Cannot open submission file: " + path);
20
+ }
21
+ ofs << "id,label\n";
22
+ ofs << std::fixed << std::setprecision(8);
23
+ for (size_t i = 0; i < ids.size(); ++i) {
24
+ ofs << ids[i] << "," << probabilities[i] << "\n";
25
+ }
26
+ ofs.close();
27
+ std::cout << "[INFO] Submission saved to: " << path << " (" << ids.size() << " rows)\n";
28
+ }
utils.hpp ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ #pragma once
2
+ #include <string>
3
+ #include <vector>
4
+ #include <cuda_runtime.h>
5
+
6
+ void check_cuda(cudaError_t st, const char* msg);
7
+ void write_submission_csv(const std::string& path,
8
+ const std::vector<std::string>& ids,
9
+ const std::vector<float>& probabilities);
utils.obj ADDED
Binary file (93 kB). View file