Skip to content

Commit

Permalink
replace pow(2, level) by 1 << level (#574)
Browse files Browse the repository at this point in the history
Signed-off-by: Clement Fuji Tsang <cfujitsang@nvidia.com>
  • Loading branch information
Caenorst committed May 27, 2022
1 parent cfd273a commit ca631b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion kaolin/csrc/ops/spc/point_utils_cuda.cu
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ void interpolate_trilinear_cuda_impl(
int64_t num_samples = coords.size(1);
int64_t feat_dim = feats_in.size(1);
int64_t num = num_voxels * num_samples;
int32_t resolution = pow(2, level);
int32_t resolution = 1 << level;

int num_threads = 128;
AT_DISPATCH_FLOATING_TYPES_AND_HALF(feats_in.type(), "interpolate_trilinear_cuda", ([&] {
Expand Down
4 changes: 2 additions & 2 deletions kaolin/csrc/ops/spc/query_cuda.cu
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ __global__ void query_cuda_kernel(
int stride = blockDim.x*gridDim.x;
if (idx > n) return;

int32_t resolution = pow(2, level);
int32_t resolution = 1 << level;

for (int i=idx; i<n; i+=stride) {
point_data point = make_point_data(
Expand All @@ -60,7 +60,7 @@ __global__ void query_multiscale_cuda_kernel(
int stride = blockDim.x*gridDim.x;
if (idx > n) return;

int32_t resolution = pow(2, level);
int32_t resolution = 1 << level;

for (int i=idx; i<n; i+=stride) {
point_data point = make_point_data(
Expand Down

0 comments on commit ca631b9

Please sign in to comment.