Skip to content

Conversation

@daboehme
Copy link
Member

@daboehme daboehme commented Oct 8, 2025

This adds scalar size specifiers like i16, u8, f32, etc. to the type system. Addresses #30.

Primarily this allows us to use smaller-size scalars in compound types in the C API. This wasn't possible before. For example, we can now import a list of floats like so:

float floats[4] = { 1.5, 2.5, 3.5, 4.5 };
adiak_namevalue("floats", adiak_general, NULL, "{%f32}", floats, 4);

Internally any shorter types are converted to double or int, so e.g. inputs passed as i16 are still stored as adiak_int. This is consistent with the C++ API and the way scalars are handled as varargs in C. It also requires no changes on the tool side. However since we know the real size of the input type we can address them correctly through void* pointers.

@daboehme daboehme merged commit 511f9e2 into llnl:master Oct 30, 2025
3 checks passed
@daboehme daboehme deleted the dev/fixed-size-scalars branch October 30, 2025 22:40
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.

1 participant