SWDEV-289405 - [catch2][dtest][module] Migration of Module files to CATCH2 framework (#2351)

Migrated all module related files to CATCH2 framework and optimized to
have single module kernel file

Change-Id: I39aa28ef22c1b2f4d0014ca32b59b9c645b725dc
This commit is contained in:
dkrottap
2021-09-17 11:39:36 +05:30
committed by GitHub
parent bef1aa7ee6
commit 8763c8c2ad
36 changed files with 4560 additions and 5 deletions
+30 -1
View File
@@ -1,5 +1,5 @@
/*
Copyright (c) 2021 - 2021 Advanced Micro Devices, Inc. All rights reserved.
Copyright (c) 2021 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
@@ -72,6 +72,35 @@ __global__ void addCountReverse(const T* A_d, T* C_d, int64_t NELEM, int count)
}
}
template<typename T>
__device__ void waitKernel(uint64_t wait_sec, T clockrate) {
uint64_t start = clock64()/clockrate, cur;
do { cur = clock64()/clockrate-start;}while (cur < (wait_sec*1000));
}
template<typename T>
__global__ void TwoSecKernel_GlobalVar(int globalvar, int clockrate) {
if (globalvar == 0x2222) {
globalvar = 0x3333;
}
waitKernel(2, clockrate);
if (globalvar != 0x3333) {
globalvar = 0x5555;
}
}
template<typename T>
__global__ void FourSecKernel_GlobalVar(int globalvar, int clockrate) {
if (globalvar == 1) {
globalvar = 0x2222;
}
waitKernel(4, clockrate);
if (globalvar == 0x2222) {
globalvar = 0x4444;
}
}
template <typename T> __global__ void memsetReverse(T* C_d, T val, int64_t NELEM) {
size_t offset = (blockIdx.x * blockDim.x + threadIdx.x);
size_t stride = blockDim.x * gridDim.x;