Skip to content

Commit f18003c

Browse files
committed
additional replacements of hardcoded strings
1 parent c07dc7b commit f18003c

File tree

115 files changed

+252
-270
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+252
-270
lines changed

projects/hip-tests/catch/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ If there arises a condition where certain flag is disabled and due to which a te
154154
```cpp
155155
TEST_CASE("TestOnlyOnXnack") {
156156
if(!XNACKEnabled) {
157-
HipTest::HIP_SKIP_TEST("Test only runs on system with XNACK enabled");
157+
HipTest::HIP_SKIP_TEST(HipTest::SkipReason::kGpuXnackNotEnabled);
158158
return;
159159
}
160160
// Rest of test functionality

projects/hip-tests/catch/include/hip_test_checkers.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ static bool assemblyFile_Verification(std::string assemfilename, std::string ins
376376
}
377377
} else {
378378
result = true;
379-
HipTest::HIP_SKIP_TEST(HipTest::SkipReason::kAssemblyFileMissing);
379+
HipTest::HIP_SKIP_TEST("Skipped: expected assembly file not found.");
380380
}
381381
return result;
382382
}

projects/hip-tests/catch/include/hip_test_common.hh

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -483,25 +483,43 @@ inline constexpr char const kNotEnoughGpusMaskedTests[] =
483483
"Skipped: not enough GPUs for masked GPU tests.";
484484
inline constexpr char const kMipmappedArraysUnsupported[] =
485485
"Skipped: mipmapped arrays are not supported on this device or configuration.";
486-
inline constexpr char const kAssemblyFileMissing[] = "Skipped: expected assembly file not found.";
487486
inline constexpr char const kCooperativeLaunchUnsupported[] =
488487
"Skipped: cooperative launch is not supported.";
489488
inline constexpr char const kPcieAtomicUnsupported[] =
490489
"Skipped: PCIe atomics are not supported on this device.";
491490
inline constexpr char const kStreamWaitValueUnsupported[] =
492491
"Skipped: hipStreamWaitValue is not supported on this device.";
492+
inline constexpr char const kStreamPriorityRangeUnsupported[] =
493+
"Skipped: stream priority range is not supported on this device.";
493494
inline constexpr char const kWarpShuffleUnsupported[] =
494495
"Skipped: warp shuffle is not supported on this device.";
495496
inline constexpr char const kWarpVoteUnsupported[] =
496497
"Skipped: warp vote is not supported on this device.";
497-
inline constexpr char const kWarpBallotUnsupported[] =
498-
"Skipped: warp ballot is not supported on this device.";
499498
inline constexpr char const kVmmUnsupported[] =
500499
"Skipped: virtual memory management (VMM) is not supported.";
501-
inline constexpr char const kLargeBarUnsupported[] =
502-
"Skipped: large BAR (resizable BAR) is not supported on this device.";
503500
inline constexpr char const kFineGrainHwUnsupported[] =
504501
"Skipped: fine-grained memory / atomic hardware support is not available on this device.";
502+
inline constexpr char const kTextureImageUnsupported[] =
503+
"Skipped: texture/image is not supported on this device.";
504+
inline constexpr char const kApiUnsupportedOnNvidia[] =
505+
"Skipped: API is not supported on NVIDIA; test skipped.";
506+
inline constexpr char const kTextureGatherUnsupportedAmd[] =
507+
"Skipped: texture gather arrays are not supported on AMD backend.";
508+
inline constexpr char const kGlewInitFailed[] = "Skipped: GLEW initialization failed.";
509+
inline constexpr char const kAssertionsDisabled[] =
510+
"Skipped: assertions are disabled in this build.";
511+
inline constexpr char const kManagedMemoryOrNumaSetupUnavailable[] =
512+
"Skipped: managed-memory-capable device or NUMA setup not available.";
513+
inline constexpr char const kConcurrentKernelExecutionUnsupported[] =
514+
"Skipped: concurrent kernel execution is not supported.";
515+
inline constexpr char const kManagedAttachScenarioRequiresNoConcurrentAccess[] =
516+
"Skipped: test targets devices without concurrent managed access.";
517+
inline constexpr char const kGpuXnackNotEnabled[] =
518+
"Skipped: GPU is not XNACK-enabled.";
519+
inline constexpr char const kMemcpyPeerSameSrcDstDevice[] =
520+
"Skipped: source and destination device are the same.";
521+
inline constexpr char const kRequiredDeviceCountNotMet[] =
522+
"Skipped: required number of devices is not available.";
505523
} // namespace SkipReason
506524

507525
/**
@@ -672,7 +690,7 @@ class BlockingContext {
672690
// is supported on the current device.
673691
#define CHECK_IMAGE_SUPPORT \
674692
if (!HipTest::isImageSupported()) { \
675-
HipTest::HIP_SKIP_TEST("Texture is not supported on the device. Skipped."); \
693+
HipTest::HIP_SKIP_TEST(HipTest::SkipReason::kTextureImageUnsupported); \
676694
return; \
677695
}
678696

@@ -694,7 +712,7 @@ class BlockingContext {
694712
// skip the current test if they are not available.
695713
#define CHECK_WARP_MATCH_FUNCTIONS_SUPPORT \
696714
if (!HipTest::areWarpMatchFunctionsSupported()) { \
697-
HipTest::HIP_SKIP_TEST("Warp Match Functions are not supported on the device. Skipped."); \
715+
HipTest::HIP_SKIP_TEST("Skipped: warp match functions are not supported on this device."); \
698716
return; \
699717
}
700718

projects/hip-tests/catch/include/memcpy1d_tests_common.hh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,7 @@ void MemcpyDeviceToDeviceShell(F memcpy_func, const hipStream_t kernel_stream =
126126
int can_access_peer = 0;
127127
HIP_CHECK(hipDeviceCanAccessPeer(&can_access_peer, src_device, dst_device));
128128
if (!can_access_peer) {
129-
std::string msg = "Skipped as peer access cannot be enabled between devices " +
130-
std::to_string(src_device) + " " + std::to_string(dst_device);
131-
HipTest::HIP_SKIP_TEST(msg.c_str());
129+
HipTest::HIP_SKIP_TEST(HipTest::SkipReason::kPeerAccessUnavailable);
132130
return;
133131
}
134132
HIP_CHECK(hipDeviceEnablePeerAccess(dst_device, 0));

projects/hip-tests/catch/include/memcpy3d_tests_common.hh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,7 @@ void Memcpy3DDeviceToDeviceShell(F memcpy_func, hipStream_t kernel_stream = null
173173
int can_access_peer = 0;
174174
HIP_CHECK(hipDeviceCanAccessPeer(&can_access_peer, src_device, dst_device));
175175
if (!can_access_peer) {
176-
std::string msg = "Skipped as peer access cannot be enabled between devices " +
177-
std::to_string(src_device) + " " + std::to_string(dst_device);
178-
HipTest::HIP_SKIP_TEST(msg.c_str());
176+
HipTest::HIP_SKIP_TEST(HipTest::SkipReason::kPeerAccessUnavailable);
179177
if (device_count > 0 && kernel_stream != nullptr && kernel_stream != hipStreamPerThread) {
180178
HIP_CHECK(hipStreamDestroy(kernel_stream));
181179
}

projects/hip-tests/catch/multiproc/hipDeviceGetPCIBusIdMproc.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ HIP_TEST_CASE(Unit_hipDeviceGetPCIBusId_CheckPciBusIDWithLspci) {
198198
pclose(fpipe);
199199

200200
if (lspciCheck == nullptr) {
201-
WARN("Skipping test as lspci is not found in system");
201+
HipTest::HIP_SKIP_TEST("Skipped: lspci is not available on this system.");
202202
return;
203203
}
204204
}

projects/hip-tests/catch/multiproc/hipIpcEventHandle.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ HIP_TEST_CASE(Unit_hipIpcEventHandle_Functional) {
235235
getDevices(shmDevices);
236236

237237
if (shmDevices->count < 2) {
238-
WARN("Test requires atleast two GPUs with P2P access. Skipping test.");
238+
HipTest::HIP_SKIP_TEST(HipTest::SkipReason::kFewerThanTwoGpus);
239239
return;
240240
}
241241

projects/hip-tests/catch/multiproc/hipMemCoherencyTstMProc.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ HIP_TEST_CASE(Unit_malloc_CoherentTst) {
109109
REQUIRE(ret);
110110
}
111111
} else {
112-
HipTest::HIP_SKIP_TEST("GPU is not xnack enabled hence skipping the test...\n");
112+
HipTest::HIP_SKIP_TEST(HipTest::SkipReason::kGpuXnackNotEnabled);
113113
}
114114
}
115115
#endif
@@ -142,7 +142,7 @@ HIP_TEST_CASE(Unit_malloc_CoherentTstWthAdvise) {
142142
free(Ptr);
143143
}
144144
} else {
145-
HipTest::HIP_SKIP_TEST("GPU is not xnack enabled hence skipping the test...\n");
145+
HipTest::HIP_SKIP_TEST(HipTest::SkipReason::kGpuXnackNotEnabled);
146146
}
147147
}
148148
#endif
@@ -176,7 +176,7 @@ HIP_TEST_CASE(Unit_mmap_CoherentTst) {
176176
REQUIRE(ret);
177177
}
178178
} else {
179-
HipTest::HIP_SKIP_TEST("GPU is not xnack enabled hence skipping the test...\n");
179+
HipTest::HIP_SKIP_TEST(HipTest::SkipReason::kGpuXnackNotEnabled);
180180
}
181181
}
182182
#endif
@@ -220,7 +220,7 @@ HIP_TEST_CASE(Unit_mmap_CoherentTstWthAdvise) {
220220
HIP_CHECK(hipStreamDestroy(strm));
221221
}
222222
} else {
223-
HipTest::HIP_SKIP_TEST("GPU is not xnack enabled hence skipping the test...\n");
223+
HipTest::HIP_SKIP_TEST(HipTest::SkipReason::kGpuXnackNotEnabled);
224224
}
225225
}
226226
#endif

projects/hip-tests/catch/multiproc/hipSetGetDeviceMproc.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ static void testValidDevices(int numDevices, bool useRocrEnv, int* deviceList,
156156
std::string visibleDeviceString;
157157

158158
if ((NULL == deviceList) || ((deviceListLength < 1) || deviceListLength > numDevices)) {
159-
INFO("Invalid argument for number of devices. Skipping current test");
160-
REQUIRE(false);
159+
HipTest::HIP_SKIP_TEST("Skipped: invalid device list arguments for multiproc test.");
160+
return;
161161
}
162162

163163
for (int i = 0; i < deviceListLength; i++) {

projects/hip-tests/catch/performance/memcpy/memcpy_performance_common.hh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,7 @@ static std::tuple<int, int> GetDeviceIds(bool enable_peer_access) {
8080
int can_access_peer = 0;
8181
HIP_CHECK(hipDeviceCanAccessPeer(&can_access_peer, src_device, dst_device));
8282
if (!can_access_peer) {
83-
std::string msg = "Skipped as peer access cannot be enabled between devices " +
84-
std::to_string(src_device) + " " + std::to_string(dst_device);
85-
HipTest::HIP_SKIP_TEST(msg.c_str());
83+
HipTest::HIP_SKIP_TEST(HipTest::SkipReason::kPeerAccessUnavailable);
8684
return {-1, -1};
8785
}
8886
HIP_CHECK(hipDeviceEnablePeerAccess(dst_device, 0));

0 commit comments

Comments
 (0)