compute-runtime icon indicating copy to clipboard operation
compute-runtime copied to clipboard

zeModuleGetGlobalPointer can not get correct size of global variable

Open jz10 opened this issue 5 years ago • 5 comments

When we invoked zeModuleGetGlobalPointer to retrieve the size of global variable specified by the 2nd argument (which is a string for global variable's name) , zeModuleGetGlobalPointer just returned 0 in the 3rd argument, but gave correct device visible pointer in the 4th argument.

We referred to the description at: https://spec.oneapi.com/level-zero/latest/core/api.html?highlight=globalpointer#zemodulegetglobalpointer . The L0 module was create by adding the compilation flag '-cl-std=CL2.0 -cl-take-global-address'

We tried the definition of global variable as scalar type or array type, neither of their size can be retrieved via zeModuleGetGlobalPointer correctly.

jz10 avatar May 24 '21 17:05 jz10

@jz10 : I think we have a bug on this interface previously, that we already fixed. Do you have a reproducer we can take a look at?

jandres742 avatar May 24 '21 17:05 jandres742

I was working on the L0 built from this March, maybe I should update to newer version?

jz10 avatar May 24 '21 17:05 jz10

Yes, let's try with latest release, to confirm.

jandres742 avatar May 26 '21 15:05 jandres742

Fix for this issue was merged on 18 March: https://github.com/intel/compute-runtime/commit/0897f997d68a4608cdf0a5c8c0b43ffe19a79169

please verify with this commit

HoppeMateusz avatar Jun 02 '21 09:06 HoppeMateusz

Since a fix was provided, I'm closing this. Please re-open if still reoccuring and thank you for the report.

AdamCetnerowski avatar Jun 17 '21 14:06 AdamCetnerowski