Skip to content

Commit 5f18669

Browse files
rocrtst: Add check for SVM support in Runtime (#1696)
Signed-off-by: Apurv Mishra <Apurv.Mishra@amd.com>
1 parent e2071e0 commit 5f18669

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

rocrtst/suites/functional/svm_memory.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,16 @@ void SvmMemoryTestBasic::TestCreateDestroy(hsa_agent_t agent, hsa_amd_memory_poo
301301

302302
void SvmMemoryTestBasic::TestCreateDestroy(void) {
303303
hsa_status_t err;
304+
305+
// Check if SVM is supported by the ROCr runtime
306+
bool svm_supported = false;
307+
err = hsa_system_get_info(HSA_AMD_SYSTEM_INFO_SVM_SUPPORTED, &svm_supported);
308+
309+
if (err != HSA_STATUS_SUCCESS || !svm_supported) {
310+
std::cout << " *** SVM is not supported - skipping CreateDestroy test ***" << std::endl;
311+
return;
312+
}
313+
304314
std::vector<std::shared_ptr<rocrtst::agent_pools_t>> agent_pools;
305315

306316
if (verbosity() > 0) {

0 commit comments

Comments
 (0)