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

[HIPIFY] Transformation of declarations with external linkage and shared attribute for IncompleteArrayType (Part 2) #10

Closed
emankov opened this issue Sep 1, 2016 · 1 comment
Assignees
Labels
feature Feature request or implementation

Comments

@emankov
Copy link
Collaborator

emankov commented Sep 1, 2016

(Part 2) Transformations are needed in cases of further possible assignments of already transfomed "extern" variable. Example:

extern __shared__ uint sRadix1[]; =>  HIP_DYNAMIC_SHARED(unsigned int, sRadix1);  // Part 1, done
uint * sRadix2 = sRadix1; => __attribute__((address_space(3))) uint* sRadix2 = sRadix1; // Part 2

First part of transformation (transformation of declarations with external linkage and shared attribute for IncompleteArrayType) has already done. Second part - all assignments of such "extern" var should be transformed as well.

sRadix2 can't be of type uint* after hipifying. It should be of type __attribute__((address_space(3))) uint* due to the changed type of sRadix1:

#define HIP_DYNAMIC_SHARED(type, var) \
__attribute__((address_space(3))) type* var = \
(__attribute__((address_space(3))) type*)__get_dynamicgroupbaseptr(); \

There might be more complicated situations when this "extern" var is used as a function argument (It is a 3rd part - to be investigated, example is needed).

@emankov emankov self-assigned this Sep 1, 2016
@emankov
Copy link
Collaborator Author

emankov commented Jul 20, 2018

As long as HIP_DYNAMIC_SHARED macro is changed to:

#define HIP_DYNAMIC_SHARED(type, var) type* var = (type*)__get_dynamicgroupbaseptr();

types transformation is not needed anymore, thus close the issue.

@emankov emankov closed this as completed Jul 20, 2018
@emankov emankov transferred this issue from ROCm/HIP Apr 3, 2020
@emankov emankov added the feature Feature request or implementation label Apr 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature request or implementation
Projects
None yet
Development

No branches or pull requests

1 participant