Closed incardon closed 1 month ago
Could you please provide the whole test case?
I lanuch with
../HIP/hipify-clang/dist/bin/hipify-clang -I/usr/local/cuda/include -I. -I./config -I/where/you/have/BOOST_1.68_or_higher/include -DNDEBUG NN/CellList/CellList_gpu_test.cu -DNVCC -o CellList_gpu_test.cpp -Dclang -- --std=c++11 -DCUDACC_VER_MAJOR=10 -DCUDACC_VER_MINOR=1 -DCUDACC_VER_MINOR -DCUDACC_VER_BUILD=243
You have to set boost. I know is not the smallest test case, but if you are able to reproduce from here, you save me time in searching the smallest case to reproduce. If you think it is too big I will create the smallest one.
Hi @incardon,
I've just fixed it finally, but not the way you thought. Please, have a look.
That is also what I want, because is the macro to be changed and not where the macro is called
You right, but this particular macro is really something: __VA_ARGS__
and function style - things, expanding which I have not overcome yet. Please, have a look at the test: https://github.com/ROCm-Developer-Tools/HIP/blob/master/tests/hipify-clang/unit_tests/kernel_launch/kernel_launch_01.cu as an interim working solution. If the solution suits you, please close this Issue, and I will file a new one for replacement in macro.
@incardon, just a gentle ping.
Thank you very much for the fix. I will test it as soon as possible
@incardon, have you had a chance to test on your side?
Yes. Thanks. It does the Job perfectly
But it is not how you wanted initially.
If you mean it skip the substitution. It does. If you refer to the fact that does not change the macro it does not, but at least in my case is marginal problem. It is just one place where I have to change the code manually. That macro is just used to do error checking in debug mode
I meant that the proper solution is to transform the macro declaration, not its usage transforming. ROCm-Developer-Tools/HIP#1409 is a compromise. I'll open a new ticket not to forget implementing macro declaration transformation.
Having a kernel launch inside a macro like this
and using it with
produce a crash. The main problem come from HipifyAction.cpp
It seem that launchEnd point to a location before launchStart
printing the location pointed by the two positions /tmp/CellList_gpu_test.cu-b82dd5.hip:555:2 <----- end /tmp/CellList_gpu_test.cu-b82dd5.hip:555:14 <----- start
producing a length negative and subsequent crash.
I use this fact to skip the substitution. ( That is also what I want, because is the macro to be changed and not where the macro is called )
I report it in case there is a better way to fix the problem