Skip to content

Commit cfcc7fc

Browse files
author
Jianwei Yang
committed
add nms_cuda.c
1 parent 01e0f7c commit cfcc7fc

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

lib/model/nms/src/nms_cuda.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include <THC/THC.h>
2+
#include <stdio.h>
3+
#include "nms_cuda_kernel.h"
4+
5+
// this symbol will be resolved automatically from PyTorch libs
6+
extern THCState *state;
7+
8+
int nms_cuda(THCudaIntTensor *keep_out, THCudaTensor *boxes_host,
9+
THCudaIntTensor *num_out, float nms_overlap_thresh) {
10+
11+
nms_cuda_compute(THCudaIntTensor_data(state, keep_out),
12+
THCudaIntTensor_data(state, num_out),
13+
THCudaTensor_data(state, boxes_host),
14+
boxes_host->size[0],
15+
boxes_host->size[1],
16+
nms_overlap_thresh);
17+
18+
return 1;
19+
}

0 commit comments

Comments
 (0)