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

[HIP] HIP_ARRAY_DESCRIPTOR struct is incompatible with CUDA_ARRAY_DESCRIPTOR #1133

Open
emankov opened this issue May 23, 2019 · 0 comments

Comments

Projects
None yet
4 participants
@emankov
Copy link
Collaborator

commented May 23, 2019

HIP_ARRAY_DESCRIPTOR is incompatible with CUDA_ARRAY_DESCRIPTOR due to two additional fields: unsigned int Flags and size_t Depth, which are presented not in CUDA_ARRAY_DESCRIPTOR but in CUDA_ARRAY3D_DESCRIPTOR.

In HIP for all array types, HIP_ARRAY_DESCRIPTOR is used, whereas in CUDA there are two different structs.

Thus, there are several functions, which work only on AMD. There are no even their fallback analogues in HIP's nvcc path. Here they are:

hipArrayCreate, hipArray3DCreate, hipTexRefSetAddress2D

Theoretically, single struct might be supported in hipify-clang, but it will require additional transformation pass and time for implementing it; changes in nvcc_detail will also be needed. Right now, the above functions and struct couldn't be hipified.

May we split HIP_ARRAY_DESCRIPTOR into two different structs: HIP_ARRAY_DESCRIPTOR and HIP_ARRAY3D_DESCRIPTOR?

Btw, cuArrayGetDescriptor, cuArray3DGetDescriptor will be supported as well for both CUDA and HIP in such case.

emankov added a commit to emankov/HIP that referenced this issue May 23, 2019

[HIP][HIPIFY] Split HIP_ARRAY_DESCRIPTOR struct to HIP_ARRAY_DESCRIPT…
…OR and HIP_ARRAY3D_DESCRIPTOR

[Reason] To be compatible with CUDA [ROCm-Developer-Tools#1133]

Update HIP code, hipify-clang, tests and docs

[TODO] Add support of the corresponding functions on nvcc fallback path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.