P4 to Git Change 1360479 by rerrabol@RocmOnLC on 2017/01/10 17:32:55
SWDEV-108854 - Support initialization of SGPR and VGPR usage from kernel header object. Changes to fix issue reported by SWDEV-108854
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.cpp#33 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rockernel.cpp#18 edit
[ROCm/clr commit: a3c0b6525f]
This commit is contained in:
@@ -865,9 +865,23 @@ bool Kernel::init()
|
||||
workGroupInfo_.privateMemSize_ = workitemPrivateSegmentByteSize_;
|
||||
workGroupInfo_.usedLDSSize_ = workgroupGroupSegmentByteSize_;
|
||||
workGroupInfo_.preferredSizeMultiple_ = wavefront_size;
|
||||
workGroupInfo_.usedSGPRs_ = 0;
|
||||
|
||||
// Query kernel header object to initialize the number of
|
||||
// SGPR's and VGPR's used by the kernel
|
||||
const void* kernelHostPtr = nullptr;
|
||||
if (Device::loaderQueryHostAddress(
|
||||
reinterpret_cast<const void*>(kernelCodeHandle_), &kernelHostPtr
|
||||
) == HSA_STATUS_SUCCESS) {
|
||||
auto akc = reinterpret_cast<const amd_kernel_code_t*>(kernelHostPtr);
|
||||
workGroupInfo_.usedSGPRs_ = akc->wavefront_sgpr_count;
|
||||
workGroupInfo_.usedVGPRs_ = akc->workitem_vgpr_count;
|
||||
}
|
||||
else {
|
||||
workGroupInfo_.usedSGPRs_ = 0;
|
||||
workGroupInfo_.usedVGPRs_ = 0;
|
||||
}
|
||||
|
||||
workGroupInfo_.usedStackSize_ = 0;
|
||||
workGroupInfo_.usedVGPRs_ = 0;
|
||||
workGroupInfo_.wavefrontPerSIMD_ =
|
||||
program_->dev().info().maxWorkItemSizes_[0] / wavefront_size;
|
||||
workGroupInfo_.wavefrontSize_ = wavefront_size;
|
||||
|
||||
Reference in New Issue
Block a user