SWDEV-305894 - Cooperative groups grid and multi grid sync support for gfx940+

Change-Id: I35d72f1cb50c3a96eee56a612b72d641852b145f


[ROCm/clr commit: 5d7f3f9f3c]
This commit is contained in:
Sourabh Betigeri
2022-11-30 19:59:34 +00:00
committed by Sourabh Betigeri
parent 40956fe9a7
commit 7aa958a8f7
6 changed files with 51 additions and 22 deletions
+3
View File
@@ -428,6 +428,9 @@ NDRangeKernelCommand::NDRangeKernelCommand(HostQueue& queue, const EventWaitList
auto devKernel = const_cast<device::Kernel*>(kernel.getDeviceKernel(device));
profilingInfo_.setCallback(devKernel->getProfilingCallback(
queue.vdev()), devKernel->getWavesPerSH(queue.vdev()));
if (cooperativeGroups()) {
setNumWorkgroups();
}
if (forceProfiling) {
profilingInfo_.enabled_ = true;
profilingInfo_.clear();
+15 -1
View File
@@ -1050,7 +1050,8 @@ class NDRangeKernelCommand : public Command {
uint32_t numGrids_; //!< Total number of grids in multi GPU launch
uint64_t prevGridSum_; //!< A sum of previous grids to the current launch
uint64_t allGridSum_; //!< A sum of all grids in multi GPU launch
uint32_t firstDevice_; //!< Device index of the first device in the grid
uint32_t firstDevice_; //!< Device index of the first device in the gridc
uint32_t numWorkgroups_; //!< Total number of workgroups in the current launch
public:
enum {
@@ -1118,9 +1119,22 @@ class NDRangeKernelCommand : public Command {
//! Return the index of the first device in multi GPU launch
uint64_t firstDevice() const { return firstDevice_; }
uint32_t numWorkgroups() const { return numWorkgroups_; }
//! Set the local work size.
void setLocalWorkSize(const NDRange& local) { sizes_.local() = local; }
//! Set the number of workgroups
void setNumWorkgroups() {
uint32_t numWorkgroups = 1;
for (uint i = 0; i < sizes().dimensions(); i++) {
if (sizes().local()[i] != 0) {
numWorkgroups *= (sizes().global()[i] / sizes().local()[i]);
}
}
numWorkgroups_ = numWorkgroups;
}
int32_t captureAndValidate();
};