Extend ROCr to surface UUID of GPU devices that suppport

Change-Id: I478db68d69a01578770403fa695f9e6391637573
This commit is contained in:
Ramesh Errabolu authored and Sean Keely committed 2020-04-08 19:19:22 -05:00
1 parent 241cdfdd01
commit 45958c727d
7 files changed
+61 -5

No files matched your search

+3
View File
@@ -72,6 +72,7 @@ class Flag {
enable_sdma_ = os::GetEnvVar("HSA_ENABLE_SDMA");
visible_gpus_ = os::GetEnvVar("ROCR_VISIBLE_DEVICES");
filter_visible_gpus_ = os::IsEnvVarSet("ROCR_VISIBLE_DEVICES");
var = os::GetEnvVar("HSA_RUNNING_UNDER_VALGRIND");
running_valgrind_ = (var == "1") ? true : false;
@@ -143,6 +144,7 @@ class Flag {
std::string enable_sdma() const { return enable_sdma_; }
std::string visible_gpus() const { return visible_gpus_; }
bool filter_visible_gpus() const { return filter_visible_gpus_; }
uint32_t max_queues() const { return max_queues_; }
@@ -167,6 +169,7 @@ class Flag {
std::string enable_sdma_;
bool filter_visible_gpus_;
std::string visible_gpus_;
uint32_t max_queues_;
@@ -237,6 +237,12 @@ bool WaitForAllThreads(Thread* threads, uint threadCount) {
return true;
}
bool IsEnvVarSet(std::string env_var_name) {
char* buff = NULL;
buff = getenv(env_var_name.c_str());
return (buff != NULL);
}
void SetEnvVar(std::string env_var_name, std::string env_var_value) {
setenv(env_var_name.c_str(), env_var_value.c_str(), 1);
}
+6
View File
@@ -152,6 +152,12 @@ bool WaitForThread(Thread thread);
/// @return: bool.
bool WaitForAllThreads(Thread* threads, uint thread_count);
/// @brief: Determines if environment key is set.
/// @param: env_var_name(Input), name of the environment value.
/// @return: bool, true for binding any value to environment key,
/// including an empty string. False otherwise
bool IsEnvVarSet(std::string env_var_name);
/// @brief: Sets the environment value.
/// @param: env_var_name(Input), name of the environment value.
/// @param: env_var_value(Input), value of the environment value.s