Skip to content

Commit

Permalink
Updating HMM test
Browse files Browse the repository at this point in the history
  • Loading branch information
stanleytsang-amd committed Jun 3, 2021
1 parent 392ea3d commit f82f00a
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions test/test_device_ptr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#include "test_header.hpp"

#define HIP_CHECK(condition) \
#define HIP_CHECK_HMM(condition) \
{ \
hipError_t error = condition; \
if(error != hipSuccess){ \
Expand All @@ -47,16 +47,25 @@ bool supports_hmm()
{
hipDeviceProp_t device_prop;
int device_id;
HIP_CHECK(hipGetDevice(&device_id));
HIP_CHECK(hipGetDeviceProperties(&device_prop, device_id));
HIP_CHECK_HMM(hipGetDevice(&device_id));
HIP_CHECK_HMM(hipGetDeviceProperties(&device_prop, device_id));
if (device_prop.managedMemory == 1) return true;

return false;
}

bool use_hmm()
{
return std::getenv("ROCTHRUST_USE_HMM");
if (getenv("ROCTHRUST_USE_HMM") == nullptr)
{
return false;
}

if (strcmp(getenv("ROCTHRUST_USE_HMM"), "1") == 0)
{
return true;
}
return false;
}

TEST(DevicePtrTests, TestDevicePointerManipulation)
Expand Down

0 comments on commit f82f00a

Please sign in to comment.