SWDEV-385161 - Deprecate usage of env vars in HIP samples and tests (#363)

* SWDEV-385161 - Deprecate usage of env vars in HIP samples and tests env vars such as HIP_PATH, ROCM_PATH, HIP_COMPILER, HIP_RUNTIME, HSA_PATH etc are removed.

Change-Id: I280e20b291cfb14675846aae72d97fa5b3ad567d
Цей коміт міститься в:
ROCm CI Service Account
2023-08-14 12:06:14 +05:30
зафіксовано GitHub
джерело 11e8609b90
коміт 34976df246
89 змінених файлів з 184 додано та 1567 видалено
-5
Переглянути файл
@@ -43,12 +43,7 @@ __global__ void readFromTexture(T* output, hipTextureObject_t texObj, size_t wid
} else {
const float v = y / (float)height;
if (textureGather) {
// tex2Dgather not supported on __gfx90a__
#if !defined(__gfx90a__)
output[y * width + x] = tex2Dgather<T>(texObj, u, v, ChannelToRead);
#else
#warning("tex2Dgather not supported on gfx90a");
#endif
} else {
output[y * width + x] = tex2D<T>(texObj, u, v);
}
+1 -1
Переглянути файл
@@ -54,7 +54,7 @@ static void ArrayCreate_DiffSizes(int gpu) {
std::vector<std::pair<size_t, size_t>> runs {std::make_pair(NUM_W, NUM_H), std::make_pair(BIGNUM_W, BIGNUM_H)};
for (const auto& size : runs) {
std::array<HIP_ARRAY, ARRAY_LOOP> array;
size_t pavail, avail;
size_t pavail;
HIP_CHECK_THREAD(hipMemGetInfo(&pavail, nullptr));
HIP_ARRAY_DESCRIPTOR desc;
desc.NumChannels = 1;
+1 -1
Переглянути файл
@@ -26,7 +26,7 @@ TEST_CASE("Unit_hipFreeAsync_negative") {
HIP_CHECK(hipSetDevice(0));
void* p = nullptr;
hipStream_t stream{nullptr};
hipStreamCreate(&stream);
HIP_CHECK(hipStreamCreate(&stream));
SECTION("dev_ptr is nullptr") { REQUIRE(hipFreeAsync(nullptr, stream) != hipSuccess); }
+1 -1
Переглянути файл
@@ -43,7 +43,7 @@ static void MemoryAlloc3DDiffSizes(int gpu) {
size_t height{sizes}, depth{sizes};
hipPitchedPtr devPitchedPtr[CHUNK_LOOP];
hipExtent extent = make_hipExtent(width, height, depth);
size_t tot, avail, ptot, pavail;
size_t ptot, pavail;
HIPCHECK(hipMemGetInfo(&pavail, &ptot));
for (int i = 0; i < CHUNK_LOOP; i++) {
HIPCHECK(hipMalloc3D(&devPitchedPtr[i], extent));
+15 -5
Переглянути файл
@@ -399,12 +399,22 @@ TEMPLATE_TEST_CASE("Unit_hipMallocArray_happy", "", uint, int, int4, ushort, sho
testArrayAsSurface<TestType>(arrayPtr, width, height);
}
SECTION("hipArrayTextureGather") {
height = 1024;
INFO("flag is hipArrayTextureGather");
INFO("height: " << height);
hipDeviceProp_t prop;
int device;
HIP_CHECK(hipGetDevice(&device));
HIP_CHECK(hipGetDeviceProperties(&prop, device));
// tex2Dgather not supported on gfx90a
if (std::string(prop.gcnArchName).find("gfx90a") == std::string::npos) {
height = 1024;
INFO("flag is hipArrayTextureGather");
INFO("height: " << height);
HIP_CHECK(hipMallocArray(&arrayPtr, &desc, width, height, hipArrayTextureGather));
testArrayAsTextureWithGather<TestType>(arrayPtr, width, height);
HIP_CHECK(hipMallocArray(&arrayPtr, &desc, width, height, hipArrayTextureGather));
testArrayAsTextureWithGather<TestType>(arrayPtr, width, height);
} else {
SUCCEED("tex2Dgather is not supported for gfx90a, Hence"
"skipping the testcase for this device " << device);
}
}
#endif
+3 -3
Переглянути файл
@@ -82,7 +82,7 @@ static std::atomic<bool> g_thTestPassed{true};
/**
* Validates data consistency on supplied gpu
*/
static bool validateMemoryOnGPU(int gpu, bool concurOnOneGPU = false) {
static bool validateMemoryOnGPU(int gpu) {
int *A_d, *B_d, *C_d;
int *A_h, *B_h, *C_h;
bool TestPassed = true;
@@ -148,7 +148,7 @@ static bool regressAllocInLoop(int gpu) {
* Validates data consistency on supplied gpu
* In Multithreaded Environment
*/
static bool validateMemoryOnGpuMThread(int gpu, bool concurOnOneGPU = false) {
static bool validateMemoryOnGpuMThread(int gpu) {
int *A_d, *B_d, *C_d;
int *A_h, *B_h, *C_h;
bool TestPassed = true;
@@ -213,7 +213,7 @@ static bool regressAllocInLoopMthread(int gpu) {
* Thread func to regress alloc and check data consistency
*/
static void threadFunc(int gpu) {
g_thTestPassed = regressAllocInLoopMthread(gpu) && validateMemoryOnGpuMThread(gpu, true);
g_thTestPassed = regressAllocInLoopMthread(gpu) && validateMemoryOnGpuMThread(gpu);
UNSCOPED_INFO("thread execution status on gpu" << gpu << ":" << g_thTestPassed.load());
}
+2 -1
Переглянути файл
@@ -31,7 +31,7 @@ THE SOFTWARE.
*/
TEST_CASE("Unit_hipMemAdvise_MmapMem") {
int managed = 0, NUM_ELMS = 212992, PageableMem = 0;
int managed = 0, PageableMem = 0;
INFO("The following are the attribute values related to HMM for"
" device 0:\n");
HIP_CHECK(hipDeviceGetAttribute(&managed,
@@ -54,6 +54,7 @@ TEST_CASE("Unit_hipMemAdvise_MmapMem") {
#ifdef __linux__
// For now this test is enabled only for linux platforms
FILE *fptr;
int NUM_ELMS = 212992;
fptr = fopen("ForTest1.txt", "w");
for (int m = 0; m < NUM_ELMS; ++m) {
putw(m, fptr);
-1
Переглянути файл
@@ -666,7 +666,6 @@ TEST_CASE("Unit_hipMemAdvise_TstAlignedAllocMem") {
std::string gfxName(prop.gcnArchName);
if (gfxName.find("xnack+") != std::string::npos) {
int stat = 0;
int managedMem = 0, pageMemAccess = 0;
HIP_CHECK(hipDeviceGetAttribute(&pageMemAccess,
hipDeviceAttributePageableMemoryAccess, 0));
+1 -1
Переглянути файл
@@ -26,6 +26,7 @@ THE SOFTWARE.
#include <hip_test_common.hh>
#define MEM_SIZE 8192
#ifdef __linux__
static bool CheckError(hipError_t err, int LineNo) {
if (err == hipSuccess) {
WARN("Error expected but received hipSuccess at line no.:"
@@ -59,7 +60,6 @@ static int HmmAttrPrint() {
return managed;
}
#ifdef __linux__
/* Test Scenario: Testing basic working of hipMemRangeGetAttributes()
api with different flags */
+2
Переглянути файл
@@ -28,6 +28,8 @@ THE SOFTWARE.
#include <resource_guards.hh>
#include <utils.hh>
#pragma clang diagnostic ignored "-Wunused-variable"
TEST_CASE("Unit_hipMemcpy3D_Positive_Basic") {
constexpr bool async = false;
+2
Переглянути файл
@@ -28,6 +28,8 @@ THE SOFTWARE.
#include <resource_guards.hh>
#include <utils.hh>
#pragma clang diagnostic ignored "-Wunused-variable"
TEST_CASE("Unit_hipMemcpy3DAsync_Positive_Basic") {
constexpr bool async = true;