fp16 implementation, TODO deallocate in LayerWgs

This commit is contained in:
Francesco Gatti
2017-08-30 14:37:25 +00:00
parent a26ef98d2d
commit 2cf8d8f6fc
11 changed files with 190 additions and 42 deletions
+10
View File
@@ -80,9 +80,19 @@ public:
//batchnorm
bool batchnorm;
dnnType *power_h;
dnnType *scales_h, *scales_d;
dnnType *mean_h, *mean_d;
dnnType *variance_h, *variance_d;
//fp16
__half *data16_h, *bias16_h;
__half *data16_d, *bias16_d;
__half *power16_h, *power16_d;
__half *scales16_h, *scales16_d;
__half *mean16_h, *mean16_d;
__half *variance16_h, *variance16_d;
};
+3 -1
View File
@@ -58,7 +58,9 @@ public:
dataDim_t input_dim;
dataDim_t getOutputDim();
bool fp16;
};
}
#endif //NETWORK_H
#endif //NETWORK_H
+2
View File
@@ -12,4 +12,6 @@ void reorgForward( dnnType* srcData, dnnType* dstData,
void softmaxForward(float *input, int n, int batch, int batch_offset,
int groups, int group_offset, int stride, float temp, float *output, cudaStream_t stream = cudaStream_t(0));
void float2half(float* srcData, __half* dstData, int size, const cudaStream_t stream = cudaStream_t(0));
#endif //KERNELS_H