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
Torchaudio
Commits
d79540ef
Commit
d79540ef
authored
Jun 06, 2025
by
zhanggzh
Browse files
change warpsort_topk.cuh and pow2_utils.cuh
parent
eb72a4dd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
src/libtorchaudio/cuctc/src/bitonic_topk/pow2_utils.cuh
src/libtorchaudio/cuctc/src/bitonic_topk/pow2_utils.cuh
+1
-1
src/libtorchaudio/cuctc/src/bitonic_topk/warpsort_topk.cuh
src/libtorchaudio/cuctc/src/bitonic_topk/warpsort_topk.cuh
+2
-2
No files found.
src/libtorchaudio/cuctc/src/bitonic_topk/pow2_utils.cuh
View file @
d79540ef
...
...
@@ -12,7 +12,7 @@ namespace cu_ctc {
* @tparam IntType data type (checked only for integers)
*/
template
<
typename
IntType
>
constexpr
__device__
IntType
log2
(
IntType
num
,
IntType
ret
=
IntType
(
0
))
{
constexpr
__host__
__device__
IntType
log2
(
IntType
num
,
IntType
ret
=
IntType
(
0
))
{
return
num
<=
IntType
(
1
)
?
ret
:
log2
(
num
>>
IntType
(
1
),
++
ret
);
}
...
...
src/libtorchaudio/cuctc/src/bitonic_topk/warpsort_topk.cuh
View file @
d79540ef
...
...
@@ -313,7 +313,7 @@ class warp_sort_filtered : public warp_sort<Capacity, Ascending, T, IdxT> {
__device__
__forceinline__
void
merge_buf_
()
{
topk
::
bitonic
<
kMaxBufLen
>
(
!
Ascending
,
kWarpWidth
).
sort
(
val_buf_
,
idx_buf_
);
this
->
merge_in
<
kMaxBufLen
>
(
val_buf_
,
idx_buf_
);
this
->
template
merge_in
<
kMaxBufLen
>(
val_buf_
,
idx_buf_
);
buf_len_
=
0
;
set_k_th_
();
// contains warp sync
#pragma unroll
...
...
@@ -421,7 +421,7 @@ constexpr inline __host__ __device__ IntType ceildiv(IntType a, IntType b) {
return
(
a
+
b
-
1
)
/
b
;
}
template
<
typename
IntType
>
constexpr
inline
__device__
IntType
roundUp256
(
IntType
num
)
{
constexpr
inline
__host__
__device__
IntType
roundUp256
(
IntType
num
)
{
// return (num + 255) / 256 * 256;
constexpr
int
MASK
=
255
;
return
(
num
+
MASK
)
&
(
~
MASK
);
...
...
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