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

[Issue]: __hadd(int x, int y) and __rhadd(int x, int y) is wrong #95

Open
kwu130 opened this issue Sep 19, 2024 · 3 comments
Open

[Issue]: __hadd(int x, int y) and __rhadd(int x, int y) is wrong #95

kwu130 opened this issue Sep 19, 2024 · 3 comments

Comments

@kwu130
Copy link

kwu130 commented Sep 19, 2024

Problem Description

The calculation result of __hadd(int x, int y) and __rhadd(int x, int y) is inconsistent with NV.

For example, to calculate __hadd(123, -789),the result on Rocm is 1, but the result on NV is -666.

The following are the descriptions of the __hadd function by Rocm and NV respectively.
Rocm
image
NV
image
The functions described are the same, but the calculation results are very different

Operating System

Centos7

CPU

AMD Ryzen 9 5900HX with Radeon Graphics

GPU

AMD Instinct MI100

ROCm Version

ROCm 5.7.0

ROCm Component

clr

Steps to Reproduce

kernel function as follows

__global__
void
kernel() {
    int x = 123;
    int y = -789;
    auto res = __hadd(x, y);
    printf("res %d\n", res);
}

(Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support

No response

Additional Information

Used cuda 11.8 to compare

@cjatin
Copy link
Contributor

cjatin commented Sep 19, 2024

Hmm strange, thanks for reporting.
Will look into this.

@kwu130
Copy link
Author

kwu130 commented Sep 20, 2024

Hmm strange, thanks for reporting. Will look into this.
Please take a look at the following functions, looking forward to your reply. @cjatin
__hadd
__rhadd
__uhadd
__urhadd

@cjatin
Copy link
Contributor

cjatin commented Sep 23, 2024

I found a few bugs. Raised a patch internally to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants