Skip to content

Commit

Permalink
include: Add missing DNNL_EXPERIMENTAL_UKERNEL ifdef
Browse files Browse the repository at this point in the history
Add a missing `#ifdef DNNL_EXPERIMENTAL_UKERNEL` around `dnnl_api_utils`
group.  The templates inside that group reference `dnnl_brgemm_t`
and `dnnl_brgemm_pack_B_t` types that are guarded using the same
condition, and therefore attempting to include the file without the
define results in errors:

```
/home/mgorny/miniforge3/envs/pytorch/include/oneapi/dnnl/dnnl_ukernel.hpp:38:22: error: ‘dnnl_brgemm_t’ was not declared in this scope; did you mean ‘dnnl_stream_t’?
   38 | struct handle_traits<dnnl_brgemm_t> {
      |                      ^~~~~~~~~~~~~
      |                      dnnl_stream_t
/home/mgorny/miniforge3/envs/pytorch/include/oneapi/dnnl/dnnl_ukernel.hpp:38:35: error: template argument 1 is invalid
   38 | struct handle_traits<dnnl_brgemm_t> {
      |                                   ^
/home/mgorny/miniforge3/envs/pytorch/include/oneapi/dnnl/dnnl_ukernel.hpp:45:22: error: ‘dnnl_brgemm_pack_B_t’ was not declared in this scope
   45 | struct handle_traits<dnnl_brgemm_pack_B_t> {
      |                      ^~~~~~~~~~~~~~~~~~~~
/home/mgorny/miniforge3/envs/pytorch/include/oneapi/dnnl/dnnl_ukernel.hpp:45:42: error: template argument 1 is invalid
   45 | struct handle_traits<dnnl_brgemm_pack_B_t> {
      |                                          ^
```
  • Loading branch information
mgorny authored and vpirogov committed Nov 13, 2024
1 parent 956a23e commit 79a4131
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/oneapi/dnnl/dnnl_ukernel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
/// oneDNN namespace
namespace dnnl {

#ifdef DNNL_EXPERIMENTAL_UKERNEL

/// @addtogroup dnnl_api_utils
/// @{

Expand Down Expand Up @@ -59,6 +61,8 @@ struct handle_traits<dnnl_ukernel_attr_params_t> {

/// @} dnnl_api_utils

#endif

/// @addtogroup dnnl_api_ukernel Ukernels
/// Collection of ukernels
/// @{
Expand Down

0 comments on commit 79a4131

Please sign in to comment.