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

[ur] Create printing C API #930

Merged
merged 1 commit into from
Jan 23, 2024

Conversation

PatKamin
Copy link
Contributor

@PatKamin PatKamin commented Oct 5, 2023

Fixes issue #828 by providing a C API for printing Unified Runtime objects.

Proposed C++ API is in PR #875 (merged).

source/common/print/ur_print.cpp Outdated Show resolved Hide resolved
test/conformance/testing/include/uur/checks.h Outdated Show resolved Hide resolved
scripts/templates/print.cpp.mako Show resolved Hide resolved
@PatKamin PatKamin force-pushed the expose-serialization-c-api branch 3 times, most recently from 7c411d3 to ce43934 Compare October 10, 2023 08:59
Copy link
Contributor

@pbalcer pbalcer left a comment

Choose a reason for hiding this comment

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

don't call this serialization in the commit message.

scripts/core/INTRO.rst Outdated Show resolved Hide resolved
source/print/ur_print.cpp Outdated Show resolved Hide resolved
source/print/ur_print.cpp Outdated Show resolved Hide resolved
@PatKamin PatKamin changed the title [ur] Create serialization C API [ur] Create printing C API Oct 23, 2023
@PatKamin
Copy link
Contributor Author

don't call this serialization in the commit message.

Done

@PatKamin
Copy link
Contributor Author

make a function to do this copy, to avoid ifdefs everywhere.

Done

@PatKamin PatKamin force-pushed the expose-serialization-c-api branch 2 times, most recently from ee7ffb2 to 890f4a6 Compare October 24, 2023 13:49
@PatKamin
Copy link
Contributor Author

I think we want this to be part of the ur api implemented by the loader. So should be in the /include folder.

Moved the implementation to the loader.

@PatKamin PatKamin marked this pull request as ready for review October 27, 2023 06:02
@PatKamin PatKamin force-pushed the expose-serialization-c-api branch 3 times, most recently from 96ea011 to 66611fb Compare November 2, 2023 13:47
@pbalcer
Copy link
Contributor

pbalcer commented Nov 22, 2023

This patch touches a lot of different high-traffic files. Let's hold off on merging it until the branches are reconciled.

Copy link
Contributor

@kbenzie kbenzie left a comment

Choose a reason for hiding this comment

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

LGTM

include/ur_print.h Show resolved Hide resolved
@PatKamin PatKamin requested a review from a team as a code owner December 6, 2023 10:48
@codecov-commenter
Copy link

codecov-commenter commented Dec 6, 2023

Codecov Report

Attention: 1169 lines in your changes are missing coverage. Please review.

Comparison is base (79c28d0) 15.80% compared to head (8066327) 15.53%.
Report is 6 commits behind head on main.

Files Patch % Lines
source/loader/ur_print.cpp 3.94% 1169 Missing ⚠️

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

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #930      +/-   ##
==========================================
- Coverage   15.80%   15.53%   -0.27%     
==========================================
  Files         223      226       +3     
  Lines       31481    32727    +1246     
  Branches     3558     3563       +5     
==========================================
+ Hits         4975     5085     +110     
- Misses      26455    27591    +1136     
  Partials       51       51              

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

test/unit/utils/print.cpp Show resolved Hide resolved

ur_result_t urPrintFunction(enum ur_function_t value, char *buffer,
const size_t buff_size, size_t *out_size) {
if (!buffer) {
Copy link
Contributor

Choose a reason for hiding this comment

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

you need to allow buffer to be null, otherwise there's no way to get out_size without preallocating something.

@PatKamin
Copy link
Contributor Author

you need to allow buffer to be null, otherwise there's no way to get out_size without preallocating something.

Good point, I removed this failure.

@PatKamin PatKamin force-pushed the expose-serialization-c-api branch 3 times, most recently from 4a9c972 to 19bbe49 Compare December 15, 2023 09:32
@bratpiorka bratpiorka self-requested a review January 15, 2024 09:38
@PatKamin PatKamin requested a review from pbalcer January 15, 2024 09:54
Add an /include header for printing Unified Runtime objects with a C API.
@PatKamin
Copy link
Contributor Author

Rebased

@PatKamin PatKamin requested a review from kbenzie January 22, 2024 08:44
@pbalcer pbalcer merged commit 4f80080 into oneapi-src:main Jan 23, 2024
51 checks passed
@PatKamin PatKamin deleted the expose-serialization-c-api branch June 26, 2024 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants