SWDEV-465215 - hipFuncSetAttribute hipFuncGetAttributes fixes

Change-Id: I2151e4470d63918ff6b809a8fdeaae5bea5cc899


[ROCm/clr commit: c9955a1cea]
This commit is contained in:
Ajay
2024-06-04 12:53:52 -07:00
committato da Ajay GunaShekar
parent 343bdf3187
commit d7f4f778b3
6 ha cambiato i file con 54 aggiunte e 14 eliminazioni
+9 -9
Vedi File
@@ -183,21 +183,21 @@ hipError_t Function::getStatFuncAttr(hipFuncAttributes* func_attr, int deviceId)
const std::vector<amd::Device*>& devices = amd::Device::getDevices(CL_DEVICE_TYPE_GPU, false);
amd::Kernel* kernel = dFunc_[deviceId]->kernel();
const device::Kernel::WorkGroupInfo* wginfo = kernel->getDeviceKernel(*devices[deviceId])->workGroupInfo();
auto* device_handle = devices[deviceId];
const device::Kernel::WorkGroupInfo* wginfo =
kernel->getDeviceKernel(*device_handle)->workGroupInfo();
int binaryVersion = device_handle->isa().versionMajor() * 10 +
device_handle->isa().versionMinor();
func_attr->sharedSizeBytes = static_cast<int>(wginfo->localMemSize_);
func_attr->binaryVersion = static_cast<int>(kernel->signature().version());
func_attr->binaryVersion = binaryVersion;
func_attr->cacheModeCA = 0;
func_attr->constSizeBytes = 0;
func_attr->constSizeBytes = wginfo->constMemSize_ - 1;
func_attr->localSizeBytes = wginfo->privateMemSize_;
func_attr->maxDynamicSharedSizeBytes = static_cast<int>(wginfo->availableLDSSize_
- wginfo->localMemSize_);
func_attr->maxDynamicSharedSizeBytes = wginfo->maxDynamicSharedSizeBytes_;
func_attr->maxThreadsPerBlock = static_cast<int>(wginfo->size_);
func_attr->numRegs = static_cast<int>(wginfo->usedVGPRs_);
func_attr->preferredShmemCarveout = 0;
func_attr->ptxVersion = 30;
func_attr->ptxVersion = binaryVersion;
return hipSuccess;
}