Skip to content

Commit 4f41421

Browse files
committed
Fixed more long types to int64_t
1 parent de2e845 commit 4f41421

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

cuda/src/metrics.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
#include "compat.h"
33
#include "utils.h"
44

5-
void instance_iou_kernel_wrapper(long total_gt_instances, long max_gt_instances,
6-
const long* nInstance, int nProposal, const long* proposals_idx,
7-
const long* proposals_offset, const long* instance_labels,
8-
const long* offset_num_gt_instances, const long* batch,
9-
const long* instance_pointnum, float* proposals_iou);
5+
void instance_iou_kernel_wrapper(int64_t total_gt_instances, int64_t max_gt_instances,
6+
const int64_t* nInstance, int nProposal, const int64_t* proposals_idx,
7+
const int64_t* proposals_offset, const int64_t* instance_labels,
8+
const int64_t* offset_num_gt_instances, const int64_t* batch,
9+
const int64_t* instance_pointnum, float* proposals_iou);
1010

1111
at::Tensor instance_iou_cuda(at::Tensor instance_idx, at::Tensor instance_offsets,
1212
at::Tensor gt_instances, at::Tensor gt_instance_sizes,
@@ -25,7 +25,7 @@ at::Tensor instance_iou_cuda(at::Tensor instance_idx, at::Tensor instance_offset
2525
CHECK_CUDA(gt_instance_sizes);
2626

2727
cudaSetDevice(instance_idx.get_device());
28-
long num_proposed_instances = instance_offsets.size(0) - 1;
28+
int64_t num_proposed_instances = instance_offsets.size(0) - 1;
2929
auto total_gt_instances = (int64_t*)malloc(sizeof(int64_t));
3030
cudaMemcpy(total_gt_instances, num_gt_instances.sum().DATA_PTR<int64_t>(), sizeof(int64_t),
3131
cudaMemcpyDeviceToHost);
@@ -40,10 +40,10 @@ at::Tensor instance_iou_cuda(at::Tensor instance_idx, at::Tensor instance_offset
4040
at::Tensor offset_num_gt_instances =
4141
at::cat({at::zeros(1, num_gt_instances.options()), num_gt_instances.cumsum(0)}, 0);
4242
instance_iou_kernel_wrapper(
43-
total_gt_instances[0], max_gt_instances[0], num_gt_instances.DATA_PTR<long>(),
44-
num_proposed_instances, instance_idx.DATA_PTR<long>(), instance_offsets.DATA_PTR<long>(),
45-
gt_instances.DATA_PTR<long>(), offset_num_gt_instances.DATA_PTR<long>(),
46-
batch.DATA_PTR<long>(), gt_instance_sizes.DATA_PTR<long>(), output.DATA_PTR<float>());
43+
total_gt_instances[0], max_gt_instances[0], num_gt_instances.DATA_PTR<int64_t>(),
44+
num_proposed_instances, instance_idx.DATA_PTR<int64_t>(), instance_offsets.DATA_PTR<int64_t>(),
45+
gt_instances.DATA_PTR<int64_t>(), offset_num_gt_instances.DATA_PTR<int64_t>(),
46+
batch.DATA_PTR<int64_t>(), gt_instance_sizes.DATA_PTR<int64_t>(), output.DATA_PTR<float>());
4747

4848
return output;
4949
}

cuda/src/metrics_gpu.cu

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
#define THREADS 512
88

99
__global__ void instance_iou_cuda_kernel(
10-
long total_gt_instances, const long* __restrict__ nInstance, int nProposal,
11-
const long* __restrict__ proposals_idx, const long* __restrict__ proposals_offset,
12-
const long* __restrict__ instance_labels, const long* __restrict__ offset_num_gt_instances,
13-
const long* __restrict__ batch, const long* __restrict__ instance_pointnum,
10+
int64_t total_gt_instances, const int64_t* __restrict__ nInstance, int nProposal,
11+
const int64_t* __restrict__ proposals_idx, const int64_t* __restrict__ proposals_offset,
12+
const int64_t* __restrict__ instance_labels, const int64_t* __restrict__ offset_num_gt_instances,
13+
const int64_t* __restrict__ batch, const int64_t* __restrict__ instance_pointnum,
1414
float* proposals_iou)
1515
{
1616
for (int proposal_id = blockIdx.x; proposal_id < nProposal; proposal_id += gridDim.x)
@@ -44,18 +44,18 @@ __global__ void instance_iou_cuda_kernel(
4444

4545
// input: proposals_idx (sumNPoint), int
4646
// input: proposals_offset (nProposal + 1), int
47-
// input: instance_labels (N), long, 0~total_nInst-1, -100
47+
// input: instance_labels (N), int64_t, 0~total_nInst-1, -100
4848
// input: instance_pointnum (total_nInst), int
4949
// output: proposals_iou (nProposal, total_nInst), float
50-
void instance_iou_kernel_wrapper(long total_gt_instances, long max_gt_instances,
51-
const long* nInstance, int nProposal, const long* proposals_idx,
52-
const long* proposals_offset, const long* instance_labels,
53-
const long* offset_num_gt_instances, const long* batch,
54-
const long* instance_pointnum, float* proposals_iou)
50+
void instance_iou_kernel_wrapper(int64_t total_gt_instances, int64_t max_gt_instances,
51+
const int64_t* nInstance, int nProposal, const int64_t* proposals_idx,
52+
const int64_t* proposals_offset, const int64_t* instance_labels,
53+
const int64_t* offset_num_gt_instances, const int64_t* batch,
54+
const int64_t* instance_pointnum, float* proposals_iou)
5555
{
5656
auto stream = at::cuda::getCurrentCUDAStream();
5757
instance_iou_cuda_kernel<<<std::min(nProposal, THREADS * THREADS),
58-
std::min(max_gt_instances, (long)THREADS), 0, stream>>>(
58+
std::min(max_gt_instances, (int64_t)THREADS), 0, stream>>>(
5959
total_gt_instances, nInstance, nProposal, proposals_idx, proposals_offset, instance_labels,
6060
offset_num_gt_instances, batch, instance_pointnum, proposals_iou);
6161
}

0 commit comments

Comments
 (0)