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

OCCA enum and union support #705

Merged

Conversation

kian-ohara
Copy link
Contributor

Added support for (typedef) enums and (typedef) unions.

We make sure that structs come before tuples,
in order to keep cleanliness for later additions.
We add support for (typedef) enums by extending lang/type/enum.(cpp|hpp)
adding lang/loaders/enumLoader.(cpp|hpp) and lang/enumerator.(cpp|hpp)
We add the necessary tests to ensure that (typedef) enums
can be parsed and loaded by OCCA.
Only the most basic tests with int,float,etc, work.
We add the necessary tests to ensure that (typedef) unions
can be parsed and loaded by OCCA.
@mkbosmans
Copy link
Contributor

We have tested this on our side and it correctly handles enums and unions now in kernel code.

@kris-rowe kris-rowe added the OKL label Aug 24, 2023
@codecov
Copy link

codecov bot commented Aug 24, 2023

Codecov Report

Merging #705 (76d62de) into development (adde964) will decrease coverage by 0.99%.
The diff coverage is 45.86%.

❗ Current head 76d62de differs from pull request most recent head 84f843e. Consider uploading reports for the commit 84f843e to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@               Coverage Diff               @@
##           development     #705      +/-   ##
===============================================
- Coverage        76.24%   75.25%   -0.99%     
===============================================
  Files              292      297       +5     
  Lines            18826    19324     +498     
===============================================
+ Hits             14354    14543     +189     
- Misses            4472     4781     +309     
Files Changed Coverage Δ
include/occa/dtype/dtype.hpp 0.00% <0.00%> (ø)
src/occa/internal/lang/type/typedef.cpp 70.37% <ø> (-1.06%) ⬇️
src/occa/internal/lang/type/vartype.cpp 84.52% <28.57%> (-3.30%) ⬇️
src/occa/internal/lang/type/union.cpp 33.96% <29.78%> (+33.96%) ⬆️
src/dtype/dtype.cpp 51.67% <35.11%> (-23.67%) ⬇️
src/occa/internal/lang/enumerator.cpp 36.00% <36.00%> (ø)
src/occa/internal/lang/type/enum.cpp 40.00% <36.73%> (+40.00%) ⬆️
src/occa/internal/lang/loaders/typeLoader.cpp 79.00% <63.51%> (-6.08%) ⬇️
src/occa/internal/lang/loaders/unionLoader.cpp 64.70% <64.70%> (ø)
src/occa/internal/lang/loaders/enumLoader.cpp 83.72% <83.72%> (ø)
... and 3 more

... and 3 files with indirect coverage changes

@mkbosmans
Copy link
Contributor

Would this be still in time to go in the 1.6 release?

@kris-rowe kris-rowe merged commit 5ba1bce into libocca:development Sep 1, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants