Skip to content

Add HIP language support#7334

Merged
lildude merged 2 commits into
github-linguist:mainfrom
Young-TW:main
Apr 21, 2025
Merged

Add HIP language support#7334
lildude merged 2 commits into
github-linguist:mainfrom
Young-TW:main

Conversation

@Young-TW
Copy link
Copy Markdown
Contributor

Description

This pull request adds support for the HIP programming language used in AMD's ROCm ecosystem for GPU programming. HIP is a C++-based parallel computing language, similar in structure to CUDA, and is widely used in projects targeting AMD GPUs.

  • I am adding a new language.
    • The extension of the new language is used in hundreds of repositories on GitHub.com.
    • I have included a real-world usage sample for all extensions added in this PR:
      • Sample source(s): Authored for this PR
      • Sample license(s): Licensed under the MIT license (same as Linguist)
    • I have included a syntax highlighting grammar:
    • I have added a color
      • Hex value: #4F3A4F
      • Rationale: A dark reddish color was chosen to reflect AMD's branding, in contrast to NVIDIA's green typically associated with CUDA.
        theme.
    • I have updated the heuristics to distinguish my language from others using the same extension.
      • Not necessary — the .hip extension is unique to HIP.

Thanks for reviewing!

@Young-TW Young-TW requested a review from a team as a code owner April 14, 2025 00:22
Copy link
Copy Markdown
Member

@lildude lildude left a comment

Choose a reason for hiding this comment

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

The sample you've provided is very small. I recommend adding a one or two more which are representative of the language as these files are used to train the classifier in the event another language with a matching extension is added in future. Small samples result in poor training data and thus poor analysis.

@Young-TW
Copy link
Copy Markdown
Contributor Author

Thanks for the suggestion! I'll add a few more representative HIP samples to improve the training data and update the PR shortly.

Added three representative HIP (.hip) files as language samples:
- HelloWorld.hip
- MatrixMultiplication.hip
- PrefixSum.hip

These are sourced from AMD's official ROCm HIP-Examples repository (MIT licensed)
to improve classification accuracy and better represent real-world HIP usage.
@Young-TW Young-TW requested a review from lildude April 20, 2025 13:07
Copy link
Copy Markdown
Member

@lildude lildude left a comment

Choose a reason for hiding this comment

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

Thanks for the new samples however several are too big - if they're suppressed in the diff, they're too big. We also don't accept "Hello world" samples as stated in the CONTRIBUTING.md file.

@Young-TW
Copy link
Copy Markdown
Contributor Author

Thanks for the clarification!

I'll replace the current samples with smaller, more representative ones from the same source and remove the HelloWorld sample per the CONTRIBUTING guidelines. Will update the PR shortly.

I picked these from AMD’s official ROCm HIP-Examples repo to ensure they reflect real-world usage, but I understand the importance of size constraints and avoiding trivial examples.

- Removed HelloWorld.hip and PrefixSum.hip as per CONTRIBUTING guidelines
- Replaced MatrixMultiplication.hip with a reduced version under ~110 lines
  focusing on key HIP features: shared memory, kernel launch, and device memory
Copy link
Copy Markdown
Member

@lildude lildude left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks.

Important

The changes in this PR will not appear on GitHub until the next release has been made and deployed. See here for more details.

@lildude lildude added this pull request to the merge queue Apr 21, 2025
Merged via the queue into github-linguist:main with commit 215154a Apr 21, 2025
5 checks passed
@github-linguist github-linguist locked as resolved and limited conversation to collaborators Aug 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants