ae2f_docs
MlpPool.def.cc
Go to the documentation of this file.
1#ifndef ae2fVK_AnnMlpPool_h
2
3#if __ae2f_MACRO_GENERATED
4#define ae2fVK_AnnMlpPool_h
5#endif
6
7#if !ae2f_MAC_BUILD || !__ae2f_MACRO_GENERATED
8#include <ae2f/Macro.h>
9#include <assert.h>
10#endif
11
12#include <ae2fVK/Ann/Mlp.h>
13#include <ae2fVK/Ann/MlpPool.auto.h>
14#include <ae2fVK/Ann/SlpPool.auto.h>
15
16ae2f_MAC() _ae2fVK_AnnMlpDescPoolCmdMkPredict_imp(
18
19 ae2fVK_AnnMlp iv_mlp,
21 const ae2fVK_AnnSlpDescPool i_pool,
22
24
25 const VkCommandBuffer i_vkcmdbuf
26 )
27{
30 {
31 vkCmdPushConstants(
32 i_vkcmdbuf
33 , (iv_mlp).m_vkpipelayout[ae2fVK_eAnnSlpPipeLayouts_kPredict]
34 , VK_SHADER_STAGE_COMPUTE_BIT
35 , 0
36 , sizeof(uint32_t)
37 , &(iv_mlp).m_mlp.m_depth
38 );
39
40 vkCmdDispatch(
41 i_vkcmdbuf
42 , (iv_mlp).m_mlp.m_outc
43 , (iv_mlp).m_mlp.m_outc
44 , 1
45 );
46 }
47 )
48
49 , v_cmdmk
50 , r_cmd
51 , iv_mlp
52 , i_pool
53 , iv_err
54
55 , 1
56
57 , 0
58 , 0
59 + sizeof(uint32_t) * (iv_mlp).m_mlp.m_depth
60 + sizeof(ae2f_float_t) * ((iv_mlp).m_mlp.m_outc) * ((iv_mlp).m_mlp.m_depth * 2 + 1)
61 + sizeof(ae2f_float_t) * (iv_mlp).m_mlp.m_outc * (iv_mlp).m_mlp.m_outc * (iv_mlp).m_mlp.m_depth
62 , 0, sizeof(ae2f_float_t) * (iv_mlp).m_mlp.m_outc * 2
63
64 , ae2fVK_eAnnMlpDescLayouts_ONLY /** i_desclayout */
65 , ae2fVK_eAnnMlpPipes_kPredict /** i_pipe */
66 , ae2fVK_eAnnMlpPipeLayouts_kPredict /** i_pipelayout */
67 , i_vkcmdbuf
68 );
69}
70
71ae2f_MAC() _ae2fVK_AnnMlpDescPoolCmdMkTrain_imp(
73
74 ae2fVK_AnnMlp iv_mlp,
75 ae2f_err_t iv_err,
76 const ae2fVK_AnnMlpDescPool i_pool,
77
78 ae2fVK_AnnSlpDescPoolCmd r_cmd,
79
80 const VkCommandBuffer i_vkcmdbuf
81
82 )
83{
86 {
87 vkCmdPushConstants(
88 i_vkcmdbuf
89 , (iv_mlp).m_vkpipelayout[ae2fVK_eAnnSlpPipeLayouts_kTrain]
90 , VK_SHADER_STAGE_COMPUTE_BIT
91 , 0
92 , sizeof(uint32_t)
93 , &(iv_mlp).m_mlp.m_depth
94 );
95
96 vkCmdPushConstants(
97 i_vkcmdbuf
98 , (iv_mlp).m_vkpipelayout[ae2fVK_eAnnSlpPipeLayouts_kTrain]
99 , VK_SHADER_STAGE_COMPUTE_BIT
100 , ae2f_CmpGetGt(sizeof(ae2f_float_t), sizeof(uint32_t))
101 , sizeof(ae2f_float_t)
102 , &(iv_mlp).m_mlp.m_learningrate
103 );
104
105 vkCmdPushConstants(
106 i_vkcmdbuf
107 , (iv_mlp).m_vkpipelayout[ae2fVK_eAnnSlpPipeLayouts_kTrain]
108 , VK_SHADER_STAGE_COMPUTE_BIT
109 , ae2f_CmpGetGt(sizeof(ae2f_float_t), sizeof(uint32_t)) * 2
110 , sizeof(ae2f_float_t)
111 , &(iv_mlp).m_mlp.m_learningrate_bias
112 );
113
114 vkCmdDispatch(
115 i_vkcmdbuf
116 , (iv_mlp).m_mlp.m_outc
117 , (iv_mlp).m_mlp.m_outc
118 , 1
119 );
120 }
121 )
122 , v_cmdmk
123 , r_cmd
124 , iv_mlp
125 , i_pool
126 , iv_err
127
128 , 2
129
130 , 0
131 , __ae2fVK_AnnMlpGlobMemSz((iv_mlp).m_mlp.m_depth, (iv_mlp).m_mlp.m_outc)
132
133 , 0, (((iv_mlp).m_mlp.m_outc * ((iv_mlp).m_mlp.m_depth + 2)) * sizeof(ae2f_float_t))
134
135 , ae2fVK_eAnnMlpDescLayouts_ONLY /** i_desclayout */
136 , ae2fVK_eAnnMlpPipes_kTrainAuto /** i_pipe */
137 , ae2fVK_eAnnMlpPipeLayouts_kTrain /** i_pipelayout */
138 , i_vkcmdbuf
139 );
140}
141
142#endif
#define ae2f_CastMerge(...)
simply merge all text inside the round bracket, counting them as a single text block.
Definition Cast.h:25
#define ae2f_CmpGetGt(a, b)
Definition Cmp.h:20
ae2f_float ae2f_float_t
Definition Float.h:38
ae2fVK_AnnSlpDescPoolCmdMk_t ae2fVK_AnnMlpDescPoolCmdMk_t
Definition Mlp.core.h:119
#define __ae2fVK_AnnMlpDescPoolCmdMk_imp
Definition Mlp.core.h:164
#define __ae2fVK_AnnMlpGlobMemSz(i_depth, i_outc)
Definition Mlp.core.h:157
@ ae2fVK_eAnnSlpPipeLayouts_kTrain
Definition Slp.core.h:42
ae2fVK_AnnMlp ae2f_err_t const ae2fVK_AnnSlpDescPool ae2fVK_AnnMlpDescPoolCmd r_cmd
ae2fVK_AnnMlp ae2f_err_t iv_err
ae2fVK_AnnMlp ae2f_err_t const ae2fVK_AnnSlpDescPool i_pool
ae2fVK_AnnMlp iv_mlp
ae2fVK_AnnMlp ae2f_err_t const ae2fVK_AnnSlpDescPool ae2fVK_AnnMlpDescPoolCmd const VkCommandBuffer i_vkcmdbuf
#define __ae2fVK_AnnSlpDescPoolCmdMk_imp(COMMANDONRECORDING, v_cmdmk, r_cmd, iv_slp, i_pool, iv_err, i_desccount, i_offglob, i_szglob, i_offloc, i_szloc, i_desclayout, i_pipe, i_pipelayout, i_vkcmdbuf)
uint8_t ae2f_err_t
Informs that this number represents the error.
Definition errGlob.h:19
ae2fVK_AnnSlpDescPoolCmd ae2fVK_AnnMlpDescPoolCmd
Definition Mlp.h:28
ae2fVK_AnnSlpDescPool ae2fVK_AnnMlpDescPool
Definition Mlp.h:27
#define ae2f_MAC()
delta to delta
Definition mac.h:4