From cfcc7fc844719da37450d1b99b0fa8e4d591f709 Mon Sep 17 00:00:00 2001 From: Jianwei Yang Date: Sat, 20 Jan 2018 18:01:03 -0500 Subject: [PATCH] add nms_cuda.c --- lib/model/nms/src/nms_cuda.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 lib/model/nms/src/nms_cuda.c diff --git a/lib/model/nms/src/nms_cuda.c b/lib/model/nms/src/nms_cuda.c new file mode 100644 index 0000000..9bb8407 --- /dev/null +++ b/lib/model/nms/src/nms_cuda.c @@ -0,0 +1,19 @@ +#include +#include +#include "nms_cuda_kernel.h" + +// this symbol will be resolved automatically from PyTorch libs +extern THCState *state; + +int nms_cuda(THCudaIntTensor *keep_out, THCudaTensor *boxes_host, + THCudaIntTensor *num_out, float nms_overlap_thresh) { + + nms_cuda_compute(THCudaIntTensor_data(state, keep_out), + THCudaIntTensor_data(state, num_out), + THCudaTensor_data(state, boxes_host), + boxes_host->size[0], + boxes_host->size[1], + nms_overlap_thresh); + + return 1; +}