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] hipify-clang and hipify-perl fails to add HIP_KERNEL_NAME (aka round brackets) #64

Closed Kaveh01 closed 4 years ago

Kaveh01 commented 5 years ago

Both hipify-clang and hipify-perl translate kernel lunch line like this:

sort<512, 8><<<1, 512>>>(d_gpu, result_gpu); to hipLaunchKernelGGL(sort<512, 8>, dim3(1), dim3(512), 0, 0, d_gpu, result_gpu); which leads to folowing error:

.hip.cpp(49): error: expected an expression
hip.cpp(49): error: expression must have a constant value
hip.cpp(49): error: expression must have a constant value
hip.cpp(49): error: expression preceding parentheses of apparent call must have (pointer-to-) function type
hip.cpp(49): error: expected a ">"

the working translation should be like this: hipLaunchKernelGGL(HIP_KERNEL_NAME(sort<512, 8>), dim3(1), dim3(512), 0, 0, d_gpu, result_gpu);

Kaveh01 commented 5 years ago

Thanks!

emankov commented 5 years ago

Have you double-checked?

Kaveh01 commented 5 years ago

Yes, it worked smoothly.