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
dgl
Commits
bfde1422
"...text-generation-inference.git" did not exist on "3136f27f361b1a31ccd469998cc9e99249e759b8"
Unverified
Commit
bfde1422
authored
Nov 22, 2023
by
Muhammed Fatih BALIN
Committed by
GitHub
Nov 22, 2023
Browse files
[CUDA] Fix issue about integer overflow (#6586)
parent
ee6dc9b6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
src/array/cuda/utils.h
src/array/cuda/utils.h
+4
-2
No files found.
src/array/cuda/utils.h
View file @
bfde1422
...
...
@@ -46,11 +46,13 @@ int _NumberOfBits(const T& range) {
}
int
bits
=
1
;
while
(
bits
<
static_cast
<
int
>
(
sizeof
(
T
)
*
8
)
&&
(
1
<<
bits
)
<
range
)
{
while
(
bits
<
static_cast
<
int
>
(
sizeof
(
T
)
*
8
)
&&
(
1
ull
<<
bits
)
<
range
)
{
++
bits
;
}
CHECK_EQ
((
range
-
1
)
>>
bits
,
0
);
if
(
bits
<
static_cast
<
int
>
(
sizeof
(
T
)
*
8
))
{
CHECK_EQ
((
range
-
1
)
>>
bits
,
0
);
}
CHECK_NE
((
range
-
1
)
>>
(
bits
-
1
),
0
);
return
bits
;
...
...
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