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

Problems about fp_16 in CUDA, as half, __hmul.......etc #405

Open
Bestom927 opened this issue Apr 28, 2024 · 1 comment
Open

Problems about fp_16 in CUDA, as half, __hmul.......etc #405

Bestom927 opened this issue Apr 28, 2024 · 1 comment

Comments

@Bestom927
Copy link

HI, i am currently using half type in my CUDA code, but when i use cgeist to it, it succeed in building a .o file with some AST output. I want to know whether polygeist support half or not, because the .o file is not usable.

thx for replying!!

@Bestom927
Copy link
Author

#include <cuda_runtime.h>
#include <cuda_fp16.h>

global void solve() {
half h1 = __float2half(1.0f);
half h2 = __float2half(2.0f);

half2 val = __halves2half2(h1, h2);
h1=h1*h2;
val =__hmul2(val,val);
}

void launch_solve(int gridx, int blockx) {
solve<<<gridx, blockx>>>();
}
int main(int argc, char* argv[]) {
launch_solve(1,1);
return 0;
}

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

No branches or pull requests

1 participant