fp16 implementation, TODO deallocate in LayerWgs
This commit is contained in:
@@ -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
@@ -58,7 +58,9 @@ public:
|
||||
|
||||
dataDim_t input_dim;
|
||||
dataDim_t getOutputDim();
|
||||
|
||||
bool fp16;
|
||||
};
|
||||
|
||||
}
|
||||
#endif //NETWORK_H
|
||||
#endif //NETWORK_H
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user