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] nested macro is not hipified #7

Closed
emankov opened this issue Aug 11, 2016 · 3 comments
Closed

[HIPIFY] nested macro is not hipified #7

emankov opened this issue Aug 11, 2016 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@emankov
Copy link
Collaborator

emankov commented Aug 11, 2016

Example:

include "cuda_runtime.h"

define MY_MACRO(func, flags) (func, flags)

...
cudaEvent_t *event = NULL;
MY_MACRO(cudaEventCreateWithFlags(event, cudaEventDisableTiming), NULL);

where cudaEventDisableTiming is a defined numeric literal and thus a nested MACRO:

define cudaEventDisableTiming 0x02 /**< Event will not record timing data */

After hipifying now:
MY_MACRO(hipEventCreateWithFlags(event, cudaEventDisableTiming), NULL);

Should be:
MY_MACRO(hipEventCreateWithFlags(event, hipEventDisableTiming), NULL);

@emankov emankov self-assigned this Aug 11, 2016
@emankov emankov closed this as completed Aug 11, 2016
@emankov
Copy link
Collaborator Author

emankov commented Aug 11, 2016

Fixed.

/gerritgit/compute/ec/hip (amd-develop branch):
SHA-1: 2aacb02358102f0141398e75a9421cd702e9e206

  • clang-hipify: Add support for nested macro expansion and translation.

@emankov
Copy link
Collaborator Author

emankov commented Sep 1, 2016

cudaEvent_t *event = NULL;

cudaEvent_t should be hipified to hipEvent_t as well.

@emankov emankov reopened this Sep 1, 2016
@emankov emankov changed the title HIPIFY: nested macro is not hipified [HIPIFY] nested macro is not hipified Sep 1, 2016
mangupta referenced this issue in ROCm/HIP Sep 4, 2016
Fixes bug “HIPIFY: nested macro is not hipified”
https://github.com/GPUOpen-ProfessionalCompute-Tools/HIP/issues/33

Example:
#include "cuda_runtime.h"
#define MY_MACRO(func, flags) (func, flags)
...
cudaEvent_t *event = NULL;
MY_MACRO(cudaEventCreateWithFlags(event, cudaEventDisableTiming), NULL);

where cudaEventDisableTiming is a defined numeric literal and thus a nested MACRO:
#define cudaEventDisableTiming 0x02 /**< Event will not record timing data */

After hipifying now:
MY_MACRO(hipEventCreateWithFlags(event, cudaEventDisableTiming), NULL);

Should be:
MY_MACRO(hipEventCreateWithFlags(event, hipEventDisableTiming), NULL);
@emankov
Copy link
Collaborator Author

emankov commented Dec 26, 2016

Fixed.
/gerritgit/compute/ec/hip (amd-develop branch):
SHA-1: 24703944

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant