Skip to content

Commit 57ccfa1

Browse files
authored
Use int64_t instead of long (#301)
1 parent 8a66878 commit 57ccfa1

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

nerfacc/cuda/csrc/scan_cub.cu

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,13 @@ torch::Tensor inclusive_sum_cub(
8787
#if CUB_SUPPORTS_SCAN_BY_KEY()
8888
if (backward) {
8989
inclusive_sum_by_key(
90-
thrust::make_reverse_iterator(indices.data_ptr<long>() + n_edges),
90+
thrust::make_reverse_iterator(indices.data_ptr<int64_t>() + n_edges),
9191
thrust::make_reverse_iterator(inputs.data_ptr<float>() + n_edges),
9292
thrust::make_reverse_iterator(outputs.data_ptr<float>() + n_edges),
9393
n_edges);
9494
} else {
9595
inclusive_sum_by_key(
96-
indices.data_ptr<long>(),
96+
indices.data_ptr<int64_t>(),
9797
inputs.data_ptr<float>(),
9898
outputs.data_ptr<float>(),
9999
n_edges);
@@ -129,13 +129,13 @@ torch::Tensor exclusive_sum_cub(
129129
#if CUB_SUPPORTS_SCAN_BY_KEY()
130130
if (backward) {
131131
exclusive_sum_by_key(
132-
thrust::make_reverse_iterator(indices.data_ptr<long>() + n_edges),
132+
thrust::make_reverse_iterator(indices.data_ptr<int64_t>() + n_edges),
133133
thrust::make_reverse_iterator(inputs.data_ptr<float>() + n_edges),
134134
thrust::make_reverse_iterator(outputs.data_ptr<float>() + n_edges),
135135
n_edges);
136136
} else {
137137
exclusive_sum_by_key(
138-
indices.data_ptr<long>(),
138+
indices.data_ptr<int64_t>(),
139139
inputs.data_ptr<float>(),
140140
outputs.data_ptr<float>(),
141141
n_edges);
@@ -169,7 +169,7 @@ torch::Tensor inclusive_prod_cub_forward(
169169

170170
#if CUB_SUPPORTS_SCAN_BY_KEY()
171171
inclusive_prod_by_key(
172-
indices.data_ptr<long>(),
172+
indices.data_ptr<int64_t>(),
173173
inputs.data_ptr<float>(),
174174
outputs.data_ptr<float>(),
175175
n_edges);
@@ -203,7 +203,7 @@ torch::Tensor inclusive_prod_cub_backward(
203203
}
204204
#if CUB_SUPPORTS_SCAN_BY_KEY()
205205
inclusive_sum_by_key(
206-
thrust::make_reverse_iterator(indices.data_ptr<long>() + n_edges),
206+
thrust::make_reverse_iterator(indices.data_ptr<int64_t>() + n_edges),
207207
thrust::make_reverse_iterator((grad_outputs * outputs).data_ptr<float>() + n_edges),
208208
thrust::make_reverse_iterator(grad_inputs.data_ptr<float>() + n_edges),
209209
n_edges);
@@ -237,7 +237,7 @@ torch::Tensor exclusive_prod_cub_forward(
237237
}
238238
#if CUB_SUPPORTS_SCAN_BY_KEY()
239239
exclusive_prod_by_key(
240-
indices.data_ptr<long>(),
240+
indices.data_ptr<int64_t>(),
241241
inputs.data_ptr<float>(),
242242
outputs.data_ptr<float>(),
243243
n_edges);
@@ -272,7 +272,7 @@ torch::Tensor exclusive_prod_cub_backward(
272272

273273
#if CUB_SUPPORTS_SCAN_BY_KEY()
274274
exclusive_sum_by_key(
275-
thrust::make_reverse_iterator(indices.data_ptr<long>() + n_edges),
275+
thrust::make_reverse_iterator(indices.data_ptr<int64_t>() + n_edges),
276276
thrust::make_reverse_iterator((grad_outputs * outputs).data_ptr<float>() + n_edges),
277277
thrust::make_reverse_iterator(grad_inputs.data_ptr<float>() + n_edges),
278278
n_edges);

0 commit comments

Comments
 (0)