diff --git a/hipamd/tests/src/hipEnvVar.cpp b/hipamd/tests/src/hipEnvVar.cpp index 2b2b0afcff..c1b6589fe2 100644 --- a/hipamd/tests/src/hipEnvVar.cpp +++ b/hipamd/tests/src/hipEnvVar.cpp @@ -44,7 +44,7 @@ int main(int argc, char **argv) //std::cout << "The current env HIP_VISIBLE_DEVICES is"< 2){ setenv("HIP_VISIBLE_DEVICES","0,1,1000,2",1); + setenv("CUDA_VISIBLE_DEVICES","0,1,1000,2",1); assert(getDeviceNumber() == 2); setenv("HIP_VISIBLE_DEVICES","0,1,2",1); + setenv("CUDA_VISIBLE_DEVICES","0,1,2",1); assert(getDeviceNumber() == 3); // test if CUDA_VISIBLE_DEVICES will be accepted by the runtime unsetenv("HIP_VISIBLE_DEVICES"); + unsetenv("CUDA_VISIBLE_DEVICES"); setenv("CUDA_VISIBLE_DEVICES","0,1,2",1); assert(getDeviceNumber() == 3); } setenv("HIP_VISIBLE_DEVICES","-100,0,1",1); + setenv("CUDA_VISIBLE_DEVICES","-100,0,1",1); assert(getDeviceNumber() == 0); std::cout << "PASSED" << std::endl;