Adding support for reading Environmental variable for samples (#186)
* check if env var set and choose device
* clean up for env var
* app modification
* move getEnvVar function to header
* fork example
* spacing adjust
* review comments
* use hipGetErrorName to throw errors
[ROCm/rocdecode commit: 8ec38d2d24]
Esse commit está contido em:
@@ -1078,3 +1078,15 @@ 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;
|
||||
}
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário