Add pointer info support.

Change-Id: I3edcc0bfddbf12465065c9bc3b6565288faff1b8
This commit is contained in:
Sean Keely
2016-11-09 22:21:24 -06:00
parent e01c43578c
commit 9dd76dbeda
10 ha cambiato i file con 279 aggiunte e 26 eliminazioni
+17 -2
Vedi File
@@ -70,6 +70,11 @@
#define HSA_QUEUE_ALIGN_BYTES 64
#define HSA_PACKET_ALIGN_BYTES 64
//Avoids include
namespace amd {
class MemoryRegion;
}
namespace core {
extern bool g_use_interrupt_wait;
@@ -84,6 +89,7 @@ extern bool g_use_interrupt_wait;
/// - maintain loader state.
/// - monitor asynchronous event from agent.
class Runtime {
friend class amd::MemoryRegion;
public:
/// @brief Structure to describe connectivity between agents.
struct LinkInfo {
@@ -258,11 +264,15 @@ class Runtime {
hsa_status_t InteropUnmap(void* ptr);
hsa_status_t PtrInfo(void* ptr, hsa_amd_pointer_info_t* info, void* (*alloc)(size_t),
uint32_t* num_agents_accessible, hsa_agent_t** accessible);
hsa_status_t SetPtrInfoData(void* ptr, void* userptr);
const std::vector<Agent*>& cpu_agents() { return cpu_agents_; }
const std::vector<Agent*>& gpu_agents() { return gpu_agents_; }
const std::vector<uint32_t>& gpu_ids() { return gpu_ids_; }
Agent* blit_agent() { return blit_agent_; }
@@ -399,7 +409,9 @@ class Runtime {
// Mutex object to protect multithreaded access to ::Acquire and ::Release.
KernelMutex kernel_lock_;
// Mutex object to protect multithreaded access to ::allocation_map_.
// Mutex object to protect multithreaded access to ::allocation_map_,
// KFD map/unmap, register/unregister, and access to hsaKmtQueryPointerInfo
// registered & mapped arrays.
KernelMutex memory_lock_;
// Array containing tools library handles.
@@ -411,6 +423,9 @@ class Runtime {
// Agent list containing all compatible GPU agents in the platform.
std::vector<Agent*> gpu_agents_;
// Agent map containing all agents indexed by their KFD node IDs.
std::map<uint32_t, std::vector<Agent*> > agents_by_node_;
// Agent list containing all compatible gpu agent ids in the platform.
std::vector<uint32_t> gpu_ids_;