mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Move BuiltIns to ExecutionEnvironment
Change-Id: Ib2a1b82cc7858c898bb32820aad106a01d1325ad Signed-off-by: Maciej Dziuban <maciej.dziuban@intel.com>
This commit is contained in:
@ -29,6 +29,7 @@
|
||||
#include "runtime/memory_manager/memory_manager.h"
|
||||
#include "runtime/os_interface/device_factory.h"
|
||||
#include "runtime/os_interface/os_interface.h"
|
||||
#include "runtime/built_ins/built_ins.h"
|
||||
|
||||
namespace OCLRT {
|
||||
ExecutionEnvironment::ExecutionEnvironment() = default;
|
||||
@ -86,4 +87,13 @@ CompilerInterface *ExecutionEnvironment::getCompilerInterface() {
|
||||
}
|
||||
return this->compilerInterface.get();
|
||||
}
|
||||
BuiltIns *ExecutionEnvironment::getBuiltIns() {
|
||||
if (this->builtins.get() == nullptr) {
|
||||
std::lock_guard<std::mutex> autolock(this->mtx);
|
||||
if (this->builtins.get() == nullptr) {
|
||||
this->builtins = std::make_unique<BuiltIns>();
|
||||
}
|
||||
}
|
||||
return this->builtins.get();
|
||||
}
|
||||
} // namespace OCLRT
|
||||
|
@ -31,8 +31,10 @@ class CommandStreamReceiver;
|
||||
class MemoryManager;
|
||||
class SourceLevelDebugger;
|
||||
class CompilerInterface;
|
||||
class BuiltIns;
|
||||
struct HardwareInfo;
|
||||
class OSInterface;
|
||||
|
||||
class ExecutionEnvironment : public ReferenceTrackedObject<ExecutionEnvironment> {
|
||||
private:
|
||||
std::mutex mtx;
|
||||
@ -52,10 +54,12 @@ class ExecutionEnvironment : public ReferenceTrackedObject<ExecutionEnvironment>
|
||||
|
||||
GmmHelper *getGmmHelper() const;
|
||||
MOCKABLE_VIRTUAL CompilerInterface *getCompilerInterface();
|
||||
BuiltIns *getBuiltIns();
|
||||
|
||||
std::unique_ptr<OSInterface> osInterface;
|
||||
std::unique_ptr<MemoryManager> memoryManager;
|
||||
std::unique_ptr<CommandStreamReceiver> commandStreamReceiver;
|
||||
std::unique_ptr<BuiltIns> builtins;
|
||||
std::unique_ptr<CompilerInterface> compilerInterface;
|
||||
std::unique_ptr<SourceLevelDebugger> sourceLevelDebugger;
|
||||
};
|
||||
|
Reference in New Issue
Block a user