File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change
1
+ include (CheckSymbolExists)
1
2
# Find OneDNN ukernel library
2
3
find_package (dnnl CONFIG)
3
4
if (dnnl_FOUND)
4
- message (STATUS "Found OneDNN/DNNL" )
5
- add_compile_definitions (ONEDNN_AVAILABLE)
6
5
get_target_property (dnnl_include DNNL::dnnl INTERFACE_INCLUDE_DIRECTORIES )
7
6
# currently used only in triton_cpu.cc and in ConvertDotToOneDNN
8
7
include_directories (${dnnl_include} )
8
+ set (dnnl_header ${dnnl_include} /oneapi/dnnl/dnnl_config.h)
9
+ check_symbol_exists(DNNL_EXPERIMENTAL_UKERNEL ${dnnl_header} HAS_UKERNELS)
10
+ if (HAS_UKERNELS)
11
+ message (STATUS "Found OneDNN/DNNL with Ukernels support" )
12
+ add_compile_definitions (ONEDNN_AVAILABLE)
13
+ else ()
14
+ message (STATUS "SKIPPING found OneDNN/DNNL because Ukernels support is missing" )
15
+ endif ()
9
16
else ()
10
17
message (STATUS "Could NOT find OneDNN/DNNL" )
11
18
endif ()
@@ -40,7 +47,7 @@ endif()
40
47
# Configure and build Triton-CPU runtime
41
48
set (TRITON_CPU_RUNTIME_SOURCES ${CMAKE_CURRENT_SOURCE_DIR} /runtime/cpu_runtime.cpp)
42
49
set (TRITON_CPU_RUNTIME_LIBS LLVMSupport)
43
- if (dnnl_FOUND)
50
+ if (dnnl_FOUND AND HAS_UKERNELS )
44
51
set (TRITON_CPU_RUNTIME_SOURCES ${TRITON_CPU_RUNTIME_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR} /runtime/runtime_onednn.cpp)
45
52
set (TRITON_CPU_RUNTIME_LIBS ${TRITON_CPU_RUNTIME_LIBS} DNNL::dnnl)
46
53
endif ()
Original file line number Diff line number Diff line change 3
3
#include " oneapi/dnnl/dnnl_ukernel.hpp"
4
4
#include " oneapi/dnnl/dnnl_ukernel_types.h"
5
5
#if !defined(DNNL_EXPERIMENTAL_UKERNEL)
6
- #error "DNNL Ukerenel ismissing "
6
+ #error "DNNL Ukerenel is missing "
7
7
#endif
8
8
#endif
9
9
You can’t perform that action at this time.
0 commit comments