"docs/references/setup_github_runner.md" did not exist on "ba80c102f9b48411ffb03ca9898f608e483ace48"
Unverified Commit 2e776d28 authored by rerrabolu's avatar rerrabolu Committed by GitHub
Browse files

Merge pull request #4 from RadeonOpenCompute/addValidationMode

Update help screen with Validation Mode
parents 48f82ce6 77fb490d
...@@ -72,7 +72,7 @@ int main(int argc, char** argv) { ...@@ -72,7 +72,7 @@ int main(int argc, char** argv) {
if (arg_cnt != 1) { if (arg_cnt != 1) {
bw_test1.Display(); bw_test1.Display();
bw_test1.Close(); bw_test1.Close();
return 0; return bw_test1.GetExitValue();
} }
// Run the second iteration of copy requests // Run the second iteration of copy requests
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
#include <unistd.h> #include <unistd.h>
#include <cctype> #include <cctype>
#include <sstream> #include <sstream>
#include <limits>
// The values are in megabytes at allocation time // The values are in megabytes at allocation time
const uint32_t RocmBandwidthTest::SIZE_LIST[] = { 1 * 1024, const uint32_t RocmBandwidthTest::SIZE_LIST[] = { 1 * 1024,
...@@ -296,6 +297,7 @@ void RocmBandwidthTest::RunCopyBenchmark(async_trans_t& trans) { ...@@ -296,6 +297,7 @@ void RocmBandwidthTest::RunCopyBenchmark(async_trans_t& trans) {
break; break;
} }
bool verify = true;
std::vector<double> cpu_time; std::vector<double> cpu_time;
std::vector<double> gpu_time; std::vector<double> gpu_time;
for (uint32_t it = 0; it < iterations; it++) { for (uint32_t it = 0; it < iterations; it++) {
...@@ -391,9 +393,9 @@ void RocmBandwidthTest::RunCopyBenchmark(async_trans_t& trans) { ...@@ -391,9 +393,9 @@ void RocmBandwidthTest::RunCopyBenchmark(async_trans_t& trans) {
// Compare output equals input // Compare output equals input
err_ = (hsa_status_t)memcmp(validation_src, validation_dst, curr_size); err_ = (hsa_status_t)memcmp(validation_src, validation_dst, curr_size);
if (err_ != HSA_STATUS_SUCCESS) { if (err_ != HSA_STATUS_SUCCESS) {
PrintCopyAccessError(src_idx, dst_idx); verify = false;
exit_value_ = err_;
} }
ErrorCheck(err_);
} }
} }
...@@ -404,12 +406,14 @@ void RocmBandwidthTest::RunCopyBenchmark(async_trans_t& trans) { ...@@ -404,12 +406,14 @@ void RocmBandwidthTest::RunCopyBenchmark(async_trans_t& trans) {
if (print_cpu_time_ == false) { if (print_cpu_time_ == false) {
if (trans.copy.uses_gpu_) { if (trans.copy.uses_gpu_) {
// Get Gpu min copy time // Get Gpu min and mean copy times
trans.gpu_min_time_.push_back(GetMinTime(gpu_time)); double min_time = (verify) ? GetMinTime(gpu_time) : std::numeric_limits<double>::max();
// Get Gpu mean copy time and store to the array double mean_time = (verify) ? GetMeanTime(gpu_time) : std::numeric_limits<double>::max();
trans.gpu_avg_time_.push_back(GetMeanTime(gpu_time)); trans.gpu_min_time_.push_back(min_time);
trans.gpu_avg_time_.push_back(mean_time);
} }
} }
verify = true;
// Clear the stack of cpu times // Clear the stack of cpu times
cpu_time.clear(); cpu_time.clear();
...@@ -523,6 +527,8 @@ RocmBandwidthTest::RocmBandwidthTest(int argc, char** argv) : BaseTest() { ...@@ -523,6 +527,8 @@ RocmBandwidthTest::RocmBandwidthTest(int argc, char** argv) : BaseTest() {
bw_default_run_ = getenv("ROCM_BW_DEFAULT_RUN"); bw_default_run_ = getenv("ROCM_BW_DEFAULT_RUN");
bw_blocking_run_ = getenv("ROCR_BW_RUN_BLOCKING"); bw_blocking_run_ = getenv("ROCR_BW_RUN_BLOCKING");
skip_fine_grain_ = getenv("ROCM_SKIP_FINE_GRAINED_POOL"); skip_fine_grain_ = getenv("ROCM_SKIP_FINE_GRAINED_POOL");
exit_value_ = 0;
} }
RocmBandwidthTest::~RocmBandwidthTest() { } RocmBandwidthTest::~RocmBandwidthTest() { }
......
...@@ -194,6 +194,9 @@ class RocmBandwidthTest : public BaseTest { ...@@ -194,6 +194,9 @@ class RocmBandwidthTest : public BaseTest {
// @brief: Display the results // @brief: Display the results
virtual void Display() const; virtual void Display() const;
// @brief: Return exit value, useful in case of error
int32_t GetExitValue() { return exit_value_; }
private: private:
// @brief: Print Help Menu Screen // @brief: Print Help Menu Screen
...@@ -251,8 +254,8 @@ class RocmBandwidthTest : public BaseTest { ...@@ -251,8 +254,8 @@ class RocmBandwidthTest : public BaseTest {
void DisplayCopyTime(async_trans_t& trans) const; void DisplayCopyTime(async_trans_t& trans) const;
void DisplayCopyTimeMatrix(bool peak) const; void DisplayCopyTimeMatrix(bool peak) const;
void DisplayValidationMatrix() const; void DisplayValidationMatrix() const;
private: private:
// @brief: Validate the arguments passed in by user // @brief: Validate the arguments passed in by user
bool ValidateArguments(); bool ValidateArguments();
...@@ -424,6 +427,8 @@ class RocmBandwidthTest : public BaseTest { ...@@ -424,6 +427,8 @@ class RocmBandwidthTest : public BaseTest {
// static const uint32_t SIZE_LIST[4]; // static const uint32_t SIZE_LIST[4];
static const uint32_t SIZE_LIST[20]; static const uint32_t SIZE_LIST[20];
// Exit value to return in case of error
int32_t exit_value_;
}; };
#endif // __ROC_BANDWIDTH_TEST_H__ #endif // __ROC_BANDWIDTH_TEST_H__
...@@ -344,9 +344,10 @@ void RocmBandwidthTest::DisplayValidationMatrix() const { ...@@ -344,9 +344,10 @@ void RocmBandwidthTest::DisplayValidationMatrix() const {
double value = perf_matrix[(idx0 * agent_index_) + idx1]; double value = perf_matrix[(idx0 * agent_index_) + idx1];
if (value == 0) { if (value == 0) {
std::cout << "N/A"; std::cout << "N/A";
} else if (value < 1) {
std::cout << "FAIL";
} else { } else {
std::cout << "PASS"; std::cout << "PASS";
// std::cout << perf_matrix[(idx0 * agent_index_) + idx1];
} }
} }
std::cout << std::endl; std::cout << std::endl;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment