move getEnvVar function to common (#299)

[ROCm/rocdecode commit: d5b5a31881]
This commit is contained in:
Lakshmi Kumar
2024-03-26 16:07:13 -07:00
committed by GitHub
parent a05ef46999
commit 2fa48d1f1d
5 changed files with 14 additions and 15 deletions
@@ -1104,15 +1104,3 @@ bool RocVideoDecoder::InitHIP(int device_id) {
HIP_API_CALL(hipStreamCreate(&hip_stream_));
return true;
}
int GetEnvVar(const char *name, int &dev_count) {
char *v = std::getenv(name);
if (v) {
char* p_tkn = std::strtok(v, ",");
while (p_tkn != nullptr) {
dev_count++;
p_tkn = strtok(nullptr, ",");
}
}
return dev_count;
}