From 788f07b6261e2018f1f7a7759e4c99ca14a8cc3e Mon Sep 17 00:00:00 2001 From: Jatin Chaudhary Date: Tue, 21 Jul 2020 06:31:13 -0400 Subject: [PATCH] Adding Anyorder flag to HIP Change-Id: Ie20931541b3febe23fa9ac36ebc0c90de75a5f0a [ROCm/hip commit: 1340b3f07fcb5041e18d878ddd734aa0a49b26d5] --- projects/hip/include/hip/hcc_detail/hip_runtime_api.h | 3 +++ projects/hip/rocclr/hip_module.cpp | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/projects/hip/include/hip/hcc_detail/hip_runtime_api.h b/projects/hip/include/hip/hcc_detail/hip_runtime_api.h index d4ac271e6c..36b1ddf79e 100755 --- a/projects/hip/include/hip/hcc_detail/hip_runtime_api.h +++ b/projects/hip/include/hip/hcc_detail/hip_runtime_api.h @@ -232,6 +232,9 @@ enum hipLimit_t { #define hipCpuDeviceId ((int)-1) #define hipInvalidDeviceId ((int)-2) +// Flags that can be used with hipExtLaunch Set of APIs +#define hipExtAnyOrderLaunch 0x01 ///< AnyOrderLaunch of kernels + /* * @brief HIP Memory Advise values * @enum diff --git a/projects/hip/rocclr/hip_module.cpp b/projects/hip/rocclr/hip_module.cpp index 5c75deb776..051578dc0a 100755 --- a/projects/hip/rocclr/hip_module.cpp +++ b/projects/hip/rocclr/hip_module.cpp @@ -288,6 +288,11 @@ hipError_t ihipModuleLaunchKernel(hipFunction_t f, uint32_t globalWorkSizeX, profileNDRange = (startEvent != nullptr && stopEvent != nullptr); + // Flag set to 1 signifies that kernel can be launched in anyorder + if (flags & hipExtAnyOrderLaunch) { + params |= amd::NDRangeKernelCommand::AnyOrderLaunch; + } + amd::NDRangeKernelCommand* command = new amd::NDRangeKernelCommand( *queue, waitList, *kernel, ndrange, sharedMemBytes, params, gridId, numGrids, prevGridSum, allGridSum, firstDevice, profileNDRange);