AI Tools from Intel
Find answers to your toolkit installation, configuration, and get-started questions.
152 Discussions

oneAPI DNNL: How to get stat memory descriptor in C API from layer normalization primitive

Ladislav_K
Novice
6,152 Views

Hello Community,

I have question related to oneDNN (https://www.intel.com/content/www/us/en/developer/tools/oneapi/onednn.html), but I am not sure where is the right place to ask.

 

In oneDNN there is C API function dnnl_layer_normalization_forward_primitive_desc_create(), where for "stat" parameter (mean and variance) can be passed null.

 

Is there way how to query memory descriptor from primitive descriptor to create required memory?

In C++ code example there is :

    // Use the memory descriptors from the primitive to create memory objects
    // required for the primitive: mean, variance, scale/shift.
    auto mean_mem = memory(lnorm_pd.mean_desc(), engine);
    auto variance_mem = memory(lnorm_pd.variance_desc(), engine);

but I am looking for C example?

 

Can be used for this: dnnl_primitive_desc_query_md(..., dnnl_query_workspace_md, 0) or something like this?

Thanks

-Laco.

0 Kudos
1 Solution
2 Replies
Ying_H_Intel
Moderator
5,787 Views

Hi Ladislav_K, 

Sorry for late response,  if convinent for you, please submit the issue to oneDNN github Issues · uxlfoundation/oneDNN

 

where oneDNN dev team will help you directly. 

 

thanks

0 Kudos
Reply