ROCm / HIPIFY

HIPIFY: Convert CUDA to Portable C++ Code
https://rocm.docs.amd.com/projects/HIPIFY/en/latest/
MIT License
503 stars 70 forks source link

[HIPIFY] I accomplish HIP code to CUDA code reference Hipify, but meet some error when I run code by cuda_runtime_api.h #466

Closed wangzy0327 closed 2 years ago

wangzy0327 commented 2 years ago

image image

this is my github link about cudify: https://github.com/wangzy0327/Hip-conversion

emankov commented 2 years ago

Hi @wangzy0327,

So, you converted HIP to CUDA (not vice versa) and tried to compile the resulting CUDA source (by what?), got errors, and decided to file an issue to HIPIFY tools? What do you want from the HIPIFY team?

wangzy0327 commented 2 years ago

Sorry,I cannot describe it clearly. I compile the resulting CUDA source by regular expression reference hipify-perl. I want to know the limitations of conversion by regular expression. ep hipify-perl(what contents cannot convert?)

emankov commented 2 years ago

Well, you may provide both your source files. From the last screenshot, it looks like you are mixing CUDA and HIP APIs in your CUDA source.

wangzy0327 commented 2 years ago

Yes,I fix some bugs in my code. This is my test source files https://github.com/zjin-lcf/HeCBench/blob/master/atomicCAS-hip/main.cu https://github.com/zjin-lcf/HeCBench/blob/master/atomicCAS-cuda/main.cu

And convert file code and execute results 1639365826(1) image

emankov commented 2 years ago

I've successfully hipified your atomicCAS-cuda to HIP both by hipify-perl and hipify-clang. The HIP source obtained by hipify-clang is identical to your atomicCAS-hip.

Both atomicCAS-cuda and atomicCAS-hip was successfully compiled by hipcc.

The segfault you got when running atomicCAS-hip can happen for many reasons.

[Conclusions]

  1. The issue is not related to HIPIFY tools.
  2. You may file an issue to the HIP repo by providing your core dump log and info about ROCm HIP installed.
  3. This issue is closing as unrelated.