SWDEV-184709 - support hipLaunchCooperativeKernel()
- Add validation checks for cooperative launch to pass Cuda test
Change-Id: Ie296f0c3f113909d9a357879db3b2a833ab314c5
[ROCm/hip commit: 7820018037]
Bu işleme şunda yer alıyor:
1 ebeveyn
8c63e2536d
işleme
e55b231bb1
3 files changed
+128
-52
No files matched your search
@@ -25,6 +25,7 @@
|
||||
#include "hip_internal.hpp"
|
||||
#include "platform/program.hpp"
|
||||
#include "hip_event.hpp"
|
||||
#include "hip_platform.hpp"
|
||||
|
||||
hipError_t ihipModuleLoadData(hipModule_t *module, const void *image);
|
||||
|
||||
@@ -294,9 +295,23 @@ hipError_t ihipModuleLaunchKernel(hipFunction_t f,
|
||||
amd::HostQueue* queue = hip::getQueue(hStream);
|
||||
const amd::Device& device = queue->vdev()->device();
|
||||
|
||||
if ((params & amd::NDRangeKernelCommand::CooperativeGroups) &&
|
||||
!device.info().cooperativeGroups_) {
|
||||
return hipErrorLaunchFailure;
|
||||
// Make sure dispatch doesn't exceed max workgroup size limit
|
||||
if (blockDimX * blockDimY * blockDimZ > device.info().maxWorkGroupSize_) {
|
||||
return hipErrorInvalidConfiguration;
|
||||
}
|
||||
|
||||
if (params & amd::NDRangeKernelCommand::CooperativeGroups) {
|
||||
if (!device.info().cooperativeGroups_) {
|
||||
return hipErrorLaunchFailure;
|
||||
}
|
||||
int num_blocks = 0;
|
||||
int num_grids = 0;
|
||||
int block_size = blockDimX * blockDimY * blockDimZ;
|
||||
hip_impl::ihipOccupancyMaxActiveBlocksPerMultiprocessor(
|
||||
&num_blocks, &num_grids, device, f, block_size, sharedMemBytes, true);
|
||||
if (((gridDimX * gridDimY * gridDimZ) / block_size) > num_grids) {
|
||||
return hipErrorCooperativeLaunchTooLarge;
|
||||
}
|
||||
}
|
||||
if ((params & amd::NDRangeKernelCommand::CooperativeMultiDeviceGroups) &&
|
||||
!device.info().cooperativeMultiDeviceGroups_) {
|
||||
|
||||
Reference in new issue
Bir kullanıcı engelle