[][src]Function onednn_sys::dnnl_set_max_cpu_isa

pub unsafe extern "C" fn dnnl_set_max_cpu_isa(
    isa: dnnl_cpu_isa_t
) -> dnnl_status_t

Sets the maximal ISA the library can dispatch to on the CPU. See #dnnl_cpu_isa_t and #dnnl::cpu_isa for the list of the values accepted by the C and C++ API functions respectively.

This function has effect only before the first JIT kernel is generated and will return an error afterwards.

This function overrides the DNNL_MAX_CPU_ISA environment variable. The environment variable can be set to the desired maximal ISA name in upper case and with dnnl_cpu_isa prefix removed. For example: DNNL_MAX_CPU_ISA=AVX2.

@note The ISAs are only partially ordered: - SSE41 < AVX < AVX2, - AVX2 < AVX512_MIC < AVX512_MIC_4OPS, - AVX2 < AVX512_CORE < AVX512_CORE_VNNI < AVX512_CORE_BF16.

@sa @ref dev_guide_cpu_dispatcher_control for more details

@param isa Maximal ISA the library should dispatch to. Pass #dnnl_cpu_isa_all/#dnnl::cpu_isa::all to remove ISA restrictions. @returns #dnnl_success/#dnnl::status::success on success and a #dnnl_invalid_arguments/#dnnl::status::invalid_arguments if the @p isa parameter is invalid or the ISA cannot be changed at this time. @returns #dnnl_unimplemented/#dnnl::status::unimplemented if the feature was disabled at build time (see @ref dev_guide_build_options for more details).