Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
apex
Commits
1603407b
Unverified
Commit
1603407b
authored
Mar 04, 2019
by
jjsjann123
Committed by
GitHub
Mar 04, 2019
Browse files
Merge pull request #176 from NVIDIA/next_pow2_fix
Bug fix in next power of 2
parents
603e17a5
ca6c2760
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
csrc/welford.cu
csrc/welford.cu
+2
-2
No files found.
csrc/welford.cu
View file @
1603407b
...
@@ -20,13 +20,13 @@ __device__ __forceinline__ int lastpow2(int n)
...
@@ -20,13 +20,13 @@ __device__ __forceinline__ int lastpow2(int n)
}
}
__host__
__forceinline__
int
h_next_pow2
(
unsigned
int
n
)
{
__host__
__forceinline__
int
h_next_pow2
(
unsigned
int
n
)
{
unsigned
int
old
=
n
;
n
--
;
n
|=
(
n
>>
1
);
n
|=
(
n
>>
1
);
n
|=
(
n
>>
2
);
n
|=
(
n
>>
2
);
n
|=
(
n
>>
4
);
n
|=
(
n
>>
4
);
n
|=
(
n
>>
8
);
n
|=
(
n
>>
8
);
n
|=
(
n
>>
16
);
n
|=
(
n
>>
16
);
return
n
==
old
?
n
:
n
+
1
;
return
++
n
;
}
}
__host__
__forceinline__
int
h_last_pow2
(
unsigned
int
n
)
{
__host__
__forceinline__
int
h_last_pow2
(
unsigned
int
n
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment