From 14824f1dff68608446777a1ad45fafcd7c063c7a Mon Sep 17 00:00:00 2001 From: "Zdunowski, Piotr" Date: Mon, 25 Mar 2019 12:44:40 +0100 Subject: [PATCH] Add support for device specific extensions. Change-Id: I3ffd125875067b00bc225556c09fbe2d02f11022 Signed-off-by: Zdunowski, Piotr --- runtime/device/device_caps.cpp | 2 ++ runtime/helpers/hw_helper.h | 4 ++++ runtime/helpers/hw_helper_common.inl | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/runtime/device/device_caps.cpp b/runtime/device/device_caps.cpp index 1318296b4c..5737df2982 100644 --- a/runtime/device/device_caps.cpp +++ b/runtime/device/device_caps.cpp @@ -159,6 +159,8 @@ void Device::initializeCaps() { simultaneousInterops = {0}; appendOSExtensions(deviceExtensions); + deviceExtensions += hwHelper.getExtensions(); + deviceInfo.deviceExtensions = deviceExtensions.c_str(); exposedBuiltinKernels = builtInKernels; diff --git a/runtime/helpers/hw_helper.h b/runtime/helpers/hw_helper.h index 4dda140572..f0800299a9 100644 --- a/runtime/helpers/hw_helper.h +++ b/runtime/helpers/hw_helper.h @@ -14,6 +14,7 @@ #include "CL/cl.h" #include +#include #include namespace OCLRT { @@ -59,6 +60,7 @@ class HwHelper { virtual size_t getScratchSpaceOffsetFor64bit() = 0; virtual const std::vector getGpgpuEngineInstances() const = 0; virtual bool getEnableLocalMemory(const HardwareInfo &hwInfo) const = 0; + virtual std::string getExtensions() const = 0; static constexpr uint32_t lowPriorityGpgpuEngineIndex = 1; @@ -146,6 +148,8 @@ class HwHelperHw : public HwHelper { bool getEnableLocalMemory(const HardwareInfo &hwInfo) const override; + std::string getExtensions() const override; + protected: HwHelperHw() = default; }; diff --git a/runtime/helpers/hw_helper_common.inl b/runtime/helpers/hw_helper_common.inl index ca7830476f..aa0b8f1f14 100644 --- a/runtime/helpers/hw_helper_common.inl +++ b/runtime/helpers/hw_helper_common.inl @@ -185,6 +185,11 @@ bool HwHelperHw::getEnableLocalMemory(const HardwareInfo &hwInfo) const return OSInterface::osEnableLocalMemory && isLocalMemoryEnabled(hwInfo); } +template +std::string HwHelperHw::getExtensions() const { + return ""; +} + template typename Family::PIPE_CONTROL *PipeControlHelper::obtainPipeControlAndProgramPostSyncOperation(LinearStream *commandStream, POST_SYNC_OPERATION operation,