diff --git a/projects/hip/tests/src/runtimeApi/module/hipExtModuleLaunchKernel.cpp b/projects/hip/tests/src/runtimeApi/module/hipExtModuleLaunchKernel.cpp index 54ddc63dde..f4c72ca1c5 100755 --- a/projects/hip/tests/src/runtimeApi/module/hipExtModuleLaunchKernel.cpp +++ b/projects/hip/tests/src/runtimeApi/module/hipExtModuleLaunchKernel.cpp @@ -1,5 +1,5 @@ /* -Copyright (c) 2019 -> Present Advanced Micro Devices, Inc. All rights reserved. +Copyright (c) 2019 - present Advanced Micro Devices, Inc. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights @@ -36,96 +36,97 @@ using namespace std::chrono; int main() { - -int N=16384; -int SIZE=N*N; + int N=16384; + int SIZE=N*N; -int *A=new int[N*N*sizeof(int)]; -int *B=new int[N*N*sizeof(int)]; -int *C; + int *A=new int[N*N*sizeof(int)]; + int *B=new int[N*N*sizeof(int)]; + int *C; -hipDeviceptr_t *Ad,*Bd; + hipDeviceptr_t *Ad,*Bd; -for(int i=0;i(stop-start); + auto stop=high_resolution_clock::now(); + auto duration1=duration_cast(stop-start); -start=high_resolution_clock::now(); -HIPCHECK(hipExtModuleLaunchKernel(Function2, 1,1, 1, 1,1 ,1 , 0, stream1, NULL, (void**)&config2, NULL, NULL,1 )); -HIPCHECK(hipExtModuleLaunchKernel(Function1, N,N, 1, 32,32 ,1 , 0, stream1, NULL, (void**)&config1, NULL, NULL,1 )); -HIPCHECK(hipStreamSynchronize(stream1)); + start=high_resolution_clock::now(); + HIPCHECK(hipExtModuleLaunchKernel(Function2, 1,1, 1, 1,1 ,1 , 0, stream1, NULL, (void**)&config2, NULL, NULL,1 )); + HIPCHECK(hipExtModuleLaunchKernel(Function1, N,N, 1, 32,32 ,1 , 0, stream1, NULL, (void**)&config1, NULL, NULL,1 )); + HIPCHECK(hipStreamSynchronize(stream1)); -stop=high_resolution_clock::now(); -auto duration2=duration_cast(stop-start); + stop=high_resolution_clock::now(); + auto duration2=duration_cast(stop-start); -bool TEST_STATUS = true; + bool testStatus = true; -if(! (duration2.count() < duration1.count())) { - std::cout<<"Test failed as there was no time gain observed when two kernels were launched using hipExtModuleLaunchKernel() with flag 1."<