oneapi-src / level-zero

oneAPI Level Zero Specification Headers and Loader
https://spec.oneapi.com/versions/latest/elements/l0/source/index.html
MIT License
208 stars 90 forks source link

zeModuleGetGlobalPointer can not get correct size of global variable #59

Open jz10 opened 3 years ago

jz10 commented 3 years ago

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.

jandres742 commented 3 years ago

Hi @jz10 : to confirm: this is about incorrect implementation, rather than incorrect documentation or errors in the specification, right? If so, could you open the issue in https://github.com/intel/compute-runtime, where the L0 driver implementation is hosted?

jz10 commented 3 years ago

sure, thanks