Skip to content
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

Fix coverity issues in OpenCL, cuda and hip adapters. #1185

Merged
merged 2 commits into from
Dec 15, 2023

Conversation

aarongreig
Copy link
Contributor

@aarongreig aarongreig commented Dec 13, 2023

@@ -1060,7 +1060,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemImageRead(
} catch (...) {
return UR_RESULT_ERROR_UNKNOWN;
}
return UR_RESULT_SUCCESS;
return Result;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the wrong return has been removed here, this is a behaviour change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pattern is used in a lot of places here, Result is what gets returned. On closer inspection though I don't like it, I've updated these two entry points and I'm working on a refactor for this whole file because I think the pattern potentially drops error codes.

Copy link
Contributor

@kbenzie kbenzie Dec 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I can see how that might happen. I think returning at the point where an error occurs is much less error prone than reusing a Result variable.

@@ -1125,8 +1124,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemImageWrite(
return UR_RESULT_ERROR_UNKNOWN;
}

return UR_RESULT_SUCCESS;

return Result;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the wrong return has been removed here, this is a behaviour change.

@kbenzie kbenzie added the v0.8.x Include in the v0.8.x release label Dec 13, 2023
@kbenzie kbenzie mentioned this pull request Dec 13, 2023
13 tasks
Copy link
Contributor

@isaacault isaacault left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bindless images changes LGTM

@codecov-commenter
Copy link

codecov-commenter commented Dec 14, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4424195) 15.73% compared to head (6a83d3e) 15.73%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1185   +/-   ##
=======================================
  Coverage   15.73%   15.73%           
=======================================
  Files         223      223           
  Lines       31465    31465           
  Branches     3556     3556           
=======================================
  Hits         4951     4951           
  Misses      26463    26463           
  Partials       51       51           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@EwanC EwanC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

command-buffer changes LGTM

source/adapters/cuda/device.cpp Outdated Show resolved Hide resolved
source/adapters/cuda/device.cpp Show resolved Hide resolved
source/adapters/cuda/event.hpp Outdated Show resolved Hide resolved
source/adapters/cuda/program.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@mmoadeli mmoadeli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM hip/cuda.

@kbenzie kbenzie merged commit 67e4d1b into oneapi-src:main Dec 15, 2023
51 checks passed
kbenzie added a commit to kbenzie/unified-runtime that referenced this pull request Dec 15, 2023
…udaCL

Fix coverity issues in OpenCL, cuda and hip adapters.
kbenzie added a commit to kbenzie/unified-runtime that referenced this pull request Dec 15, 2023
…udaCL

Fix coverity issues in OpenCL, cuda and hip adapters.
kbenzie added a commit to kbenzie/unified-runtime that referenced this pull request Dec 15, 2023
…udaCL

Fix coverity issues in OpenCL, cuda and hip adapters.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v0.8.x Include in the v0.8.x release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants