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

accept explicit alignment for kernel arguments #2

Open
whchung opened this issue Jul 24, 2014 · 2 comments
Open

accept explicit alignment for kernel arguments #2

whchung opened this issue Jul 24, 2014 · 2 comments

Comments

@whchung
Copy link

whchung commented Jul 24, 2014

I'm wondering would it be possible to let HSAIL backend support manually specifying alignment for kernel arguments?

For example, if C++ AMP emit the following IR:

define internal cc76 void @foo(i32 align 8) {
ret void
}

then HSAIL backend will generate the following HSAIL:

prog kernel &foo(
align(8) kernarg_u32 %__arg_p1
) {
ret;
}

The rationale is because in C++AMP runtime we use std::vector to hold all kernel arguments prior to kernel launch. This is copied from Okra runtime implementation. And right now we use "sed" to hack HSAIL emitted by HSAIL backend to make sure all kernargs are 8-bytes aligned. But if we move to BRIG then such hack won't work anymore.

@alienanthill
Copy link

Currently, is the back-end stripping the alignments information?

@whchung
Copy link
Author

whchung commented Jul 25, 2014

Yes, the alignment information is ignored by HSAIL backend right now.

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