SWDEV-547453 Release the kernel command if the operation returns an error (#807)
* SWDEV-547453 Release the kernel command if the operation returns an error * SWDEV-547453 - Initialize parameters_ to default value * SWDEV-547453 - Run clang-format
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
da068a2492
Коммит
a15957fee9
@@ -380,6 +380,7 @@ hipError_t ihipLaunchKernelCommand(amd::Command*& command, hipFunction_t f,
|
||||
assert(kernelParams == nullptr);
|
||||
if (extra[0] != HIP_LAUNCH_PARAM_BUFFER_POINTER || extra[2] != HIP_LAUNCH_PARAM_BUFFER_SIZE ||
|
||||
extra[4] != HIP_LAUNCH_PARAM_END) {
|
||||
kernelCommand->release();
|
||||
return hipErrorInvalidValue;
|
||||
}
|
||||
kernargs = reinterpret_cast<address>(extra[1]);
|
||||
|
||||
@@ -421,20 +421,21 @@ const Context& Command::context() const { return queue_->context(); }
|
||||
NDRangeKernelCommand::NDRangeKernelCommand(HostQueue& queue, const EventWaitList& eventWaitList,
|
||||
Kernel& kernel, const NDRangeContainer& sizes,
|
||||
uint32_t sharedMemBytes, uint32_t extraParam,
|
||||
uint32_t gridId, uint32_t numGrids,
|
||||
uint64_t prevGridSum, uint64_t allGridSum,
|
||||
uint32_t firstDevice, bool forceProfiling) :
|
||||
Command(queue, CL_COMMAND_NDRANGE_KERNEL, eventWaitList, AMD_SERIALIZE_KERNEL |
|
||||
(HIP_LAUNCH_BLOCKING << 1)),
|
||||
kernel_(kernel),
|
||||
sizes_(sizes),
|
||||
sharedMemBytes_(sharedMemBytes),
|
||||
extraParam_(extraParam),
|
||||
gridId_(gridId),
|
||||
numGrids_(numGrids),
|
||||
prevGridSum_(prevGridSum),
|
||||
allGridSum_(allGridSum),
|
||||
firstDevice_(firstDevice) {
|
||||
uint32_t gridId, uint32_t numGrids, uint64_t prevGridSum,
|
||||
uint64_t allGridSum, uint32_t firstDevice,
|
||||
bool forceProfiling)
|
||||
: Command(queue, CL_COMMAND_NDRANGE_KERNEL, eventWaitList,
|
||||
AMD_SERIALIZE_KERNEL | (HIP_LAUNCH_BLOCKING << 1)),
|
||||
kernel_(kernel),
|
||||
sizes_(sizes),
|
||||
sharedMemBytes_(sharedMemBytes),
|
||||
extraParam_(extraParam),
|
||||
gridId_(gridId),
|
||||
numGrids_(numGrids),
|
||||
prevGridSum_(prevGridSum),
|
||||
allGridSum_(allGridSum),
|
||||
firstDevice_(firstDevice),
|
||||
parameters_(nullptr) {
|
||||
auto& device = queue.device();
|
||||
auto devKernel = const_cast<device::Kernel*>(kernel.getDeviceKernel(device));
|
||||
if (cooperativeGroups()) {
|
||||
|
||||
Ссылка в новой задаче
Block a user