Skip to content

Commit b921efa

Browse files
bottlerfacebook-github-bot
authored andcommitted
CUB usage fix for sample_farthest_points
Summary: Fix for #1529 Reviewed By: shapovalov Differential Revision: D45569211 fbshipit-source-id: 8c485f26cd409cafac53d4d982a03cde81a1d853
1 parent c8d6cd4 commit b921efa

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

Diff for: pytorch3d/csrc/sample_farthest_points/sample_farthest_points.cu

+1-5
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ at::Tensor FarthestPointSamplingCuda(
155155

156156
// Max possible threads per block
157157
const int MAX_THREADS_PER_BLOCK = 1024;
158-
const size_t threads = max(min(1 << points_pow_2, MAX_THREADS_PER_BLOCK), 1);
158+
const size_t threads = max(min(1 << points_pow_2, MAX_THREADS_PER_BLOCK), 2);
159159

160160
// Create the accessors
161161
auto points_a = points.packed_accessor64<float, 3, at::RestrictPtrTraits>();
@@ -215,10 +215,6 @@ at::Tensor FarthestPointSamplingCuda(
215215
FarthestPointSamplingKernel<2><<<threads, threads, shared_mem, stream>>>(
216216
points_a, lengths_a, K_a, idxs_a, min_point_dist_a, start_idxs_a);
217217
break;
218-
case 1:
219-
FarthestPointSamplingKernel<1><<<threads, threads, shared_mem, stream>>>(
220-
points_a, lengths_a, K_a, idxs_a, min_point_dist_a, start_idxs_a);
221-
break;
222218
default:
223219
FarthestPointSamplingKernel<1024>
224220
<<<blocks, threads, shared_mem, stream>>>(

0 commit comments

Comments
 (0)