diff --git a/Jenkinsfile b/Jenkinsfile index c5ef87e5d6..5366809558 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,5 @@ #!groovy dependenciesRevision='b67325e72bcd5baa03886d87cac9afe6aea8cebd-1371' strategy='EQUAL' -allowedCD=221 +allowedCD=222 allowedF=11 diff --git a/README.md b/README.md index c25229b640..2ad181226f 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,35 @@ Directly linking to the runtime library (igdrcl) is not supported. The [Intel(R) GPU Compute Samples repository](https://github.com/intel/compute-samples/blob/master/compute_samples/applications/usm_hello_world/README.md) has sample source code to demonstrate features of Intel(R) Graphics Compute Runtime for OpenCL(TM) Driver. +## Feature double-precision emulation (FP64) + +By default NEO driver enables double precision operations only on platforms with supporting hardware. This is signified by exposing the "cl_khr_fp64" extension in the extension string. For other platforms, this support can be emulated by the compiler (IGC). + +### How do I enable emulation? + +FP64 emulation can only be enabled on Linux. There are two settings that have to be set. + +#### Runtime setting: + +There are two ways you can enable this feature in NEO: + +* Set an environment variable **OverrideDefaultFP64Settings** to **1**: +`OverrideDefaultFP64Settings=1` + +* In **igdrcl.config** configuration file in the same directory as application binary (you may have to create this file) add a line as such: +`OverrideDefaultFP64Settings = 1` + +#### Compiler setting: + +IGC reads flags only from environment, so set **IGC_EnableDPEmulation** to **1** as such: +`IGC_EnableDPEmulation=1` + +After both settings have been set you can run the application normally. + +### Known issues and limitations + +Intel does not claim full specification conformance when using emulated mode. We reserve the right to not fix issues that appear only in emulation mode. Performance degradation is to be expected and has not been measured by Intel. + ## How to provide feedback By default, please submit an issue using native github.com interface: https://github.com/intel/compute-runtime/issues. diff --git a/runtime/device/CMakeLists.txt b/runtime/device/CMakeLists.txt index 4d4aee6cf5..f426d82185 100644 --- a/runtime/device/CMakeLists.txt +++ b/runtime/device/CMakeLists.txt @@ -17,3 +17,5 @@ set(RUNTIME_SRCS_DEVICE ) target_sources(${NEO_STATIC_LIB_NAME} PRIVATE ${RUNTIME_SRCS_DEVICE}) set_property(GLOBAL PROPERTY RUNTIME_SRCS_DEVICE ${RUNTIME_SRCS_DEVICE}) + +add_subdirectories() diff --git a/runtime/device/device_caps.cpp b/runtime/device/device_caps.cpp index 35b9aa5153..48ae979b8f 100644 --- a/runtime/device/device_caps.cpp +++ b/runtime/device/device_caps.cpp @@ -42,9 +42,16 @@ static constexpr cl_device_fp_config defaultFpFlags = static_cast(CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT); + deviceInfo.doubleFpConfig = defaultFpFlags; + } else if (DebugManager.flags.OverrideDefaultFP64Settings.get() == -1) { if (hwInfo.capabilityTable.ftrSupportsFP64) { deviceExtensions += "cl_khr_fp64 "; } @@ -57,12 +64,6 @@ void Device::setupFp64Flags() { deviceInfo.doubleFpConfig = hwInfo.capabilityTable.ftrSupportsFP64 ? defaultFpFlags : 0; - } else { - if (DebugManager.flags.OverrideDefaultFP64Settings.get() == 1) { - deviceExtensions += "cl_khr_fp64 "; - deviceInfo.singleFpConfig = static_cast(CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT); - deviceInfo.doubleFpConfig = defaultFpFlags; - } } } diff --git a/runtime/device/linux/CMakeLists.txt b/runtime/device/linux/CMakeLists.txt new file mode 100644 index 0000000000..7148717cc5 --- /dev/null +++ b/runtime/device/linux/CMakeLists.txt @@ -0,0 +1,15 @@ +# +# Copyright (C) 2020 Intel Corporation +# +# SPDX-License-Identifier: MIT +# + +set(RUNTIME_SRCS_DEVICE_LINUX + ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt + ${CMAKE_CURRENT_SOURCE_DIR}/fp64_override.cpp +) +if(UNIX) + target_sources(${NEO_STATIC_LIB_NAME} PRIVATE ${RUNTIME_SRCS_DEVICE_LINUX}) +endif() + +set_property(GLOBAL PROPERTY RUNTIME_SRCS_DEVICE_LINUX ${RUNTIME_SRCS_DEVICE_LINUX}) \ No newline at end of file diff --git a/runtime/device/linux/fp64_override.cpp b/runtime/device/linux/fp64_override.cpp new file mode 100644 index 0000000000..7436266b05 --- /dev/null +++ b/runtime/device/linux/fp64_override.cpp @@ -0,0 +1,18 @@ +/* + * Copyright (C) 2020 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "core/utilities/debug_settings_reader_creator.h" +#include "runtime/os_interface/ocl_reg_path.h" + +namespace NEO { + +bool releaseFP64Override() { + auto settingsReader = SettingsReaderCreator::create(oclRegPath); + return settingsReader->getSetting("OverrideDefaultFP64Settings", -1) == 1; +} + +} // namespace NEO diff --git a/runtime/device/windows/CMakeLists.txt b/runtime/device/windows/CMakeLists.txt new file mode 100644 index 0000000000..7b2267a3b8 --- /dev/null +++ b/runtime/device/windows/CMakeLists.txt @@ -0,0 +1,15 @@ +# +# Copyright (C) 2020 Intel Corporation +# +# SPDX-License-Identifier: MIT +# + +set(RUNTIME_SRCS_DEVICE_WINDOWS + ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt + ${CMAKE_CURRENT_SOURCE_DIR}/fp64_override.cpp +) +if(WIN32) + target_sources(${NEO_STATIC_LIB_NAME} PRIVATE ${RUNTIME_SRCS_DEVICE_WINDOWS}) +endif() + +set_property(GLOBAL PROPERTY RUNTIME_SRCS_DEVICE_WINDOWS ${RUNTIME_SRCS_DEVICE_WINDOWS}) \ No newline at end of file diff --git a/runtime/device/windows/fp64_override.cpp b/runtime/device/windows/fp64_override.cpp new file mode 100644 index 0000000000..1897b3a68b --- /dev/null +++ b/runtime/device/windows/fp64_override.cpp @@ -0,0 +1,14 @@ +/* + * Copyright (C) 2020 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +namespace NEO { + +bool releaseFP64Override() { + return false; +} + +} // namespace NEO