Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion projects/hip-tests/catch/config/parse_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def create_test_definition(
for entry in disabled:
tags_str += f"[exclude_{entry}]"

return f'#define {case_name} "{case_name}", "{tags_str}"'
return f'#define {case_name} "{tags_str}"'


def generate_parameter_header(cmd_options, output_path):
Expand Down
8 changes: 4 additions & 4 deletions projects/hip-tests/catch/contract/AUTHORING.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ per-API notes on why each gap exists.
tags: [<domain>]
```

This is **required, not optional**. `HIP_TEST_CASE(name)` expands through
`GET_TAGS(name)` → `SECOND_ARG(name)`, which needs a `name` macro that the
build **generates from this YAML** into `hip_test_config.hh`. A test-case name
This is **required, not optional**. `HIP_TEST_CASE(name)` expands to
`TEST_CASE(#name, name)`, which needs a `name` macro that the build
**generates from this YAML** into `hip_test_config.hh`. A test-case name
with no YAML entry fails to compile with
*"too few arguments to function-like macro SECOND_ARG"*. After editing the
*"use of undeclared identifier '<name>'"*. After editing the
YAML you must re-run CMake configure so the header regenerates.

6. **Regenerate the test plan and update the docs**: run
Expand Down
9 changes: 3 additions & 6 deletions projects/hip-tests/catch/include/hip_test_common.hh
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,16 @@
#ifdef ENABLE_YAML_TAGS
#include "hip_test_config.hh"

#define SECOND_ARG(a, b, ...) b
#define GET_TAGS(...) SECOND_ARG(__VA_ARGS__)
#define HIP_TEST_CASE(name) TEST_CASE(#name, GET_TAGS(name))
#define HIP_TEMPLATE_TEST_CASE(name, ...) TEMPLATE_TEST_CASE(#name, GET_TAGS(name), __VA_ARGS__)
#define HIP_TEST_CASE(name) TEST_CASE(#name, name)
#define HIP_TEMPLATE_TEST_CASE(name, ...) TEMPLATE_TEST_CASE(#name, name, __VA_ARGS__)

#else
#define GET_TAGS(...)
#define HIP_TEST_CASE(name) TEST_CASE(#name, "")
#define HIP_TEMPLATE_TEST_CASE(name, ...) TEMPLATE_TEST_CASE(#name, "", __VA_ARGS__)
#endif

/**
* @brief Check if running at quick level (level_0).
* @brief Check if r1ning at quick level (level_0).
* Use this to reduce test parameters for faster execution.
*/
inline bool isQuickLevel() {
Expand Down
2 changes: 1 addition & 1 deletion projects/hip-tests/catch/unit/atomics/unsafeAtomicAdd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ static void runUnsafeAtomicAddHalfAndBfloatTest() {
HIP_CHECK(hipFree(out));
}

TEST_CASE(Unit_unsafe_atomic_add_half_and_bfloat) {
HIP_TEST_CASE(Unit_unsafe_atomic_add_half_and_bfloat) {
SECTION("__half2") { runUnsafeAtomicAddHalfAndBfloatTest<__half2>(); }
SECTION("__hip_bfloat162") { runUnsafeAtomicAddHalfAndBfloatTest<__hip_bfloat162>(); }
SECTION("__half") { runUnsafeAtomicAddHalfAndBfloatTest<__half>(); }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@ HIP_TEST_CASE(Unit_Thread_Block_Tile_Reduce_Trivially_Copyable_Parameters)
}
}

TEST_CASE(Unit_Thread_Block_Tile_Scan_Trivially_Copyable_Parameters)
HIP_TEST_CASE(Unit_Thread_Block_Tile_Scan_Trivially_Copyable_Parameters)
{
CHECK_COOPERATIVE_LAUNCH_SUPPORT

Expand Down Expand Up @@ -1278,7 +1278,7 @@ HIP_TEST_CASE(Unit_Thread_Block_Tile_Reduce_All_Parameter_Sizes)
}
}

TEST_CASE(Unit_Thread_Block_Tile_Scan_All_Parameter_Sizes)
HIP_TEST_CASE(Unit_Thread_Block_Tile_Scan_All_Parameter_Sizes)
{
CHECK_COOPERATIVE_LAUNCH_SUPPORT

Expand Down Expand Up @@ -1475,7 +1475,7 @@ void testScanForTileSize()
}
}

TEST_CASE(Unit_Thread_Block_Tile_Inclusive_Scan_Basic)
HIP_TEST_CASE(Unit_Thread_Block_Tile_Inclusive_Scan_Basic)
{
CHECK_COOPERATIVE_LAUNCH_SUPPORT

Expand All @@ -1495,7 +1495,7 @@ TEST_CASE(Unit_Thread_Block_Tile_Inclusive_Scan_Basic)
}
}

TEMPLATE_TEST_CASE(Unit_Thread_Block_Tile_Exclusive_Scan_Basic, int, half)
HIP_TEMPLATE_TEST_CASE(Unit_Thread_Block_Tile_Exclusive_Scan_Basic, int, half)
{
CHECK_COOPERATIVE_LAUNCH_SUPPORT

Expand Down Expand Up @@ -1533,7 +1533,7 @@ TEMPLATE_TEST_CASE(Unit_Thread_Block_Tile_Exclusive_Scan_Basic, int, half)

// for all the tile sizes and all input types, using random input values, calculates the scan
// values. Additionally, randomly make some threads not participate for the coalesced_threads case
TEMPLATE_TEST_CASE(Unit_Thread_Block_Tile_Scan_Random_arithmetic, int, unsigned int, long long,
HIP_TEMPLATE_TEST_CASE(Unit_Thread_Block_Tile_Scan_Random_arithmetic, int, unsigned int, long long,
unsigned long long, float, half, double)
{
CHECK_COOPERATIVE_LAUNCH_SUPPORT
Expand All @@ -1559,7 +1559,7 @@ TEMPLATE_TEST_CASE(Unit_Thread_Block_Tile_Scan_Random_arithmetic, int, unsigned
}
}

TEMPLATE_TEST_CASE(Unit_Thread_Block_Tile_Scan_Random_boolean, int, unsigned int, long long,
HIP_TEMPLATE_TEST_CASE(Unit_Thread_Block_Tile_Scan_Random_boolean, int, unsigned int, long long,
unsigned long long)
{
CHECK_COOPERATIVE_LAUNCH_SUPPORT
Expand All @@ -1586,7 +1586,7 @@ TEMPLATE_TEST_CASE(Unit_Thread_Block_Tile_Scan_Random_boolean, int, unsigned int
}

// make sures that tiled blocks that use the y or z dimension work correctly
TEST_CASE(Unit_Thread_Block_Tile_2D_3D_Blocks)
HIP_TEST_CASE(Unit_Thread_Block_Tile_2D_3D_Blocks)
{
CHECK_COOPERATIVE_LAUNCH_SUPPORT

Expand Down Expand Up @@ -1621,7 +1621,7 @@ TEST_CASE(Unit_Thread_Block_Tile_2D_3D_Blocks)
}
}

TEMPLATE_TEST_CASE(Unit_Thread_Block_Coalesced_Scan_arithmetic, int, unsigned int, long long,
HIP_TEMPLATE_TEST_CASE(Unit_Thread_Block_Coalesced_Scan_arithmetic, int, unsigned int, long long,
unsigned long long, float, half, double)
{
CHECK_COOPERATIVE_LAUNCH_SUPPORT
Expand All @@ -1647,7 +1647,7 @@ TEMPLATE_TEST_CASE(Unit_Thread_Block_Coalesced_Scan_arithmetic, int, unsigned in
}
}

TEMPLATE_TEST_CASE(Unit_Thread_Block_Coalesced_Scan_boolean, int, unsigned int, long long,
HIP_TEMPLATE_TEST_CASE(Unit_Thread_Block_Coalesced_Scan_boolean, int, unsigned int, long long,
unsigned long long)
{
CHECK_COOPERATIVE_LAUNCH_SUPPORT
Expand Down Expand Up @@ -1706,7 +1706,7 @@ void __global__ binaryPartitionTiled(int* out, int* ranks)
}
}

TEST_CASE(Unit_Thread_Block_Scan_partition)
HIP_TEST_CASE(Unit_Thread_Block_Scan_partition)
{
CHECK_COOPERATIVE_LAUNCH_SUPPORT

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ static void runAtomicAddCoherentUnsafeFlagTest(const std::string& gfxName) {
HIP_CHECK(hipHostFree(result));
}

TEST_CASE(Unit_AtomicAdd_Coherent) {
HIP_TEST_CASE(Unit_AtomicAdd_Coherent) {
hipDeviceProp_t prop;
int device;
HIP_CHECK(hipGetDevice(&device));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ static void runAtomicAddNonCoherentUnsafeFlagTest() {
HIP_CHECK(hipHostFree(result));
}

TEST_CASE(Unit_AtomicAdd_NonCoherent) {
HIP_TEST_CASE(Unit_AtomicAdd_NonCoherent) {
hipDeviceProp_t prop;
int device;
HIP_CHECK(hipGetDevice(&device));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ static void runUnsafeAtomicAddCoherentUnsafeFlagTest(const std::string& gfxName)
HIP_CHECK(hipHostFree(result));
}

TEST_CASE(Unit_unsafeAtomicAdd_Coherent) {
HIP_TEST_CASE(Unit_unsafeAtomicAdd_Coherent) {
hipDeviceProp_t prop;
int device;
HIP_CHECK(hipGetDevice(&device));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ static void runUnsafeAtomicAddNonCoherentUnsafeFlagTest() {
HIP_CHECK(hipHostFree(result));
}

TEST_CASE(Unit_unsafeAtomicAdd_NonCoherent) {
HIP_TEST_CASE(Unit_unsafeAtomicAdd_NonCoherent) {
hipDeviceProp_t prop;
int device;
HIP_CHECK(hipGetDevice(&device));
Expand Down
2 changes: 1 addition & 1 deletion projects/hip-tests/catch/unit/rtc/rtc_coop.cc
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ HIP_TEST_CASE(Unit_Rtc_CoopReduce)
}
}

TEST_CASE(Unit_Rtc_CoopScan)
HIP_TEST_CASE(Unit_Rtc_CoopScan)
{
const std::tuple<int, unsigned int, long long, unsigned long long, float, half, double> allTypes;
const std::tuple<int, unsigned int, long long, unsigned long long> integralTypes;
Expand Down
Loading