SWDEV-236178 - Fixing func_attributes that was over written on redesign.
Change-Id: I157913ae4fa4a3a149817e901f10475b7750188b
[ROCm/clr commit: 2f963728f7]
This commit is contained in:
@@ -141,11 +141,19 @@ hipError_t Function::getStatFuncAttr(hipFuncAttributes* func_attr, int deviceId)
|
||||
|
||||
amd::Kernel* kernel = dFunc_[deviceId]->kernel();
|
||||
const device::Kernel::WorkGroupInfo* wginfo = kernel->getDeviceKernel(*devices[deviceId])->workGroupInfo();
|
||||
func_attr->sharedSizeBytes = static_cast<int>(wginfo->localMemSize_);
|
||||
func_attr->binaryVersion = static_cast<int>(kernel->signature().version());
|
||||
func_attr->cacheModeCA = 0;
|
||||
func_attr->constSizeBytes = 0;
|
||||
func_attr->localSizeBytes = wginfo->privateMemSize_;
|
||||
func_attr->sharedSizeBytes = wginfo->localMemSize_;
|
||||
func_attr->maxDynamicSharedSizeBytes = wginfo->availableLDSSize_ - wginfo->localMemSize_;
|
||||
func_attr->maxThreadsPerBlock = wginfo->size_;
|
||||
func_attr->numRegs = wginfo->usedVGPRs_;
|
||||
func_attr->maxDynamicSharedSizeBytes = static_cast<int>(wginfo->availableLDSSize_
|
||||
- wginfo->localMemSize_);
|
||||
|
||||
func_attr->maxThreadsPerBlock = static_cast<int>(wginfo->size_);
|
||||
func_attr->numRegs = static_cast<int>(wginfo->usedVGPRs_);
|
||||
func_attr->preferredShmemCarveout = 0;
|
||||
func_attr->ptxVersion = 30;
|
||||
|
||||
|
||||
return hipSuccess;
|
||||
}
|
||||
|
||||
@@ -82,34 +82,6 @@ extern "C" hip::FatBinaryInfoType* __hipRegisterFatBinary(const void* data)
|
||||
return PlatformState::instance().addFatBinary(fbwrapper->binary);
|
||||
}
|
||||
|
||||
bool ihipGetFuncAttributes(const char* func_name, amd::Program* program, hipFuncAttributes* func_attr) {
|
||||
device::Program* dev_program
|
||||
= program->getDeviceProgram(*hip::getCurrentDevice()->devices()[0]);
|
||||
|
||||
const auto it = dev_program->kernels().find(std::string(func_name));
|
||||
if (it == dev_program->kernels().cend()) {
|
||||
DevLogPrintfError("Could not find the function %s \n", func_name);
|
||||
return false;
|
||||
}
|
||||
|
||||
const device::Kernel* kernel = it->second;
|
||||
const device::Kernel::WorkGroupInfo* wginfo = kernel->workGroupInfo();
|
||||
func_attr->sharedSizeBytes = static_cast<int>(wginfo->localMemSize_);
|
||||
func_attr->binaryVersion = static_cast<int>(kernel->signature().version());
|
||||
func_attr->cacheModeCA = 0;
|
||||
func_attr->constSizeBytes = 0;
|
||||
func_attr->localSizeBytes = wginfo->privateMemSize_;
|
||||
func_attr->maxDynamicSharedSizeBytes = static_cast<int>(wginfo->availableLDSSize_
|
||||
- wginfo->localMemSize_);
|
||||
|
||||
func_attr->maxThreadsPerBlock = static_cast<int>(wginfo->size_);
|
||||
func_attr->numRegs = static_cast<int>(wginfo->usedVGPRs_);
|
||||
func_attr->preferredShmemCarveout = 0;
|
||||
func_attr->ptxVersion = 30;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PlatformState::getShadowVarInfo(std::string var_name, hipModule_t hmod,
|
||||
void** var_addr, size_t* var_size) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user