From bceb5d6766fd20bb9600bb48a16e550e4aa92008 Mon Sep 17 00:00:00 2001 From: srinivas Charupally Date: Mon, 11 Jun 2018 12:37:38 +0530 Subject: [PATCH] Adding struct test for hipLaunchKernel() [ROCm/clr commit: 47835efac521ba6036a72ca2815b459e321c1538] --- .../clr/hipamd/tests/src/kernel/hipLaunchParm.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/projects/clr/hipamd/tests/src/kernel/hipLaunchParm.cpp b/projects/clr/hipamd/tests/src/kernel/hipLaunchParm.cpp index 46734a7b6b..45d50aa713 100644 --- a/projects/clr/hipamd/tests/src/kernel/hipLaunchParm.cpp +++ b/projects/clr/hipamd/tests/src/kernel/hipLaunchParm.cpp @@ -28,8 +28,14 @@ THE SOFTWARE. #include "hip/hip_runtime_api.h" #include -__global__ void vAdd(hipLaunchParm lp, float* a) {} +// Struct with dummy variables to check the hipLaunchKernel() +typedef struct hipLaunchKernelStruct { + int i; + float f; +} hipLaunchKernelStruct_t; +__global__ void vAdd(hipLaunchParm lp, float* a) {} +__global__ void hipLaunchKernelStructFunc(hipLaunchParm lp, hipLaunchKernelStruct_t* hipLaunchKernelStruct_) {} //--- // Some wrapper macro for testing: @@ -64,13 +70,16 @@ __global__ void vAdd(hipLaunchParm lp, float* a) {} int main() { float* Ad; + hipLaunchKernelStruct_t* hipLaunchKernelStruct_; hipMalloc((void**)&Ad, 1024); + hipMalloc((void**)&hipLaunchKernelStruct_, 1024); // Test the different hipLaunchParm options: hipLaunchKernel(vAdd, size_t(1024), 1, 0, 0, Ad); hipLaunchKernel(vAdd, 1024, dim3(1), 0, 0, Ad); hipLaunchKernel(vAdd, dim3(1024), 1, 0, 0, Ad); hipLaunchKernel(vAdd, dim3(1024), dim3(1), 0, 0, Ad); + hipLaunchKernel(hipLaunchKernelStructFunc, dim3(1024), dim3(1), 0, 0, hipLaunchKernelStruct_); // Test case with hipLaunchKernel inside another macro: float e0;