Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gpu/ocl: Allow building out the ngen kernel support #2025

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cmake/configuring_primitive_list.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ message(STATUS "Enabled primitive CPU ISA: ${DNNL_ENABLE_PRIMITIVE_CPU_ISA}")

if (DNNL_ENABLE_PRIMITIVE_GPU_ISA STREQUAL "ALL")
set(BUILD_PRIMITIVE_GPU_ISA_ALL TRUE)
elseif(DNNL_ENABLE_PRIMITIVE_GPU_ISA STREQUAL "NONE")
set(BUILD_PRIMITIVE_GPU_ISA_NONE TRUE)
else()
foreach(isa ${DNNL_ENABLE_PRIMITIVE_GPU_ISA})
string(TOUPPER ${isa} uisa)
Expand Down
1 change: 1 addition & 0 deletions cmake/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ set(DNNL_ENABLE_PRIMITIVE_GPU_ISA "ALL" CACHE STRING
at build time. Regardless of value chosen, reference OpenCL-based
implementations will always be available. Valid values:
- ALL (the default). Includes all ISA to be enabled.
- NONE: Disables the ISA-specific implementations.
- <ISA_NAME>;<ISA_NAME>;... Includes only selected ISA to be enabled.
Possible values are: GEN9, GEN11, XELP, XEHP, XEHPG, XEHPC, XE2.")

Expand Down
2 changes: 1 addition & 1 deletion doc/build/build_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ oneDNN supports the following build-time options.
| ONEDNN_ENABLE_WORKLOAD | **TRAINING**, INFERENCE | Specifies a set of functionality to be available based on workload |
| ONEDNN_ENABLE_PRIMITIVE | **ALL**, PRIMITIVE_NAME | Specifies a set of functionality to be available based on primitives |
| ONEDNN_ENABLE_PRIMITIVE_CPU_ISA | **ALL**, CPU_ISA_NAME | Specifies a set of functionality to be available for CPU backend based on CPU ISA |
| ONEDNN_ENABLE_PRIMITIVE_GPU_ISA | **ALL**, GPU_ISA_NAME | Specifies a set of functionality to be available for GPU backend based on GPU ISA |
| ONEDNN_ENABLE_PRIMITIVE_GPU_ISA | **ALL**, NONE, GPU_ISA_NAME | Specifies a set of functionality to be available for GPU backend based on GPU ISA |
| ONEDNN_ENABLE_GEMM_KERNELS_ISA | **ALL**, NONE, ISA_NAME | Specifies a set of functionality to be available for GeMM kernels for CPU backend based on ISA |
| ONEDNN_EXPERIMENTAL | ON, **OFF** | Enables [experimental features](@ref dev_guide_experimental) |
| ONEDNN_VERBOSE | **ON**, OFF | Enables [verbose mode](@ref dev_guide_verbose) |
Expand Down
1 change: 1 addition & 0 deletions include/oneapi/dnnl/dnnl_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@
#cmakedefine01 BUILD_AMX
// Primitives GPU ISA controls
#cmakedefine01 BUILD_PRIMITIVE_GPU_ISA_ALL
#cmakedefine01 BUILD_PRIMITIVE_GPU_ISA_NONE
#cmakedefine01 BUILD_GEN9
#cmakedefine01 BUILD_GEN11
#cmakedefine01 BUILD_XELP
Expand Down
7 changes: 4 additions & 3 deletions src/gpu/intel/ocl/ocl_gpu_hw_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ void init_gpu_hw_info(impl::engine_t *engine, cl_device_id device,
assert(ret == CL_SUCCESS);
MAYBE_UNUSED(ret);

auto status
= jit::gpu_supports_binary_format(&mayiuse_ngen_kernels, engine);
if (status != status::success) mayiuse_ngen_kernels = false;
mayiuse_ngen_kernels = false;
#if !BUILD_PRIMITIVE_GPU_ISA_NONE
jit::gpu_supports_binary_format(&mayiuse_ngen_kernels, engine);
#endif

ip_version = 0;
if (clGetDeviceInfo(device, CL_DEVICE_IP_VERSION_INTEL, sizeof(ip_version),
Expand Down
Loading