able to pass non-dim launch parm to kernel launch

Change-Id: I0411849a27efcba597a1a9aa08be179635e04988


[ROCm/hip commit: 90cd67e0b5]
This commit is contained in:
Aditya Atluri
2016-06-18 11:28:20 -05:00
parent 05cf656151
commit 9a1bce640c
4 changed files with 104 additions and 10 deletions
+61 -1
View File
@@ -1087,12 +1087,72 @@ hipStream_t ihipSyncAndResolveStream(hipStream_t stream)
// TODO - data-up to data-down:
// Called just before a kernel is launched from hipLaunchKernel.
// Allows runtime to track some information about the stream.
hipStream_t ihipPreLaunchKernel(hipStream_t stream, grid_launch_parm *lp)
hipStream_t ihipPreLaunchKernel(hipStream_t stream, dim3 grid, dim3 block, grid_launch_parm *lp)
{
std::call_once(hip_initialized, ihipInit);
stream = ihipSyncAndResolveStream(stream);
lp->gridDim.x = grid.x;
lp->gridDim.y = grid.y;
lp->gridDim.z = grid.z;
lp->groupDim.x = block.x;
lp->groupDim.y = block.y;
lp->groupDim.z = block.z;
stream->lockopen_preKernelCommand();
// *av = &stream->_av;
lp->av = &stream->_av;
lp->cf = new hc::completion_future;
// lp->av = static_cast<void*>(av);
// lp->cf = static_cast<void*>(malloc(sizeof(hc::completion_future)));
return (stream);
}
hipStream_t ihipPreLaunchKernel(hipStream_t stream, size_t grid, dim3 block, grid_launch_parm *lp)
{
std::call_once(hip_initialized, ihipInit);
stream = ihipSyncAndResolveStream(stream);
lp->gridDim.x = grid;
lp->gridDim.y = 0;
lp->gridDim.z = 0;
lp->groupDim.x = block.x;
lp->groupDim.y = block.y;
lp->groupDim.z = block.z;
stream->lockopen_preKernelCommand();
// *av = &stream->_av;
lp->av = &stream->_av;
lp->cf = new hc::completion_future;
// lp->av = static_cast<void*>(av);
// lp->cf = static_cast<void*>(malloc(sizeof(hc::completion_future)));
return (stream);
}
hipStream_t ihipPreLaunchKernel(hipStream_t stream, dim3 grid, size_t block, grid_launch_parm *lp)
{
std::call_once(hip_initialized, ihipInit);
stream = ihipSyncAndResolveStream(stream);
lp->gridDim.x = grid.x;
lp->gridDim.y = grid.y;
lp->gridDim.z = grid.z;
lp->groupDim.x = block;
lp->groupDim.y = 0;
lp->groupDim.z = 0;
stream->lockopen_preKernelCommand();
// *av = &stream->_av;
lp->av = &stream->_av;
lp->cf = new hc::completion_future;
// lp->av = static_cast<void*>(av);
// lp->cf = static_cast<void*>(malloc(sizeof(hc::completion_future)));
return (stream);
}
hipStream_t ihipPreLaunchKernel(hipStream_t stream, size_t grid, size_t block, grid_launch_parm *lp)
{
std::call_once(hip_initialized, ihipInit);
stream = ihipSyncAndResolveStream(stream);
lp->gridDim.x = grid;
lp->gridDim.y = 0;
lp->gridDim.z = 0;
lp->groupDim.x = block;
lp->groupDim.y = 0;
lp->groupDim.z = 0;
stream->lockopen_preKernelCommand();
// *av = &stream->_av;
lp->av = &stream->_av;