diff options
Diffstat (limited to 'offload/unittests/OffloadAPI/kernel/olLaunchKernel.cpp')
-rw-r--r-- | offload/unittests/OffloadAPI/kernel/olLaunchKernel.cpp | 55 |
1 files changed, 27 insertions, 28 deletions
diff --git a/offload/unittests/OffloadAPI/kernel/olLaunchKernel.cpp b/offload/unittests/OffloadAPI/kernel/olLaunchKernel.cpp index e7e608f..758f607 100644 --- a/offload/unittests/OffloadAPI/kernel/olLaunchKernel.cpp +++ b/offload/unittests/OffloadAPI/kernel/olLaunchKernel.cpp @@ -91,10 +91,10 @@ TEST_P(olLaunchKernelFooTest, Success) { void *Mem; } Args{Mem}; - ASSERT_SUCCESS(olLaunchKernel(Queue, Device, Kernel, &Args, sizeof(Args), - &LaunchArgs, nullptr)); + ASSERT_SUCCESS( + olLaunchKernel(Queue, Device, Kernel, &Args, sizeof(Args), &LaunchArgs)); - ASSERT_SUCCESS(olWaitQueue(Queue)); + ASSERT_SUCCESS(olSyncQueue(Queue)); uint32_t *Data = (uint32_t *)Mem; for (uint32_t i = 0; i < 64; i++) { @@ -106,9 +106,9 @@ TEST_P(olLaunchKernelFooTest, Success) { TEST_P(olLaunchKernelNoArgsTest, Success) { ASSERT_SUCCESS( - olLaunchKernel(Queue, Device, Kernel, nullptr, 0, &LaunchArgs, nullptr)); + olLaunchKernel(Queue, Device, Kernel, nullptr, 0, &LaunchArgs)); - ASSERT_SUCCESS(olWaitQueue(Queue)); + ASSERT_SUCCESS(olSyncQueue(Queue)); } TEST_P(olLaunchKernelFooTest, SuccessSynchronous) { @@ -121,7 +121,7 @@ TEST_P(olLaunchKernelFooTest, SuccessSynchronous) { } Args{Mem}; ASSERT_SUCCESS(olLaunchKernel(nullptr, Device, Kernel, &Args, sizeof(Args), - &LaunchArgs, nullptr)); + &LaunchArgs)); uint32_t *Data = (uint32_t *)Mem; for (uint32_t i = 0; i < 64; i++) { @@ -144,10 +144,10 @@ TEST_P(olLaunchKernelLocalMemTest, Success) { void *Mem; } Args{Mem}; - ASSERT_SUCCESS(olLaunchKernel(Queue, Device, Kernel, &Args, sizeof(Args), - &LaunchArgs, nullptr)); + ASSERT_SUCCESS( + olLaunchKernel(Queue, Device, Kernel, &Args, sizeof(Args), &LaunchArgs)); - ASSERT_SUCCESS(olWaitQueue(Queue)); + ASSERT_SUCCESS(olSyncQueue(Queue)); uint32_t *Data = (uint32_t *)Mem; for (uint32_t i = 0; i < LaunchArgs.GroupSize.x * LaunchArgs.NumGroups.x; i++) @@ -167,10 +167,10 @@ TEST_P(olLaunchKernelLocalMemReductionTest, Success) { void *Mem; } Args{Mem}; - ASSERT_SUCCESS(olLaunchKernel(Queue, Device, Kernel, &Args, sizeof(Args), - &LaunchArgs, nullptr)); + ASSERT_SUCCESS( + olLaunchKernel(Queue, Device, Kernel, &Args, sizeof(Args), &LaunchArgs)); - ASSERT_SUCCESS(olWaitQueue(Queue)); + ASSERT_SUCCESS(olSyncQueue(Queue)); uint32_t *Data = (uint32_t *)Mem; for (uint32_t i = 0; i < LaunchArgs.NumGroups.x; i++) @@ -190,10 +190,10 @@ TEST_P(olLaunchKernelLocalMemStaticTest, Success) { void *Mem; } Args{Mem}; - ASSERT_SUCCESS(olLaunchKernel(Queue, Device, Kernel, &Args, sizeof(Args), - &LaunchArgs, nullptr)); + ASSERT_SUCCESS( + olLaunchKernel(Queue, Device, Kernel, &Args, sizeof(Args), &LaunchArgs)); - ASSERT_SUCCESS(olWaitQueue(Queue)); + ASSERT_SUCCESS(olSyncQueue(Queue)); uint32_t *Data = (uint32_t *)Mem; for (uint32_t i = 0; i < LaunchArgs.NumGroups.x; i++) @@ -210,12 +210,12 @@ TEST_P(olLaunchKernelGlobalTest, Success) { void *Mem; } Args{Mem}; - ASSERT_SUCCESS(olLaunchKernel(Queue, Device, Kernels[0], nullptr, 0, - &LaunchArgs, nullptr)); - ASSERT_SUCCESS(olWaitQueue(Queue)); + ASSERT_SUCCESS( + olLaunchKernel(Queue, Device, Kernels[0], nullptr, 0, &LaunchArgs)); + ASSERT_SUCCESS(olSyncQueue(Queue)); ASSERT_SUCCESS(olLaunchKernel(Queue, Device, Kernels[1], &Args, sizeof(Args), - &LaunchArgs, nullptr)); - ASSERT_SUCCESS(olWaitQueue(Queue)); + &LaunchArgs)); + ASSERT_SUCCESS(olSyncQueue(Queue)); uint32_t *Data = (uint32_t *)Mem; for (uint32_t i = 0; i < 64; i++) { @@ -229,9 +229,8 @@ TEST_P(olLaunchKernelGlobalTest, InvalidNotAKernel) { ol_symbol_handle_t Global = nullptr; ASSERT_SUCCESS( olGetSymbol(Program, "global", OL_SYMBOL_KIND_GLOBAL_VARIABLE, &Global)); - ASSERT_ERROR( - OL_ERRC_SYMBOL_KIND, - olLaunchKernel(Queue, Device, Global, nullptr, 0, &LaunchArgs, nullptr)); + ASSERT_ERROR(OL_ERRC_SYMBOL_KIND, + olLaunchKernel(Queue, Device, Global, nullptr, 0, &LaunchArgs)); } TEST_P(olLaunchKernelGlobalCtorTest, Success) { @@ -242,9 +241,9 @@ TEST_P(olLaunchKernelGlobalCtorTest, Success) { void *Mem; } Args{Mem}; - ASSERT_SUCCESS(olLaunchKernel(Queue, Device, Kernel, &Args, sizeof(Args), - &LaunchArgs, nullptr)); - ASSERT_SUCCESS(olWaitQueue(Queue)); + ASSERT_SUCCESS( + olLaunchKernel(Queue, Device, Kernel, &Args, sizeof(Args), &LaunchArgs)); + ASSERT_SUCCESS(olSyncQueue(Queue)); uint32_t *Data = (uint32_t *)Mem; for (uint32_t i = 0; i < 64; i++) { @@ -259,6 +258,6 @@ TEST_P(olLaunchKernelGlobalDtorTest, Success) { // find/implement a way, update this test. For now we just check that nothing // crashes ASSERT_SUCCESS( - olLaunchKernel(Queue, Device, Kernel, nullptr, 0, &LaunchArgs, nullptr)); - ASSERT_SUCCESS(olWaitQueue(Queue)); + olLaunchKernel(Queue, Device, Kernel, nullptr, 0, &LaunchArgs)); + ASSERT_SUCCESS(olSyncQueue(Queue)); } |