SWDEV-464455 - Init Segment flags and check for valid segment before passing to hsa APIs for allocation.
Change-Id: Ibe640093acdb7856115b6a4109bcf010adf20353
This commit is contained in:
committad av
Karthik Jayaprakash
förälder
892071aeb2
incheckning
1590b39f9e
@@ -199,6 +199,7 @@ Device::Device(hsa_agent_t bkendDevice)
|
||||
system_kernarg_segment_.handle = 0;
|
||||
gpuvm_segment_.handle = 0;
|
||||
gpu_fine_grained_segment_.handle = 0;
|
||||
gpu_ext_fine_grained_segment_.handle = 0;
|
||||
prefetch_signal_.handle = 0;
|
||||
isXgmi_ = false;
|
||||
cache_state_ = Device::CacheState::kCacheStateInvalid;
|
||||
@@ -2360,8 +2361,11 @@ void Device::deviceVmemRelease(uint64_t mem_handle) const {
|
||||
|
||||
void* Device::deviceLocalAlloc(size_t size, bool atomics, bool pseudo_fine_grain,
|
||||
bool contiguous) const {
|
||||
const hsa_amd_memory_pool_t& pool = (pseudo_fine_grain) ? gpu_ext_fine_grained_segment_
|
||||
: (atomics) ? gpu_fine_grained_segment_ : gpuvm_segment_;
|
||||
|
||||
const hsa_amd_memory_pool_t& pool = (pseudo_fine_grain && gpu_ext_fine_grained_segment_.handle)
|
||||
? gpu_ext_fine_grained_segment_
|
||||
: (atomics && gpu_fine_grained_segment_.handle)
|
||||
? gpu_fine_grained_segment_ : gpuvm_segment_;
|
||||
|
||||
if (pool.handle == 0 || gpuvm_segment_max_alloc_ == 0) {
|
||||
DevLogPrintfError("Invalid argument, pool_handle: 0x%x , max_alloc: %u \n",
|
||||
|
||||
Referens i nytt ärende
Block a user