HSAFoundation / HSA-HOF-AMD

HSAIL Offline Finalizer (HOF): a tool for offline finalization of HSAIL or BRIG file to ISA.
6 stars 2 forks source link

hof can't link multiple HSAIL modules #2

Closed marxin closed 7 years ago

marxin commented 8 years ago

Hello.

Considering following two modules (copy&paste from PRM): http://pastebin.com/Q6trKzCQ and http://pastebin.com/rvZ9mq7L), the hof binary causes a segmentation fault:

hof -output=/tmp/fileKMM0DP -hsail /tmp/a.hsail /tmp/b.hsail Error: Call of undefined function Segmentation fault

nhaustov commented 8 years ago

Thanks for the report. This looks like a bug related to multiple HSAIL modules and function calls. We will take a look, however for future ROC (AMD HSA) Runtime we are looking for native LLVM AMDGPU backend solution.

marxin commented 8 years ago

Thanks, I've got experience with the official HSA Runtime which works fine with multiple modules, as well as function calls among functions in different modules.

Can you please explain what do you mean by the LLVM AMDGPU solution?

nhaustov commented 8 years ago

https://radeonopencompute.github.io/ has a picture. Also see http://llvm.org/docs/AMDGPUUsage.html for information about directly generating AMD GCN ISA with LLVM.

jamborm commented 8 years ago

Thanks for the report. This looks like a bug related to multiple HSAIL modules and function calls. We will take a look, however for future ROC (AMD HSA) Runtime we are looking for native LLVM AMDGPU backend solution.

We are aware that the finalizer is on a back burner but this issue is an important one (I do not think there is currently a reasonable way to e.g. compile Fortran code which calls into a math library directly to AMDGPU ISA). Moreover, finalization of multiple sources does work with the finalizer included in the (old) HSA run-time so it is very likely we are looking at a very simple bug. We would very much appreciate this fixed, otherwise we cannot move to the newest run-time.

nhaustov commented 8 years ago

Could you verify that HOF from pull request fixes your problem? Thanks.

marxin commented 8 years ago

Works for me, thanks.