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

Include stdbool.h in API headers #3

Closed
wants to merge 1 commit into from

Conversation

FranklandJack
Copy link
Contributor

@FranklandJack FranklandJack commented Nov 9, 2022

  • ur_api.h makes use of bool. ur_api.h is a C header and in C the bool type is defined in stdbool.h, hence we should include ur_api.h in the API header.

@bashbaug
Copy link
Contributor

bashbaug commented Nov 9, 2022

Alternatively, perhaps we should rethink whether we use bool in the unified runtime. Many APIs use a different explicitly sized type instead, e.g. cl_bool, VkBool32, ze_bool_t, to avoid potentially different sizes for bool.

@FranklandJack
Copy link
Contributor Author

FranklandJack commented Nov 10, 2022

Alternatively, perhaps we should rethink whether we use bool in the unified runtime. Many APIs use a different explicitly sized type instead, e.g. cl_bool, VkBool32, ze_bool_t, to avoid potentially different sizes for bool.

Thanks for your feedback @bashbaug . Good point, I did think it was a little odd the API was using bool and I think what you've suggested is a better solution.

More generally, APIs in the UR spec are using types from stdint.h for things like counts e.g. the numEventsInWaitList uint32_t parameter in urEnqueueMemBufferCopy. Other APIs such as OpenCL would use a API specific typedef here (for example clEnqueueCopyBuffer uses a cl_uint for its num_events_in_wait_list parameter, which is defined to always be 32 bits I think). Do you think we should introduce unified runtime typedefs for these fixed width integer types too? e.g. ur_uint. I think this is less of an issue than bool since the stdint.h types are of definite width already, but for consistencies sake maybe we want analogous integers for the other widths?

* `ur_api.h` makes use of `bool`. `ur_api.h` is a C header and in C
  the `bool` type is defined in `stdbool.h`, hence we should include
  `ur_api.h` in the API header.
@FranklandJack
Copy link
Contributor Author

Closing in favor of #42.

mateuszpn pushed a commit to Xewar313/unified-runtime that referenced this pull request Jan 28, 2025
# This is the 1st commit message:

parent 9824163
author Mikołaj Komar <mikolaj.komar@intel.com> 1734527193 +0000
committer Mateusz P. Nowak <mateusz.p.nowak@intel.com> 1738059437 +0000

Prepare ground for command_buffer in v2

Enforce in order list usage, and add initialization and destruction to buffer

Add initial support of command buffers to adapter v2

Update UR calls handling

Remove unnecessary comment

Move not implemented command buffer commands to previous position

Fix most issues with code

Fix formatting and modify queue_api template

Move command buffer cleanup to destructor

Use cached command lists instead of created ones

Remove not needed function and change phrasing

Add initial implementation of command list manager

Use list manager instead of custom implementation in queue

Optimalize imports

Remove not needed destructor

Revert "Fix formatting"

This reverts commit 545e577.

# This is the commit message oneapi-src#2:

Move command list close to the command buffer

# This is the commit message oneapi-src#3:

Moved try outside function block

# This is the commit message oneapi-src#4:

Move enqueue generic command list back to queue
mateuszpn added a commit to Xewar313/unified-runtime that referenced this pull request Jan 28, 2025
# This is the 1st commit message:

parent 9824163
author Mikołaj Komar <mikolaj.komar@intel.com> 1734527193 +0000
committer Mateusz P. Nowak <mateusz.p.nowak@intel.com> 1738059437 +0000

Prepare ground for command_buffer in v2

Enforce in order list usage, and add initialization and destruction to buffer

Add initial support of command buffers to adapter v2

Update UR calls handling

Remove unnecessary comment

Move not implemented command buffer commands to previous position

Fix most issues with code

Fix formatting and modify queue_api template

Move command buffer cleanup to destructor

Use cached command lists instead of created ones

Remove not needed function and change phrasing

Add initial implementation of command list manager

Use list manager instead of custom implementation in queue

Optimalize imports

Remove not needed destructor

Revert "Fix formatting"

This reverts commit 545e577.

Move command list close to the command buffer

Moved try outside function block

Move enqueue generic command list back to queue

Share events and lists between queue and command list manager

Use ze events instead of ur in getSignalEvent

# This is the commit message oneapi-src#2:

Remove not needed structs and reformat code

# This is the commit message oneapi-src#3:

Fix PR comments
mateuszpn added a commit to Xewar313/unified-runtime that referenced this pull request Jan 28, 2025
# This is the 1st commit message:

parent 9824163
author Mikołaj Komar <mikolaj.komar@intel.com> 1734527193 +0000
committer Mateusz P. Nowak <mateusz.p.nowak@intel.com> 1738059437 +0000

Prepare ground for command_buffer in v2

Enforce in order list usage, and add initialization and destruction to buffer

Add initial support of command buffers to adapter v2

Update UR calls handling

Remove unnecessary comment

Move not implemented command buffer commands to previous position

Fix most issues with code

Fix formatting and modify queue_api template

Move command buffer cleanup to destructor

Use cached command lists instead of created ones

Remove not needed function and change phrasing

Add initial implementation of command list manager

Use list manager instead of custom implementation in queue

Optimalize imports

Remove not needed destructor

Revert "Fix formatting"

This reverts commit 545e577.

Move command list close to the command buffer

Moved try outside function block

Move enqueue generic command list back to queue

Share events and lists between queue and command list manager

Use ze events instead of ur in getSignalEvent

# This is the commit message oneapi-src#2:

Remove not needed structs and reformat code

# This is the commit message oneapi-src#3:

Fix PR comments

# This is the commit message oneapi-src#4:

Fix ze function calling

# This is the commit message oneapi-src#5:

Fix access to some fields in command buffer v2

# This is the commit message oneapi-src#6:

Fix compilation
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.

2 participants