9 #ifndef TALVOS_DEVICE_H
10 #define TALVOS_DEVICE_H
12 #include <condition_variable>
24 class PipelineExecutor;
56 void reportError(
const std::string &Error,
bool Fatal =
false);
61 uint64_t NumBytes, uint32_t Opcode, uint32_t Scope,
85 bool waitForFences(
const std::vector<const bool *> &Fences,
bool WaitAll,
86 uint64_t Timeout)
const;
92 std::vector<std::pair<void *, Plugin *>>
Plugins;
void reportError(const std::string &Error, bool Fatal=false)
Report an error that has occurred during emulation.
void notifyFenceSignaled()
Notify the device that a fence was signaled.
std::vector< std::pair< void *, Plugin * > > Plugins
List of plugins that are currently loaded.
void reportMemoryMap(const Memory *Mem, uint64_t Base, uint64_t Offset, uint64_t NumBytes)
void reportInvocationComplete(const Invocation *Invoc)
void reportWorkgroupComplete(const Workgroup *Group)
std::condition_variable FenceSignaled
Condition variable to notify threads waiting on fence signals.
This class is a base class for all commands.
This class represents a single execution of a SPIR-V entry point.
PipelineExecutor * Executor
The pipeline executor instance.
Memory * GlobalMemory
The global memory of this device.
size_t MaxErrors
The maximum number of errors to report.
void reportCommandBegin(const Command *Cmd)
This class represents an address space in the virtual device.
An internal class that handles pipeline execution, including the interactive debugger.
bool waitForFences(const std::vector< const bool * > &Fences, bool WaitAll, uint64_t Timeout) const
Wait for fences to signal.
void reportWorkgroupBarrier(const Workgroup *Group)
std::mutex FenceMutex
A mutex for synchronizing threads waiting on fence signals.
A Device instance encapsulates properties and state for the virtual device.
This class represents a workgroup executing a compute command.
void reportInvocationBegin(const Invocation *Invoc)
void reportMemoryStore(const Memory *Mem, uint64_t Address, uint64_t NumBytes, const uint8_t *Data)
PipelineExecutor & getPipelineExecutor()
Returns the PipelineExecutor for this device.
Memory & getGlobalMemory()
Get the global memory instance associated with this device.
void reportAtomicAccess(const Memory *Mem, uint64_t Address, uint64_t NumBytes, uint32_t Opcode, uint32_t Scope, uint32_t Semantics)
bool isThreadSafe() const
Returns true if all of the loaded plugins are thread-safe.
Device & operator=(const Device &)=delete
void reportCommandComplete(const Command *Cmd)
void reportMemoryLoad(const Memory *Mem, uint64_t Address, uint64_t NumBytes)
This class represents a SPIR-V instruction.
void reportWorkgroupBegin(const Workgroup *Group)
void reportMemoryUnmap(const Memory *Mem, uint64_t Base)
void reportInstructionExecuted(const Invocation *Invoc, const Instruction *Inst)