38a1b9dcb2
The new test works both with TensorRT and cuDNN. Preprocessing and Postprocessing are missing. Add ClippedReLU (for ReLU6), groups for Conv2d, additional bias for convolution. Other minors: -move the timer in the detector to measure all the processing time for a given frame (both centernet and yolo); -add int8 flag. Signed-off-by: Micaela Verucchi <micaelaverucchi@gmail.com> Davide Sapienza <sapienza.dav@gmail.com>
34 lines
751 B
Plaintext
34 lines
751 B
Plaintext
#include "kernels.h"
|
|
|
|
__global__
|
|
void activation_relu_ceiling(dnnType *input, dnnType *output, int size, const float ceiling) {
|
|
|
|
int i = blockDim.x*blockIdx.x + threadIdx.x;
|
|
|
|
if(i<size) {
|
|
if (input[i]>0)
|
|
{
|
|
if (input[i]>ceiling)
|
|
output[i] = ceiling;
|
|
else
|
|
output[i] = input[i];
|
|
}
|
|
else
|
|
output[i] = 0.0f;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
Relu ceiling activation function
|
|
*/
|
|
void activationReLUCeilingForward(dnnType* srcData, dnnType* dstData, int size, const float ceiling, cudaStream_t stream)
|
|
{
|
|
int blocks = (size+255)/256;
|
|
int threads = 256;
|
|
|
|
activation_relu_ceiling<<<blocks, threads, 0, stream>>>(srcData, dstData, size, ceiling);
|
|
}
|
|
|
|
|