mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 14:02:58 +08:00
Check if storage registry exists
Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
524d945e8c
commit
b2c26dde65
@@ -212,6 +212,10 @@ Kernel *BuiltinFunctionsLibImpl::getImageFunction(ImageBuiltin func) {
|
||||
std::unique_ptr<BuiltinFunctionsLibImpl::BuiltinData> BuiltinFunctionsLibImpl::loadBuiltIn(NEO::EBuiltInOps::Type builtin, const char *builtInName) {
|
||||
using BuiltInCodeType = NEO::BuiltinCode::ECodeType;
|
||||
|
||||
if (!NEO::EmbeddedStorageRegistry::exists) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
StackVec<BuiltInCodeType, 2> supportedTypes{};
|
||||
if (!NEO::DebugManager.flags.RebuildPrecompiledKernels.get()) {
|
||||
supportedTypes.push_back(BuiltInCodeType::Binary);
|
||||
|
||||
@@ -98,6 +98,8 @@ class FileStorage : public Storage {
|
||||
};
|
||||
|
||||
struct EmbeddedStorageRegistry {
|
||||
inline static bool exists = false;
|
||||
|
||||
static EmbeddedStorageRegistry &getInstance() {
|
||||
static EmbeddedStorageRegistry gsr;
|
||||
return gsr;
|
||||
@@ -109,6 +111,13 @@ struct EmbeddedStorageRegistry {
|
||||
|
||||
const BuiltinResourceT *get(const std::string &name) const;
|
||||
|
||||
EmbeddedStorageRegistry() {
|
||||
exists = true;
|
||||
}
|
||||
~EmbeddedStorageRegistry() {
|
||||
exists = false;
|
||||
}
|
||||
|
||||
private:
|
||||
using ResourcesContainer = std::unordered_map<std::string, BuiltinResourceT>;
|
||||
ResourcesContainer resources;
|
||||
|
||||
Reference in New Issue
Block a user