Skip to content

Commit

Permalink
EXSWHTEC-384 - Coverage Tool and Test Plan update ROCm#455
Browse files Browse the repository at this point in the history
Change-Id: Idf52308186a73ae1c4d815eb59f20ea7da99c964
  • Loading branch information
mirza-halilcevic authored and rakesroy committed Feb 27, 2024
1 parent 66e2885 commit dc78faf
Show file tree
Hide file tree
Showing 41 changed files with 56 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ THE SOFTWARE.
*/
#include <hip_test_common.hh>
#include <hip/hip_cooperative_groups.h>
#include <hip_test_defgroups.hh>

/**
* @addtogroup coalesced_group thread_block_tile
Expand Down
2 changes: 1 addition & 1 deletion catch/unit/dynamicLoading/complex_loading_behavior.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ THE SOFTWARE.
*/
#include <hip_test_common.hh>
#include <dlfcn.h>
#include <hip_test_defgroups.hh>
/**
* @addtogroup hipLaunchKernelGGL hipLaunchCooperativeKernel
* @{
Expand Down
2 changes: 1 addition & 1 deletion catch/unit/dynamicLoading/hipApiDynamicLoad.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#include <hip_test_common.hh>
#include <hip_test_defgroups.hh>
#include <stdio.h>
#include <dlfcn.h>
#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion catch/unit/event/hipEventCreateWithFlags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ THE SOFTWARE.

#include <hip_test_common.hh>
#include <hip_test_kernels.hh>
#include <hip_test_defgroups.hh>
#include <stdlib.h>

constexpr size_t buffer_size = (1024*1024);
Expand Down
2 changes: 1 addition & 1 deletion catch/unit/g++/hipMalloc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* */

#include <hip_test_common.hh>
#include <hip_test_defgroups.hh>
#include "hipMalloc.h"
/**
* @addtogroup hipMalloc hipMalloc
Expand Down
2 changes: 1 addition & 1 deletion catch/unit/gcc/gccTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* */

#include <hip_test_common.hh>
#include <hip_test_defgroups.hh>
extern "C" {
#include "LaunchKernel.h"
}
Expand Down
2 changes: 1 addition & 1 deletion catch/unit/graph/hipGraphAddDependencies.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ THE SOFTWARE.
#include <hip_test_common.hh>
#include <hip_test_checkers.hh>
#include <hip_test_kernels.hh>
#include <hip_test_defgroups.hh>

#include "graph_dependency_common.hh"

Expand Down
2 changes: 1 addition & 1 deletion catch/unit/graph/hipGraphAddKernelNode.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ THE SOFTWARE.
#include <hip_test_common.hh>
#include <hip_test_kernels.hh>
#include <hip_test_checkers.hh>
#include <hip_test_defgroups.hh>

#define CODEOBJ_FILE "add_Kernel.code"
#define KERNEL_NAME "Add"
Expand Down
2 changes: 1 addition & 1 deletion catch/unit/graph/hipGraphGetEdges.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ THE SOFTWARE.
#include <hip_test_common.hh>
#include <hip_test_checkers.hh>
#include <hip_test_kernels.hh>
#include <hip_test_defgroups.hh>

#include "graph_dependency_common.hh"

Expand Down
2 changes: 1 addition & 1 deletion catch/unit/graph/hipGraphGetNodes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ THE SOFTWARE.
#include <hip_test_common.hh>
#include <hip_test_checkers.hh>
#include <hip_test_kernels.hh>
#include <hip_test_defgroups.hh>

#include "graph_dependency_common.hh"

Expand Down
2 changes: 1 addition & 1 deletion catch/unit/graph/hipGraphGetRootNodes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ THE SOFTWARE.
#include <hip_test_common.hh>
#include <hip_test_checkers.hh>
#include <hip_test_kernels.hh>
#include <hip_test_defgroups.hh>

#include "graph_dependency_common.hh"

Expand Down
2 changes: 1 addition & 1 deletion catch/unit/graph/hipGraphNodeGetDependencies.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ THE SOFTWARE.
#include <hip_test_common.hh>
#include <hip_test_checkers.hh>
#include <hip_test_kernels.hh>
#include <hip_test_defgroups.hh>

#include "graph_dependency_common.hh"

Expand Down
2 changes: 1 addition & 1 deletion catch/unit/graph/hipGraphNodeGetDependentNodes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ THE SOFTWARE.
#include <hip_test_common.hh>
#include <hip_test_checkers.hh>
#include <hip_test_kernels.hh>
#include <hip_test_defgroups.hh>

#include "graph_dependency_common.hh"

Expand Down
2 changes: 1 addition & 1 deletion catch/unit/graph/hipGraphRemoveDependencies.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ THE SOFTWARE.
#include <hip_test_common.hh>
#include <hip_test_checkers.hh>
#include <hip_test_kernels.hh>
#include <hip_test_defgroups.hh>

#include "graph_dependency_common.hh"

Expand Down
3 changes: 2 additions & 1 deletion catch/unit/graph/hipStreamBeginCapture.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ THE SOFTWARE.

#include <hip_test_common.hh>
#include <hip_test_kernels.hh>
#include "stream_capture_common.hh" // NOLINT

#include "stream_capture_common.hh" // NOLINT

#pragma clang diagnostic ignored "-Wunused-variable"
/**
Expand Down
2 changes: 1 addition & 1 deletion catch/unit/kernel/hipDynamicShared.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ THE SOFTWARE.
#include <hip_test_kernels.hh>
#include <hip_test_checkers.hh>
#include <hip_test_common.hh>
#include <hip_test_defgroups.hh>

#pragma clang diagnostic ignored "-Wunused-parameter"

Expand Down
2 changes: 1 addition & 1 deletion catch/unit/kernel/hipDynamicShared2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ THE SOFTWARE.
#include <hip_test_kernels.hh>
#include <hip_test_checkers.hh>
#include <hip_test_common.hh>
#include <hip_test_defgroups.hh>

#define LEN (16 * 1024)
#define SIZE (LEN * sizeof(float))
Expand Down
2 changes: 1 addition & 1 deletion catch/unit/kernel/hipEmptyKernel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ THE SOFTWARE.
#include <hip_test_kernels.hh>
#include <hip_test_checkers.hh>
#include <hip_test_common.hh>
#include <hip_test_defgroups.hh>

#pragma clang diagnostic ignored "-Wunused-parameter"

Expand Down
2 changes: 1 addition & 1 deletion catch/unit/kernel/hipExtLaunchKernelGGL.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ THE SOFTWARE.
#include <hip_test_kernels.hh>
#include <hip_test_checkers.hh>
#include <hip_test_common.hh>
#include <hip_test_defgroups.hh>
#include "hip/hip_ext.h"

static unsigned threadsPerBlock = 256;
Expand Down
2 changes: 1 addition & 1 deletion catch/unit/kernel/hipGridLaunch.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ THE SOFTWARE.
#include <hip_test_kernels.hh>
#include <hip_test_checkers.hh>
#include <hip_test_common.hh>
#include <hip_test_defgroups.hh>

static unsigned threadsPerBlock = 256;
static unsigned blocksPerCU = 6;
Expand Down
2 changes: 1 addition & 1 deletion catch/unit/kernel/hipLanguageExtensions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ THE SOFTWARE.
#include <hip_test_kernels.hh>
#include <hip_test_common.hh>
#include <hip_test_checkers.hh>
#include <hip_test_defgroups.hh>
#include <hip/math_functions.h>

#pragma clang diagnostic ignored "-Wunused-variable"
Expand Down
2 changes: 1 addition & 1 deletion catch/unit/kernel/hipLaunchParm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ THE SOFTWARE.
#include <hip_test_kernels.hh>
#include <hip_test_checkers.hh>
#include <hip_test_common.hh>
#include <hip_test_defgroups.hh>
#include <cstdint>

#pragma clang diagnostic ignored "-Wunused-variable"
Expand Down
2 changes: 1 addition & 1 deletion catch/unit/kernel/hipLaunchParmFunctor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ THE SOFTWARE.
#include <hip_test_kernels.hh>
#include <hip_test_checkers.hh>
#include <hip_test_common.hh>
#include <hip_test_defgroups.hh>

class HipFunctorTests {
public:
Expand Down
2 changes: 1 addition & 1 deletion catch/unit/kernel/hipPrintfKernel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#include <hip_test_common.hh>
#include <hip_test_defgroups.hh>
#include <cstring>
#include "../kernel/printf_common.h"

Expand Down
2 changes: 1 addition & 1 deletion catch/unit/kernel/hipTestConstant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#include <hip_test_common.hh>
#include <hip_test_defgroups.hh>

#define LEN 512
#define SIZE 2048
Expand Down
2 changes: 1 addition & 1 deletion catch/unit/kernel/hipTestGlobalVariable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#include <hip_test_common.hh>
#include <hip_test_defgroups.hh>

#define LEN 512
#define SIZE 2048
Expand Down
2 changes: 1 addition & 1 deletion catch/unit/kernel/hipTestMemKernel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#include <hip_test_common.hh>
#include <hip_test_defgroups.hh>

#define LEN8 8 * 4
#define LEN9 9 * 4
Expand Down
2 changes: 1 addition & 1 deletion catch/unit/kernel/launch_bounds.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#include <hip_test_common.hh>
#include <hip_test_defgroups.hh>

constexpr size_t N = 1024;
int p_blockSize = 256;
Expand Down
2 changes: 1 addition & 1 deletion catch/unit/memory/hipHostRegister.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ THE SOFTWARE.
#include <hip_test_common.hh>
#include <hip_test_helper.hh>
#include <hip_test_process.hh>
#include <hip_test_defgroups.hh>
#include <utils.hh>

#define OFFSET 128
Expand Down
2 changes: 1 addition & 1 deletion catch/unit/memory/hipPointerGetAttributes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Following scenarios are verified for hipPointerGetAttributes API
*/
#include <inttypes.h>
#include <hip_test_common.hh>
#include <hip_test_defgroups.hh>
#ifdef __linux__
#include <sys/mman.h>
#endif
Expand Down
2 changes: 1 addition & 1 deletion catch/unit/module/hipExtModuleLaunchKernel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ THE SOFTWARE.
*/

#include <hip_test_common.hh>
#include <hip_test_defgroups.hh>
#include <iostream>
#include <fstream>
#include "hip/hip_ext.h"
Expand Down
2 changes: 1 addition & 1 deletion catch/unit/p2p/hipDeviceGetP2PAttribute.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ THE SOFTWARE.
#include "hip/hip_runtime_api.h"
#include <hip_test_process.hh>
#include <string>
#include <hip_test_defgroups.hh>

/**
* @addtogroup hipDeviceGetP2PAttribute hipDeviceGetP2PAttribute
Expand Down
2 changes: 1 addition & 1 deletion catch/unit/p2p/hipP2pLinkTypeAndHopFunc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ THE SOFTWARE.
#include <hip_test_kernels.hh>
#include <hip_test_checkers.hh>
#include <hip_test_common.hh>
#include <hip_test_defgroups.hh>
#ifdef __linux__
#include <unistd.h>
#include <sys/wait.h>
Expand Down
2 changes: 1 addition & 1 deletion catch/unit/printf/printfFlagsNonHost.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ THE SOFTWARE.

#include <hip_test_common.hh>
#include <hip_test_process.hh>
#include <hip_test_defgroups.hh>

/**
* @addtogroup printf printf
Expand Down
2 changes: 1 addition & 1 deletion catch/unit/printf/printfHost.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
THE SOFTWARE.
*/
#include <hip_test_common.hh>
#include <hip_test_defgroups.hh>

// Kernel Function
__global__ void run_printf(int *count) {
Expand Down
2 changes: 1 addition & 1 deletion catch/unit/printf/printfNonHost.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
THE SOFTWARE.
*/
#include <hip_test_common.hh>
#include <hip_test_defgroups.hh>

#define ITER_COUNT 61681
#define KERNEL_ITERATIONS 15
Expand Down
2 changes: 1 addition & 1 deletion catch/unit/printf/printfSpecifiersNonHost.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ THE SOFTWARE.

#include <hip_test_common.hh>
#include <hip_test_process.hh>
#include <hip_test_defgroups.hh>

/**
* @addtogroup printf
Expand Down
1 change: 1 addition & 0 deletions catch/unit/stream/hipStreamGetDevice.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ THE SOFTWARE.
#include <hip_test_kernels.hh>
#include <hip_test_common.hh>
#include <hip_test_checkers.hh>

#define NUMBER_OF_THREADS 10
static bool thread_results[NUMBER_OF_THREADS];

Expand Down
6 changes: 6 additions & 0 deletions utils/coverage/device_api_list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -731,3 +731,9 @@ Device float16 functions [
__hisnan2
__hneg2
]

OpenGL Interop [
hipGLGetDevices
hipGraphicsGLRegisterBuffer
hipGraphicsGLRegisterImage
]
13 changes: 10 additions & 3 deletions utils/coverage/hipAPICoverageUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ void findAPICallInFile(HipAPI& hip_api, std::string test_module_file) {
std::string api_member{"." + hip_api.getName() + "("};
std::string api_newline{" " + hip_api.getName() + "("};
std::string api_templated{" " + hip_api.getName() + "<"};
std::string api_kernel_def_macro{"_KERNEL_DEF(" + hip_api.getName() + ")"};
std::string api_kernel_def_macro{"_KERNEL_DEF(" + hip_api.getName()};
std::string api_test_def_macro{"_TEST_DEF(" + hip_api.getName()};

std::string api_restriction{hip_api.getFileRestriction()};
bool found_restriction{false};
Expand All @@ -68,7 +69,8 @@ void findAPICallInFile(HipAPI& hip_api, std::string test_module_file) {
(line.find(api_newline) != std::string::npos) ||
(line.find(hip_api.getName() + "(") == 0) ||
(line.find(api_templated) != std::string::npos) ||
(line.find(api_kernel_def_macro) != std::string::npos)) {
(line.find(api_kernel_def_macro) != std::string::npos) ||
(line.find(api_test_def_macro) != std::string::npos)) {
if (api_restriction == "" || found_restriction) {
hip_api.addFileOccurrence(FileOccurrence(test_module_file, line_number));
}
Expand Down Expand Up @@ -199,6 +201,7 @@ std::vector<HipAPI> extractHipAPIs(std::string& hip_api_header_file,
of code shall not be considered.
*/
std::string hip_api_prefix{"hip"};
std::string hip_api_prefix_builtin{"__hip"};
std::string group_definition{"@defgroup"};
std::string add_group_definition{"@addtogroup"};
std::string start_of_api_groups{"HIP API"};
Expand Down Expand Up @@ -289,7 +292,11 @@ std::vector<HipAPI> extractHipAPIs(std::string& hip_api_header_file,
Remove all spaces if they exist in the parsed string, e.g.,
hipError_t hipDeviceSetLimit ( enum hipLimit_t limit, size_t value );.
*/
std::string api_name{api_name_no_brackets.substr(api_name_no_brackets.rfind(hip_api_prefix))};
auto api_name_pos = api_name_no_brackets.rfind(hip_api_prefix_builtin);
if (api_name_pos == std::string::npos) {
api_name_pos = api_name_no_brackets.rfind(hip_api_prefix);
}
std::string api_name{api_name_no_brackets.substr(api_name_pos)};
api_name.erase(std::remove(api_name.begin(), api_name.end(), ' '), api_name.end());

if (!api_group_names_tracker.empty()) {
Expand Down
Loading

0 comments on commit dc78faf

Please sign in to comment.