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
此提交包含在:
@@ -198,8 +198,8 @@ TEST_CASE("Unit_BuiltInAtomicAdd_CoherentGlobalMemWithRtc") {
|
||||
void* config_d[] = {HIP_LAUNCH_PARAM_BUFFER_POINTER, &args_f,
|
||||
HIP_LAUNCH_PARAM_BUFFER_SIZE,
|
||||
&size, HIP_LAUNCH_PARAM_END};
|
||||
hipModuleLaunchKernel(fmaxkernel, 1, 1, 1, 1, 1, 1, 0,
|
||||
nullptr, nullptr, config_d);
|
||||
HIP_CHECK(hipModuleLaunchKernel(fmaxkernel, 1, 1, 1, 1, 1, 1, 0,
|
||||
nullptr, nullptr, config_d));
|
||||
HIP_CHECK(hipDeviceSynchronize());
|
||||
HIP_CHECK(hipMemcpy(B_h, result, sizeof(double), hipMemcpyDeviceToHost));
|
||||
REQUIRE(A_h[0] == INITIAL_VAL);
|
||||
@@ -278,8 +278,8 @@ TEST_CASE("Unit_BuiltInAtomicAdd_NonCoherentGlobalMemWithRtc") {
|
||||
void* config_d[] = {HIP_LAUNCH_PARAM_BUFFER_POINTER, &args_f,
|
||||
HIP_LAUNCH_PARAM_BUFFER_SIZE,
|
||||
&size, HIP_LAUNCH_PARAM_END};
|
||||
hipModuleLaunchKernel(fmaxkernel, 1, 1, 1, 1, 1, 1, 0,
|
||||
nullptr, nullptr, config_d);
|
||||
HIP_CHECK(hipModuleLaunchKernel(fmaxkernel, 1, 1, 1, 1, 1, 1, 0,
|
||||
nullptr, nullptr, config_d));
|
||||
HIP_CHECK(hipDeviceSynchronize());
|
||||
HIP_CHECK(hipMemcpy(B_h, result, sizeof(double), hipMemcpyDeviceToHost));
|
||||
REQUIRE(A_h[0] == INITIAL_VAL + INC_VAL);
|
||||
|
||||
@@ -229,8 +229,8 @@ TEST_CASE("Unit_BuiltinAtomicsRTC_fmaxCoherentGlobalMem") {
|
||||
void* config_d[] = {HIP_LAUNCH_PARAM_BUFFER_POINTER, &args_f,
|
||||
HIP_LAUNCH_PARAM_BUFFER_SIZE,
|
||||
&size, HIP_LAUNCH_PARAM_END};
|
||||
hipModuleLaunchKernel(fmaxkernel, 1, 1, 1, 1, 1, 1, 0,
|
||||
nullptr, nullptr, config_d);
|
||||
HIP_CHECK(hipModuleLaunchKernel(fmaxkernel, 1, 1, 1, 1, 1, 1, 0,
|
||||
nullptr, nullptr, config_d));
|
||||
HIP_CHECK(hipDeviceSynchronize());
|
||||
HIP_CHECK(hipMemcpy(B_h, result, sizeof(double), hipMemcpyDeviceToHost));
|
||||
REQUIRE(*B_h == 0);
|
||||
@@ -324,8 +324,8 @@ TEST_CASE("Unit_BuiltinAtomicsRTC_fmaxNonCoherentGlobalFlatMem") {
|
||||
void* config_d[] = {HIP_LAUNCH_PARAM_BUFFER_POINTER, &args_f,
|
||||
HIP_LAUNCH_PARAM_BUFFER_SIZE,
|
||||
&size, HIP_LAUNCH_PARAM_END};
|
||||
hipModuleLaunchKernel(fmaxkernel, 1, 1, 1, 1, 1, 1, 0,
|
||||
nullptr, nullptr, config_d);
|
||||
HIP_CHECK(hipModuleLaunchKernel(fmaxkernel, 1, 1, 1, 1, 1, 1, 0,
|
||||
nullptr, nullptr, config_d));
|
||||
HIP_CHECK(hipDeviceSynchronize());
|
||||
HIP_CHECK(hipMemcpy(B_h, result, sizeof(double), hipMemcpyDeviceToHost));
|
||||
REQUIRE(*B_h == INITIAL_VAL);
|
||||
|
||||
@@ -230,8 +230,8 @@ TEST_CASE("Unit_BuiltinAtomicsRTC__fminCoherentGlobalMem") {
|
||||
void* config_d[] = {HIP_LAUNCH_PARAM_BUFFER_POINTER, &args_f,
|
||||
HIP_LAUNCH_PARAM_BUFFER_SIZE,
|
||||
&size, HIP_LAUNCH_PARAM_END};
|
||||
hipModuleLaunchKernel(fmaxkernel, 1, 1, 1, 1, 1, 1, 0,
|
||||
nullptr, nullptr, config_d);
|
||||
HIP_CHECK(hipModuleLaunchKernel(fmaxkernel, 1, 1, 1, 1, 1, 1, 0,
|
||||
nullptr, nullptr, config_d));
|
||||
HIP_CHECK(hipDeviceSynchronize());
|
||||
HIP_CHECK(hipMemcpy(B_h, result, sizeof(double), hipMemcpyDeviceToHost));
|
||||
REQUIRE(*B_h == 0);
|
||||
@@ -327,8 +327,8 @@ TEST_CASE("Unit_BuiltinAtomicsRTC_fminNonCoherentGlobalFlatMem") {
|
||||
void* config_d[] = {HIP_LAUNCH_PARAM_BUFFER_POINTER, &args_f,
|
||||
HIP_LAUNCH_PARAM_BUFFER_SIZE,
|
||||
&size, HIP_LAUNCH_PARAM_END};
|
||||
hipModuleLaunchKernel(fmaxkernel, 1, 1, 1, 1, 1, 1, 0,
|
||||
nullptr, nullptr, config_d);
|
||||
HIP_CHECK(hipModuleLaunchKernel(fmaxkernel, 1, 1, 1, 1, 1, 1, 0,
|
||||
nullptr, nullptr, config_d));
|
||||
HIP_CHECK(hipDeviceSynchronize());
|
||||
HIP_CHECK(hipMemcpy(B_h, result, sizeof(double), hipMemcpyDeviceToHost));
|
||||
REQUIRE(*B_h == INITIAL_VAL);
|
||||
|
||||
@@ -22,6 +22,7 @@ THE SOFTWARE.
|
||||
#include <hip_test_checkers.hh>
|
||||
#include <complex>
|
||||
|
||||
#pragma clang diagnostic ignored "-Wunused-variable"
|
||||
// Tolerance for error
|
||||
const double tolerance = 1e-6;
|
||||
|
||||
|
||||
@@ -126,8 +126,8 @@ TEMPLATE_TEST_CASE("Unit_unsafeAtomicAdd_CoherentRTCnounsafeatomicflag", "",
|
||||
void* config_d[] = {HIP_LAUNCH_PARAM_BUFFER_POINTER, &args_f,
|
||||
HIP_LAUNCH_PARAM_BUFFER_SIZE,
|
||||
&size, HIP_LAUNCH_PARAM_END};
|
||||
hipModuleLaunchKernel(f_kernel, 1, 1, 1, 1, 1, 1, 0,
|
||||
nullptr, nullptr, config_d);
|
||||
HIP_CHECK(hipModuleLaunchKernel(f_kernel, 1, 1, 1, 1, 1, 1, 0,
|
||||
nullptr, nullptr, config_d));
|
||||
HIP_CHECK(hipDeviceSynchronize());
|
||||
REQUIRE(A_h[0] == INITIAL_VAL);
|
||||
REQUIRE(*result == 0);
|
||||
@@ -218,8 +218,8 @@ TEMPLATE_TEST_CASE("Unit_unsafeAtomicAdd_CoherentRTCunsafeatomicflag", "",
|
||||
void* config_d[] = {HIP_LAUNCH_PARAM_BUFFER_POINTER, &args_f,
|
||||
HIP_LAUNCH_PARAM_BUFFER_SIZE,
|
||||
&size, HIP_LAUNCH_PARAM_END};
|
||||
hipModuleLaunchKernel(f_kernel, 1, 1, 1, 1, 1, 1, 0,
|
||||
nullptr, nullptr, config_d);
|
||||
HIP_CHECK(hipModuleLaunchKernel(f_kernel, 1, 1, 1, 1, 1, 1, 0,
|
||||
nullptr, nullptr, config_d));
|
||||
HIP_CHECK(hipDeviceSynchronize());
|
||||
REQUIRE(A_h[0] == INITIAL_VAL);
|
||||
REQUIRE(*result == 0);
|
||||
@@ -306,8 +306,8 @@ TEMPLATE_TEST_CASE("Unit_unsafeAtomicAdd_CoherentRTCwithoutflag", "",
|
||||
void* config_d[] = {HIP_LAUNCH_PARAM_BUFFER_POINTER, &args_f,
|
||||
HIP_LAUNCH_PARAM_BUFFER_SIZE,
|
||||
&size, HIP_LAUNCH_PARAM_END};
|
||||
hipModuleLaunchKernel(f_kernel, 1, 1, 1, 1, 1,
|
||||
1, 0, nullptr, nullptr, config_d);
|
||||
HIP_CHECK(hipModuleLaunchKernel(f_kernel, 1, 1, 1, 1, 1,
|
||||
1, 0, nullptr, nullptr, config_d));
|
||||
HIP_CHECK(hipDeviceSynchronize());
|
||||
REQUIRE(A_h[0] == INITIAL_VAL);
|
||||
REQUIRE(*result == 0);
|
||||
@@ -392,8 +392,8 @@ TEMPLATE_TEST_CASE("Unit_unsafeAtomicAdd_NonCoherentRTCnounsafeatomicflag", "",
|
||||
void* config_d[] = {HIP_LAUNCH_PARAM_BUFFER_POINTER, &args_f,
|
||||
HIP_LAUNCH_PARAM_BUFFER_SIZE,
|
||||
&size, HIP_LAUNCH_PARAM_END};
|
||||
hipModuleLaunchKernel(f_kernel, 1, 1, 1, 1, 1, 1, 0,
|
||||
nullptr, nullptr, config_d);
|
||||
HIP_CHECK(hipModuleLaunchKernel(f_kernel, 1, 1, 1, 1, 1, 1, 0,
|
||||
nullptr, nullptr, config_d));
|
||||
HIP_CHECK(hipDeviceSynchronize());
|
||||
REQUIRE(A_h[0] == INITIAL_VAL + INCREMENT_VAL);
|
||||
REQUIRE(*result == INITIAL_VAL);
|
||||
@@ -480,8 +480,8 @@ TEMPLATE_TEST_CASE("Unit_unsafeAtomicAdd_NonCoherentRTCunsafeatomicflag", "",
|
||||
void* config_d[] = {HIP_LAUNCH_PARAM_BUFFER_POINTER, &args_f,
|
||||
HIP_LAUNCH_PARAM_BUFFER_SIZE,
|
||||
&size, HIP_LAUNCH_PARAM_END};
|
||||
hipModuleLaunchKernel(f_kernel, 1, 1, 1, 1, 1, 1, 0,
|
||||
nullptr, nullptr, config_d);
|
||||
HIP_CHECK(hipModuleLaunchKernel(f_kernel, 1, 1, 1, 1, 1, 1, 0,
|
||||
nullptr, nullptr, config_d));
|
||||
HIP_CHECK(hipDeviceSynchronize());
|
||||
REQUIRE(A_h[0] == INITIAL_VAL + INCREMENT_VAL);
|
||||
REQUIRE(*result == INITIAL_VAL);
|
||||
@@ -568,8 +568,8 @@ TEMPLATE_TEST_CASE("Unit_unsafeAtomicAdd_NonCoherentRTC", "",
|
||||
void* config_d[] = {HIP_LAUNCH_PARAM_BUFFER_POINTER, &args_f,
|
||||
HIP_LAUNCH_PARAM_BUFFER_SIZE,
|
||||
&size, HIP_LAUNCH_PARAM_END};
|
||||
hipModuleLaunchKernel(f_kernel, 1, 1, 1, 1, 1, 1, 0,
|
||||
nullptr, nullptr, config_d);
|
||||
HIP_CHECK(hipModuleLaunchKernel(f_kernel, 1, 1, 1, 1, 1, 1, 0,
|
||||
nullptr, nullptr, config_d));
|
||||
HIP_CHECK(hipDeviceSynchronize());
|
||||
REQUIRE(A_h[0] == INITIAL_VAL + INCREMENT_VAL);
|
||||
REQUIRE(*result == INITIAL_VAL);
|
||||
|
||||
新增問題並參考
封鎖使用者