-
Notifications
You must be signed in to change notification settings - Fork 71
Fixed coverity issue in acl_device.cpp #225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
f611a03
to
22fa499
Compare
I get this weird git warning whenever I pan over to Files changed tab:
I'm not sure if I'm supposed to do anything about it. |
22fa499
to
02f642c
Compare
`acl_get_default_device_global_memory` can return `-1` if no device memory is found. By static_casting it to `size_t`, it makes the -1 into something irrationally big. Therefore, after returning from the function, I added a check to see if `gmem_id` is negative. If it is negative, then I return 0. I assumed that no device private memory means that by default the sizes of global memory, of max constant buffer, and of max device memory allocation are all `0`.
02f642c
to
8633df2
Compare
Thanks Hao. I don't see anything when I clicked on the Files changed tab. Maybe it's telling you that the "code coverage" workflow is running? |
This is the log that I get from
I'm not sure what all of this means... |
@haoxian2 This is the code coverage workflow seeing the new branch for |
Fixed coverity issue in acl_device.cpp: Type: Argument cannot be negative (NEGATIVE_RETURNS)
acl_get_default_device_global_memory
can return-1
if no device memory is found. By static_casting it tosize_t
, it makes the -1 into something irrationally big. Therefore, after returning from the function, I added a check to see ifgmem_id
is negative. If it is negative, then I return 0. I assumed that no device private memory means that by default the sizes of global memory, of max constant buffer, and of max device memory allocation are all0
.