Skip to content

[Java] Cleaner approach to Enums#995

Closed
narangvivek10 wants to merge 3 commits intorapidsai:branch-25.08from
SearchScale:vivek/replace-enums-et-al
Closed

[Java] Cleaner approach to Enums#995
narangvivek10 wants to merge 3 commits intorapidsai:branch-25.08from
SearchScale:vivek/replace-enums-et-al

Conversation

@narangvivek10
Copy link
Copy Markdown
Contributor

Code changes for #989

@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented Jun 9, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

public static MemorySegment prepareTensor(Arena arena, MemorySegment data, long[] shape, int code, int bits, int ndim,
int deviceType, int lanes) {

int deviceType, int lanes, MemorySegment strides) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why do we need the strides passed in? All the calls to this seems to be MemorySegment.NULL at the moment.

Also, is this a remnant from some other work? Or is it related to the enums cleanup?

for (boolean use: useNativeMemoryDatasets) {
tmpResultsTopKWithRandomValues(use);
}
for (int i = 0; i < 100; i++) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There are a lot of whitespace fixes that are unrelated to this PR. Should we deal with linting, whitespace fixes etc in an entirely separate PR?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We'll rebase this after #1049.

@chatman
Copy link
Copy Markdown
Contributor

chatman commented Jun 25, 2025

FYI, we raised a jextract PR to generate Java native enums.
openjdk/jextract#284
That should be useful here, IMO.

@narangvivek10
Copy link
Copy Markdown
Contributor Author

I will create a fresh PR covering this piece once the jextract feature goes in. Closing this one for now. Thanks!

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.

3 participants