SWDEV-240804 - Add hipMemAdvise() extension
Add coarse grain memory extension. The new advice will allow HMM to disable cache coherency policy to improve performance Change-Id: I3c792d6a96896b983a7ffccddaa0ded06d183212
This commit is contained in:
1 parent
0714bdfbea
commit
2b3a4e711b
2 files changed
+11
-1
No files matched your search
@@ -237,8 +237,14 @@ typedef enum hipMemoryAdvise {
|
|||||||
hipMemAdviseUnsetPreferredLocation = 4, ///< Clear the preferred location for the data
|
hipMemAdviseUnsetPreferredLocation = 4, ///< Clear the preferred location for the data
|
||||||
hipMemAdviseSetAccessedBy = 5, ///< Data will be accessed by the specified device,
|
hipMemAdviseSetAccessedBy = 5, ///< Data will be accessed by the specified device,
|
||||||
///< so prevent page faults as much as possible
|
///< so prevent page faults as much as possible
|
||||||
hipMemAdviseUnsetAccessedBy = 6 ///< Let HIP to decide on the page faulting policy
|
hipMemAdviseUnsetAccessedBy = 6, ///< Let HIP to decide on the page faulting policy
|
||||||
///< for the specified device
|
///< for the specified device
|
||||||
|
hipMemAdviseSetCoarseGrain = 100, ///< The default memory model is fine-grain. That allows
|
||||||
|
///< coherent operations between host and device, while
|
||||||
|
///< executing kernels. The coarse-grain can be used
|
||||||
|
///< for data that only needs to be coherent at dispatch
|
||||||
|
///< boundaries for better performance.
|
||||||
|
hipMemAdviseUnsetCoarseGrain = 101 ///< Restores cache coherency policy back to fine-grain
|
||||||
} hipMemoryAdvise;
|
} hipMemoryAdvise;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -45,6 +45,10 @@ static_assert(static_cast<uint32_t>(hipMemAdviseSetAccessedBy) ==
|
|||||||
amd::MemoryAdvice::SetAccessedBy, "Enum mismatch with ROCclr!");
|
amd::MemoryAdvice::SetAccessedBy, "Enum mismatch with ROCclr!");
|
||||||
static_assert(static_cast<uint32_t>(hipMemAdviseUnsetAccessedBy) ==
|
static_assert(static_cast<uint32_t>(hipMemAdviseUnsetAccessedBy) ==
|
||||||
amd::MemoryAdvice::UnsetAccessedBy, "Enum mismatch with ROCclr!");
|
amd::MemoryAdvice::UnsetAccessedBy, "Enum mismatch with ROCclr!");
|
||||||
|
static_assert(static_cast<uint32_t>(hipMemAdviseSetCoarseGrain) ==
|
||||||
|
amd::MemoryAdvice::SetCoarseGrain, "Enum mismatch with ROCclr!");
|
||||||
|
static_assert(static_cast<uint32_t>(hipMemAdviseUnsetCoarseGrain) ==
|
||||||
|
amd::MemoryAdvice::UnsetCoarseGrain, "Enum mismatch with ROCclr!");
|
||||||
|
|
||||||
static_assert(static_cast<uint32_t>(hipMemRangeAttributeReadMostly) ==
|
static_assert(static_cast<uint32_t>(hipMemRangeAttributeReadMostly) ==
|
||||||
amd::MemRangeAttribute::ReadMostly, "Enum mismatch with ROCclr!");
|
amd::MemRangeAttribute::ReadMostly, "Enum mismatch with ROCclr!");
|
||||||
|
|||||||
Reference in new issue
Block a user