ROCm/Tensile

`getKernel` should return `hipErrorNotFound` if no module

v01dXYZ opened this issue · 2 comments

This faulty behavior causes a Page Fault.

In HipSolutionAdapter.cpp, getKernel(hipFunction_t& rv, string name) is used to search in the loaded kernels/modules for the right kernel matching the provided name. In the corner case of no module, getKernel will return hipSuccess instead of hipErrorNotFound.

https://github.com/ROCmSoftwarePlatform/Tensile/blob/cbdcbb9083035c85467276585ed743e8166298f5/Tensile/Source/lib/source/hip/HipSolutionAdapter.cpp#L168

When using tensile_client without code-object, the loadEmbeddedCodeObjects() method will be called. But since the EmbededData<SolutionAdapter> singleton is empty, the m_modules attribute will be empty as well. So it's not even a rare case.

Good catch. This should be pretty easy to fix, I'll work on getting a PR up soon.