wsl/hsakmt: rename rocr_proxy to thunk_proxy
Signed-off-by: Longlong Yao <Longlong.Yao@amd.com> Part-of: <http://10.67.69.192/wsl/libhsakmt/-/merge_requests/26>
Этот коммит содержится в:
коммит произвёл
Frank Min
родитель
c6fe6807e8
Коммит
48395b2295
@@ -1,9 +1,9 @@
|
||||
#ifndef _ROCR_PROXY_H_
|
||||
#define _ROCR_PROXY_H_
|
||||
#ifndef _WSL_INC_THUNK_PROXY_H_
|
||||
#define _WSL_INC_THUNK_PROXY_H_
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace rocr_proxy {
|
||||
namespace thunk_proxy {
|
||||
enum AllocDomain {
|
||||
kSystem,
|
||||
kLocal,
|
||||
@@ -51,7 +51,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "inc/wddm/types.h"
|
||||
#include "inc/rocr_proxy/rocr_proxy.h"
|
||||
#include "inc/thunk_proxy/thunk_proxy.h"
|
||||
#include "inc/wddm/va_mgr.h"
|
||||
#include "inc/wddm/status.h"
|
||||
#include "inc/wddm/types.h"
|
||||
@@ -80,7 +80,7 @@ public:
|
||||
bool IsDgpu() { return device_info_.is_dgpu; }
|
||||
const char *ProductName() { return device_info_.product_name; }
|
||||
const char *Uuid() { return device_info_.uuid; }
|
||||
rocr_proxy::AsicFamilyType GfxFamily() { return device_info_.family; }
|
||||
thunk_proxy::AsicFamilyType GfxFamily() { return device_info_.family; }
|
||||
uint32_t DeviceId() { return device_info_.device_id; }
|
||||
uint32_t WavefrontSize() { return device_info_.wavefront_size; }
|
||||
uint32_t ComputeUnitCount() { return device_info_.compute_unit_count; }
|
||||
@@ -168,7 +168,7 @@ public:
|
||||
bool AllocUserQueueMemFromUMD(void) const { return false; }
|
||||
|
||||
bool IsHwsEnabled(int engine) {
|
||||
return rocr_proxy::GetHwsEnabled(engine, &device_info_);
|
||||
return thunk_proxy::GetHwsEnabled(engine, &device_info_);
|
||||
}
|
||||
|
||||
void UpdatePageFence(uint64_t fence_value);
|
||||
@@ -178,16 +178,16 @@ public:
|
||||
D3DKMT_HANDLE DeviceHandle() const { return device_; }
|
||||
LUID GetLuid() const { return adapter_luid_; }
|
||||
|
||||
const rocr_proxy::DeviceInfo& DeviceInfo() const { return device_info_; }
|
||||
const thunk_proxy::DeviceInfo& DeviceInfo() const { return device_info_; }
|
||||
|
||||
ErrorCode ReserveGpuVirtualAddress(rocr_proxy::AllocDomain domain,
|
||||
ErrorCode ReserveGpuVirtualAddress(thunk_proxy::AllocDomain domain,
|
||||
gpusize hit_base_addr,
|
||||
gpusize size,
|
||||
gpusize *out_gpu_virtual_addr,
|
||||
gpusize alignment,
|
||||
bool lock=false);
|
||||
|
||||
ErrorCode FreeGpuVirtualAddress(rocr_proxy::AllocDomain domain,
|
||||
ErrorCode FreeGpuVirtualAddress(thunk_proxy::AllocDomain domain,
|
||||
gpusize base_addr,
|
||||
gpusize size);
|
||||
|
||||
@@ -231,7 +231,7 @@ private:
|
||||
uint32_t cmdbuf_aql_frame_size_;
|
||||
static const uint32_t cmdbuf_aql_frame_num_;
|
||||
// device info
|
||||
rocr_proxy::DeviceInfo device_info_;
|
||||
thunk_proxy::DeviceInfo device_info_;
|
||||
|
||||
std::unique_ptr<VaMgr> local_va_mgr_;
|
||||
//CmdUtil cmd_util;
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
#include "util/utils.h"
|
||||
#include "inc/wddm/types.h"
|
||||
#include "inc/wddm/thunks.h"
|
||||
#include "inc/rocr_proxy/rocr_proxy.h"
|
||||
#include "inc/thunk_proxy/thunk_proxy.h"
|
||||
|
||||
namespace wsl {
|
||||
namespace thunk {
|
||||
@@ -69,7 +69,7 @@ union GpuMemoryCreateFlags {
|
||||
struct GpuMemoryCreateInfo {
|
||||
GpuMemoryCreateInfo() {
|
||||
flags.reserved = 0;
|
||||
domain = rocr_proxy::kLocal;
|
||||
domain = thunk_proxy::kLocal;
|
||||
size = 0;
|
||||
alignment = 0;
|
||||
mem_flags = 0;
|
||||
@@ -80,7 +80,7 @@ struct GpuMemoryCreateInfo {
|
||||
}
|
||||
|
||||
GpuMemoryCreateFlags flags;
|
||||
rocr_proxy::AllocDomain domain;
|
||||
thunk_proxy::AllocDomain domain;
|
||||
gpusize size;
|
||||
gpusize alignment;
|
||||
int mem_flags;
|
||||
@@ -102,7 +102,7 @@ struct GpuMemoryDesc {
|
||||
engine_flag = 0;
|
||||
}
|
||||
|
||||
rocr_proxy::AllocDomain domain;
|
||||
thunk_proxy::AllocDomain domain;
|
||||
LUID adapter_luid; // Where is the backing store location
|
||||
gpusize gpu_addr;
|
||||
void *cpu_addr;
|
||||
@@ -129,7 +129,7 @@ struct GpuMemoryDesc {
|
||||
};
|
||||
|
||||
struct SharedHandleInfo {
|
||||
rocr_proxy::AllocDomain domain;
|
||||
thunk_proxy::AllocDomain domain;
|
||||
LUID adapter_luid;
|
||||
gpusize client_size; // user request size
|
||||
uint64_t size;
|
||||
@@ -151,10 +151,10 @@ public:
|
||||
uint64_t GpuAddress() const { return desc_.gpu_addr; }
|
||||
void *CpuAddress() const { return desc_.cpu_addr; }
|
||||
|
||||
inline bool IsLocal() const { return desc_.domain == rocr_proxy::kLocal; }
|
||||
inline bool IsUserMemory() const { return desc_.domain == rocr_proxy::kUserMemory; }
|
||||
inline bool IsSystem() const { return desc_.domain == rocr_proxy::kSystem; }
|
||||
inline bool IsUserQueue() const { return desc_.domain == rocr_proxy::kUserQueue; }
|
||||
inline bool IsLocal() const { return desc_.domain == thunk_proxy::kLocal; }
|
||||
inline bool IsUserMemory() const { return desc_.domain == thunk_proxy::kUserMemory; }
|
||||
inline bool IsSystem() const { return desc_.domain == thunk_proxy::kSystem; }
|
||||
inline bool IsUserQueue() const { return desc_.domain == thunk_proxy::kUserQueue; }
|
||||
inline bool IsPhysicalOnly() const { return desc_.flags.is_physical_only; }
|
||||
inline bool IsVirtual() const { return desc_.flags.is_virtual; }
|
||||
inline bool IsShared() const { return desc_.flags.is_shared; }
|
||||
@@ -162,7 +162,7 @@ public:
|
||||
|
||||
inline uint32_t Flags() const { return desc_.flags.reserved; }
|
||||
inline int GetAllocInfo() const { return desc_.mem_flags; }
|
||||
inline bool IsFineGrain() const { return (desc_.mem_flags & rocr_proxy::kFineGrain); }
|
||||
inline bool IsFineGrain() const { return (desc_.mem_flags & thunk_proxy::kFineGrain); }
|
||||
inline bool IsSameAdapter(const LUID &luid) const {
|
||||
return (desc_.adapter_luid.HighPart == luid.HighPart &&
|
||||
desc_.adapter_luid.LowPart == luid.LowPart);
|
||||
|
||||
@@ -74,7 +74,7 @@ public:
|
||||
cmdbuf_size(cmdbuf_size),
|
||||
queue_engine(engine),
|
||||
use_hws(use_hws),
|
||||
prio(rocr_proxy::kNormal) {
|
||||
prio(thunk_proxy::kNormal) {
|
||||
|
||||
}
|
||||
|
||||
@@ -99,15 +99,15 @@ public:
|
||||
uint64_t *GetSyncAddr(void) const { return sync_addr; }
|
||||
uint64_t GetCmdbufAddr(void) const { return cmdbuf_addr; }
|
||||
|
||||
rocr_proxy::SchedLevel ConvertSchedLevel(hsa_amd_queue_priority_t prio) const {
|
||||
thunk_proxy::SchedLevel ConvertSchedLevel(hsa_amd_queue_priority_t prio) const {
|
||||
switch (prio) {
|
||||
case HSA_AMD_QUEUE_PRIORITY_LOW:
|
||||
return rocr_proxy::kLow;
|
||||
return thunk_proxy::kLow;
|
||||
case HSA_AMD_QUEUE_PRIORITY_HIGH:
|
||||
return rocr_proxy::kHigh;
|
||||
return thunk_proxy::kHigh;
|
||||
case HSA_AMD_QUEUE_PRIORITY_NORMAL:
|
||||
default:
|
||||
return rocr_proxy::kNormal;
|
||||
return thunk_proxy::kNormal;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ public:
|
||||
uint32_t queue_engine;
|
||||
|
||||
bool use_hws;
|
||||
rocr_proxy::SchedLevel prio;
|
||||
thunk_proxy::SchedLevel prio;
|
||||
};
|
||||
|
||||
class ComputeQueue : public WDDMQueue {
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
#include <cstdint>
|
||||
#include <ntstatus.h>
|
||||
#include "inc/rocr_proxy/wddm_types.h"
|
||||
#include "inc/thunk_proxy/wddm_types.h"
|
||||
// windows wchar is 16bit, but linux is 32bit
|
||||
// seems libdxcore (not dxgkrnl.ko) convert thunk windows wchar to linux one
|
||||
// so only accept 32bit wchar args. note driver private data structure still
|
||||
|
||||
+6
-6
@@ -144,17 +144,17 @@ HSAKMT_STATUS HSAKMTAPI hsaKmtAllocMemoryAlign(HSAuint32 PreferredNode,
|
||||
if (zfb_support && MemFlags.ui32.NonPaged == 1)
|
||||
MemFlags.ui32.CoarseGrain = 1;
|
||||
|
||||
create_info.domain = rocr_proxy::AllocDomain::kSystem;
|
||||
create_info.domain = thunk_proxy::AllocDomain::kSystem;
|
||||
} else {
|
||||
create_info.domain = rocr_proxy::AllocDomain::kLocal;
|
||||
create_info.domain = thunk_proxy::AllocDomain::kLocal;
|
||||
}
|
||||
|
||||
if (!MemFlags.ui32.CoarseGrain)
|
||||
create_info.mem_flags = rocr_proxy::kFineGrain;
|
||||
create_info.mem_flags = thunk_proxy::kFineGrain;
|
||||
|
||||
//In hsa-runtime, only kernarg region set Uncached.
|
||||
if (MemFlags.ui32.Uncached)
|
||||
create_info.mem_flags |= rocr_proxy::kKernarg;
|
||||
create_info.mem_flags |= thunk_proxy::kKernarg;
|
||||
|
||||
create_info.flags.physical_only = MemFlags.ui32.NoAddress;
|
||||
create_info.flags.interprocess = MemFlags.ui32.NoAddress;
|
||||
@@ -162,7 +162,7 @@ HSAKMT_STATUS HSAKMTAPI hsaKmtAllocMemoryAlign(HSAuint32 PreferredNode,
|
||||
create_info.flags.virtual_alloc = MemFlags.ui32.OnlyAddress;
|
||||
/*when only alloc virtual or only physical, it's vmm allocation, force to local*/
|
||||
if (create_info.flags.virtual_alloc || create_info.flags.physical_only)
|
||||
create_info.domain = rocr_proxy::AllocDomain::kLocal;
|
||||
create_info.domain = thunk_proxy::AllocDomain::kLocal;
|
||||
|
||||
auto code = dev->CreateGpuMemory(create_info, &gpu_mem);
|
||||
if (code == ErrorCode::Success) {
|
||||
@@ -444,7 +444,7 @@ HSAKMT_STATUS HSAKMTAPI hsaKmtMapMemoryToGPU(void *MemoryAddress,
|
||||
wsl::thunk::GpuMemoryHandle handle = 0;
|
||||
uint64_t addr;
|
||||
wsl::thunk::GpuMemoryCreateInfo create_info{};
|
||||
create_info.domain = rocr_proxy::kUserMemory;
|
||||
create_info.domain = thunk_proxy::kUserMemory;
|
||||
create_info.size = aligned_size;
|
||||
create_info.user_ptr = aligned_ptr;
|
||||
|
||||
|
||||
Двоичные данные
Двоичный файл не отображается.
Двоичные данные
Двоичный файл не отображается.
+27
-27
@@ -351,7 +351,7 @@ void WDDMDevice::SetPowerOptimization(bool restore) {
|
||||
void *priv_data;
|
||||
int priv_size;
|
||||
|
||||
priv_size = rocr_proxy::CreatePowerOptPrivData(&priv_data, restore);
|
||||
priv_size = thunk_proxy::CreatePowerOptPrivData(&priv_data, restore);
|
||||
|
||||
D3DKMT_ESCAPE d3dkmt_escape;
|
||||
memset(&d3dkmt_escape, 0, sizeof(d3dkmt_escape));
|
||||
@@ -366,16 +366,16 @@ void WDDMDevice::SetPowerOptimization(bool restore) {
|
||||
|
||||
NTSTATUS status = D3DKMTEscape(&d3dkmt_escape);
|
||||
debug_print("%s status %d restore %d\n", __FUNCTION__, status, restore);
|
||||
rocr_proxy::DestroyPrivData(priv_data);
|
||||
thunk_proxy::DestroyPrivData(priv_data);
|
||||
}
|
||||
|
||||
ErrorCode WDDMDevice::ReserveGpuVirtualAddress(const rocr_proxy::AllocDomain domain,
|
||||
ErrorCode WDDMDevice::ReserveGpuVirtualAddress(const thunk_proxy::AllocDomain domain,
|
||||
gpusize hit_base_addr, gpusize size,
|
||||
gpusize *out_gpu_virt_addr, gpusize alignment, bool lock) {
|
||||
gpusize gpu_addr = 0;
|
||||
ErrorCode code = ErrorCode::Success;
|
||||
|
||||
if (domain == rocr_proxy::kSystem) {
|
||||
if (domain == thunk_proxy::kSystem) {
|
||||
|
||||
code = d3dthunk::ReserveGpuVirtualAddress(adapter_, size,
|
||||
system_heap_space_start_,
|
||||
@@ -390,7 +390,7 @@ ErrorCode WDDMDevice::ReserveGpuVirtualAddress(const rocr_proxy::AllocDomain dom
|
||||
}
|
||||
} else {
|
||||
uint64_t align = alignment == 0 ? (64 * 1024) : alignment; // default 64K alignment
|
||||
if (domain == rocr_proxy::kLocal && size >= GPU_HUGE_PAGE_SIZE)
|
||||
if (domain == thunk_proxy::kLocal && size >= GPU_HUGE_PAGE_SIZE)
|
||||
align = GPU_HUGE_PAGE_SIZE;
|
||||
|
||||
gpu_addr = local_va_mgr_->Alloc(size, align, hit_base_addr);
|
||||
@@ -403,11 +403,11 @@ ErrorCode WDDMDevice::ReserveGpuVirtualAddress(const rocr_proxy::AllocDomain dom
|
||||
return code;
|
||||
}
|
||||
|
||||
ErrorCode WDDMDevice::FreeGpuVirtualAddress(const rocr_proxy::AllocDomain domain,
|
||||
ErrorCode WDDMDevice::FreeGpuVirtualAddress(const thunk_proxy::AllocDomain domain,
|
||||
gpusize gpu_addr, gpusize size) {
|
||||
auto code = ErrorCode::Success;
|
||||
|
||||
if (domain == rocr_proxy::kSystem) {
|
||||
if (domain == thunk_proxy::kSystem) {
|
||||
|
||||
DecommitSystemHeapSpace((void *)gpu_addr, size);
|
||||
|
||||
@@ -484,7 +484,7 @@ bool WDDMDevice::CreateContext(int engine, D3DKMT_HANDLE *handle) {
|
||||
return false;
|
||||
|
||||
bool FwManagedGfxState = SupportStateShadowingByCpFw();
|
||||
priv_size = rocr_proxy::CreateContextPrivData(&priv_data, FwManagedGfxState);
|
||||
priv_size = thunk_proxy::CreateContextPrivData(&priv_data, FwManagedGfxState);
|
||||
|
||||
D3DKMT_CREATECONTEXTVIRTUAL args = {0};
|
||||
args.hDevice = device_;
|
||||
@@ -497,16 +497,16 @@ bool WDDMDevice::CreateContext(int engine, D3DKMT_HANDLE *handle) {
|
||||
if (IsHwsEnabled(engine))
|
||||
args.Flags.HwQueueSupported = 1;
|
||||
else
|
||||
args.Flags.DisableGpuTimeout = rocr_proxy::ShouldDisableGpuTimeout(engine, &device_info_);
|
||||
args.Flags.DisableGpuTimeout = thunk_proxy::ShouldDisableGpuTimeout(engine, &device_info_);
|
||||
|
||||
NTSTATUS ret = D3DKMTCreateContextVirtual(&args);
|
||||
if (ret == STATUS_SUCCESS) {
|
||||
*handle = args.hContext;
|
||||
rocr_proxy::DestroyPrivData(priv_data);
|
||||
thunk_proxy::DestroyPrivData(priv_data);
|
||||
return true;
|
||||
}
|
||||
|
||||
rocr_proxy::DestroyPrivData(priv_data);
|
||||
thunk_proxy::DestroyPrivData(priv_data);
|
||||
|
||||
fprintf(stderr, "%s fail %x\n", __FUNCTION__, ret);
|
||||
return false;
|
||||
@@ -676,7 +676,7 @@ NTSTATUS WDDMGetAdapters(D3DKMT_ADAPTERINFO *&adapters, int &num_adapters)
|
||||
if (ret != STATUS_SUCCESS)
|
||||
goto err_out1;
|
||||
|
||||
supported = rocr_proxy::QueryAdapterSupported(info[i].hAdapter);
|
||||
supported = thunk_proxy::QueryAdapterSupported(info[i].hAdapter);
|
||||
|
||||
if (std::wcsstr(query.ChipType, L"AMD") && supported) {
|
||||
adapters[num_adapters++] = info[i];
|
||||
@@ -698,7 +698,7 @@ bool WDDMDevice::ParseDeviceInfo() {
|
||||
bool ret;
|
||||
|
||||
memset(&device_info_, 0, sizeof(device_info_));
|
||||
ret = rocr_proxy::ParseAdapterInfo(adapter_, &device_info_);
|
||||
ret = thunk_proxy::ParseAdapterInfo(adapter_, &device_info_);
|
||||
if (!ret)
|
||||
return false;
|
||||
|
||||
@@ -713,7 +713,7 @@ void WDDMDevice::GetClockCounters(uint64_t *gpu, uint64_t *cpu) {
|
||||
void *priv_data;
|
||||
int priv_size;
|
||||
|
||||
priv_size = rocr_proxy::CreateCalibratedTimestampsPrivData(&priv_data);
|
||||
priv_size = thunk_proxy::CreateCalibratedTimestampsPrivData(&priv_data);
|
||||
|
||||
D3DKMT_ESCAPE d3dkmt_escape;
|
||||
memset(&d3dkmt_escape, 0, sizeof(d3dkmt_escape));
|
||||
@@ -730,9 +730,9 @@ void WDDMDevice::GetClockCounters(uint64_t *gpu, uint64_t *cpu) {
|
||||
if (status) {
|
||||
debug_print("%s status %d \n", __FUNCTION__, status);
|
||||
} else {
|
||||
rocr_proxy::QueryCalibratedTimestamps(priv_data, gpu, cpu);
|
||||
thunk_proxy::QueryCalibratedTimestamps(priv_data, gpu, cpu);
|
||||
}
|
||||
rocr_proxy::DestroyPrivData(priv_data);
|
||||
thunk_proxy::DestroyPrivData(priv_data);
|
||||
}
|
||||
|
||||
bool WDDMDevice::CreateQueue(WDDMQueue *queue) {
|
||||
@@ -741,7 +741,7 @@ bool WDDMDevice::CreateQueue(WDDMQueue *queue) {
|
||||
|
||||
GpuMemoryCreateInfo create_info{};
|
||||
create_info.size = queue->cmdbuf_size;
|
||||
create_info.domain = rocr_proxy::kSystem;
|
||||
create_info.domain = thunk_proxy::kSystem;
|
||||
|
||||
GpuMemory *gpu_mem = nullptr;
|
||||
auto code = CreateGpuMemory(create_info, &gpu_mem);
|
||||
@@ -779,7 +779,7 @@ bool WDDMDevice::SubmitToSwQueue(WDDMQueue *queue, uint64_t command_addr,
|
||||
void *priv_data;
|
||||
int priv_size;
|
||||
|
||||
priv_size = rocr_proxy::CreateSubmitPrivData(&priv_data, queue->queue, command_addr, command_size, false);
|
||||
priv_size = thunk_proxy::CreateSubmitPrivData(&priv_data, queue->queue, command_addr, command_size, false);
|
||||
|
||||
D3DKMT_SUBMITCOMMAND args = {0};
|
||||
args.Commands = command_addr;
|
||||
@@ -792,11 +792,11 @@ bool WDDMDevice::SubmitToSwQueue(WDDMQueue *queue, uint64_t command_addr,
|
||||
NTSTATUS ret = D3DKMTSubmitCommand(&args);
|
||||
if (ret != STATUS_SUCCESS) {
|
||||
fprintf(stderr, "%s fail %x\n", __FUNCTION__, ret);
|
||||
rocr_proxy::DestroyPrivData(priv_data);
|
||||
thunk_proxy::DestroyPrivData(priv_data);
|
||||
return false;
|
||||
}
|
||||
|
||||
rocr_proxy::DestroyPrivData(priv_data);
|
||||
thunk_proxy::DestroyPrivData(priv_data);
|
||||
|
||||
if (!GpuSignal(queue->context, &queue->syncobj, &fence_value, 1))
|
||||
return false;
|
||||
@@ -809,23 +809,23 @@ bool WDDMDevice::CreateHwQueue(WDDMQueue *queue) {
|
||||
int priv_size;
|
||||
|
||||
bool FwManagedGfxState = SupportStateShadowingByCpFw();
|
||||
priv_size = rocr_proxy::CreateHwQueuePrivData(&priv_data, queue->context,
|
||||
priv_size = thunk_proxy::CreateHwQueuePrivData(&priv_data, queue->context,
|
||||
FwManagedGfxState, queue->prio);
|
||||
|
||||
D3DKMT_CREATEHWQUEUE createHwQueue = {0};
|
||||
createHwQueue.hHwContext = queue->context;
|
||||
createHwQueue.Flags.DisableGpuTimeout = rocr_proxy::ShouldDisableGpuTimeout(queue->queue_engine, &device_info_);
|
||||
createHwQueue.Flags.DisableGpuTimeout = thunk_proxy::ShouldDisableGpuTimeout(queue->queue_engine, &device_info_);
|
||||
createHwQueue.pPrivateDriverData = priv_data;
|
||||
createHwQueue.PrivateDriverDataSize = priv_size;
|
||||
|
||||
NTSTATUS ret = D3DKMTCreateHwQueue(&createHwQueue);
|
||||
if (ret != STATUS_SUCCESS) {
|
||||
fprintf(stderr, "%s fail %x\n", __FUNCTION__, ret);
|
||||
rocr_proxy::DestroyPrivData(priv_data);
|
||||
thunk_proxy::DestroyPrivData(priv_data);
|
||||
return false;
|
||||
}
|
||||
|
||||
rocr_proxy::DestroyPrivData(priv_data);
|
||||
thunk_proxy::DestroyPrivData(priv_data);
|
||||
|
||||
queue->queue = createHwQueue.hHwQueue;
|
||||
queue->syncobj = createHwQueue.hHwQueueProgressFence;
|
||||
@@ -853,7 +853,7 @@ bool WDDMDevice::SubmitToHwQueue(WDDMQueue *queue, uint64_t command_addr,
|
||||
void *priv_data;
|
||||
int priv_size;
|
||||
|
||||
priv_size = rocr_proxy::CreateSubmitPrivData(&priv_data, queue->queue, command_addr, command_size, true);
|
||||
priv_size = thunk_proxy::CreateSubmitPrivData(&priv_data, queue->queue, command_addr, command_size, true);
|
||||
|
||||
D3DKMT_SUBMITCOMMANDTOHWQUEUE args = {0};
|
||||
args.hHwQueue = queue->queue;
|
||||
@@ -866,11 +866,11 @@ bool WDDMDevice::SubmitToHwQueue(WDDMQueue *queue, uint64_t command_addr,
|
||||
NTSTATUS ret = D3DKMTSubmitCommandToHwQueue(&args);
|
||||
if (ret != STATUS_SUCCESS) {
|
||||
fprintf(stderr, "%s fail %x\n", __FUNCTION__, ret);
|
||||
rocr_proxy::DestroyPrivData(priv_data);
|
||||
thunk_proxy::DestroyPrivData(priv_data);
|
||||
return false;
|
||||
}
|
||||
|
||||
rocr_proxy::DestroyPrivData(priv_data);
|
||||
thunk_proxy::DestroyPrivData(priv_data);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ size_t GpuMemory::CalcChunkNumbers(gpusize size) {
|
||||
gpusize GpuMemory::AdjustSize(gpusize size) const {
|
||||
const auto &device_info = device_->DeviceInfo();
|
||||
|
||||
if (device_info.enable_big_page_alignment && desc_.domain == rocr_proxy::kLocal) {
|
||||
if (device_info.enable_big_page_alignment && desc_.domain == thunk_proxy::kLocal) {
|
||||
uint32_t alignment = device_info.big_page_alignment_size;
|
||||
// BigPage is only supported for allocations > bigPageMinAlignment.
|
||||
// Also, if bigPageMinAlignment == 0, BigPage optimization is not supported per KMD.
|
||||
@@ -259,7 +259,7 @@ ErrorCode GpuMemory::CreatePhysicalMemory() {
|
||||
int priv_drv_data_size;
|
||||
int alloc_priv_data_size;
|
||||
|
||||
if (!rocr_proxy::CreatePrivateAllocInfo(NumChunks(), &priv_drv_data, &alloc_priv,
|
||||
if (!thunk_proxy::CreatePrivateAllocInfo(NumChunks(), &priv_drv_data, &alloc_priv,
|
||||
&priv_drv_data_size, &alloc_priv_data_size))
|
||||
return ErrorCode::OutOfMemory;
|
||||
|
||||
@@ -277,11 +277,11 @@ ErrorCode GpuMemory::CreatePhysicalMemory() {
|
||||
size_t block_size = std::min(size, WDDMDevice::GpuMemoryChunkSize);
|
||||
|
||||
if (IsUserMemory() || IsSystem()) {
|
||||
rocr_proxy::SetAllocationInfo(priv_data, block_size, desc_.domain, 0, desc_.mem_flags, desc_.engine_flag, device_info);
|
||||
thunk_proxy::SetAllocationInfo(priv_data, block_size, desc_.domain, 0, desc_.mem_flags, desc_.engine_flag, device_info);
|
||||
alloc_info[i].pSystemMem = static_cast<void *>(cpu_addr);
|
||||
cpu_addr += block_size;
|
||||
} else {
|
||||
rocr_proxy::SetAllocationInfo(priv_data, block_size, desc_.domain, addr, desc_.mem_flags, desc_.engine_flag, device_info);
|
||||
thunk_proxy::SetAllocationInfo(priv_data, block_size, desc_.domain, addr, desc_.mem_flags, desc_.engine_flag, device_info);
|
||||
}
|
||||
|
||||
size -= block_size;
|
||||
@@ -321,7 +321,7 @@ ErrorCode GpuMemory::CreatePhysicalMemory() {
|
||||
|
||||
resource_ = args.hResource;
|
||||
}
|
||||
rocr_proxy::DestroyPrivateAllocInfo(priv_drv_data, alloc_priv);
|
||||
thunk_proxy::DestroyPrivateAllocInfo(priv_drv_data, alloc_priv);
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@@ -60,9 +60,9 @@ hsa_status_t WDDMQueue::SwsInit(void) {
|
||||
GpuMemory *gpu_mem = nullptr;
|
||||
GpuMemoryCreateInfo create_info{};
|
||||
|
||||
create_info.domain = rocr_proxy::kUserQueue;
|
||||
create_info.domain = thunk_proxy::kUserQueue;
|
||||
create_info.size = device->GetSwsQueueSize();
|
||||
create_info.engine_flag = rocr_proxy::QueueEngine2EngineFlag(queue_engine);
|
||||
create_info.engine_flag = thunk_proxy::QueueEngine2EngineFlag(queue_engine);
|
||||
|
||||
auto code = device->CreateGpuMemory(create_info, &gpu_mem);
|
||||
if (code != ErrorCode::Success) {
|
||||
@@ -119,7 +119,7 @@ hsa_status_t WDDMQueue::SetPriority(hsa_amd_queue_priority_t priority) {
|
||||
if (!use_hws)
|
||||
return HSA_STATUS_SUCCESS;
|
||||
|
||||
rocr_proxy::SchedLevel new_prio = ConvertSchedLevel(priority);
|
||||
thunk_proxy::SchedLevel new_prio = ConvertSchedLevel(priority);
|
||||
if (prio == new_prio)
|
||||
return HSA_STATUS_SUCCESS;
|
||||
|
||||
@@ -246,7 +246,7 @@ ComputeQueue::ComputeQueue(WDDMDevice *device,
|
||||
|
||||
GpuMemoryCreateInfo create_info{};
|
||||
create_info.size = PAGE_SIZE;
|
||||
create_info.domain = rocr_proxy::kSystem;
|
||||
create_info.domain = thunk_proxy::kSystem;
|
||||
GpuMemory *gpu_mem = nullptr;
|
||||
auto code = device->CreateGpuMemory(create_info, &gpu_mem);
|
||||
assert(code == ErrorCode::Success);
|
||||
@@ -436,7 +436,7 @@ bool ComputeQueue::UpdateScratch(uint32_t private_segment_size, bool wave32) {
|
||||
|
||||
GpuMemoryCreateInfo create_info{};
|
||||
create_info.size = scratch_size;
|
||||
create_info.domain = rocr_proxy::kLocal;
|
||||
create_info.domain = thunk_proxy::kLocal;
|
||||
GpuMemory *gpu_mem = nullptr;
|
||||
auto code = device->CreateGpuMemory(create_info, &gpu_mem);
|
||||
if (code != ErrorCode::Success)
|
||||
|
||||
Ссылка в новой задаче
Block a user