Report SVM range queries with both coarse and fine grain as indeterminate.
Previously ranges were reported as fine if and only if they were
entirely fine. Coarse and mixed ranges were reported as coarse.
For gfx90a it is critical to know if a range is coarse or fine as
fp atomics targeting fine do not function. Range queried reporting
coarse must be able to be trusted so must only report coarse if the
entire region is coarse.
Change-Id: I29c654a2afcd6943961eb2455e3654dfdb1283b5
[ROCm/ROCR-Runtime commit: e6e66e8a05]
This commit is contained in:
@@ -1869,7 +1869,11 @@ hsa_status_t Runtime::GetSvmAttrib(void* ptr, size_t size,
|
||||
}
|
||||
}
|
||||
|
||||
if (getFlags) attribs.push_back(kmtPair(HSA_SVM_ATTR_SET_FLAGS, 0));
|
||||
if (getFlags) {
|
||||
// Order is important to later code.
|
||||
attribs.push_back(kmtPair(HSA_SVM_ATTR_CLR_FLAGS, 0));
|
||||
attribs.push_back(kmtPair(HSA_SVM_ATTR_SET_FLAGS, 0));
|
||||
}
|
||||
|
||||
uint8_t* base = AlignDown((uint8_t*)ptr, 4096);
|
||||
uint8_t* end = AlignUp((uint8_t*)ptr + size, 4096);
|
||||
@@ -1888,8 +1892,10 @@ hsa_status_t Runtime::GetSvmAttrib(void* ptr, size_t size,
|
||||
case HSA_AMD_SVM_ATTRIB_GLOBAL_FLAG: {
|
||||
if (attribs[attribs.size() - 1].value & HSA_SVM_FLAG_COHERENT)
|
||||
value = HSA_AMD_SVM_GLOBAL_FLAG_FINE_GRAINED;
|
||||
else
|
||||
if (attribs[attribs.size() - 2].value & HSA_SVM_FLAG_COHERENT)
|
||||
value = HSA_AMD_SVM_GLOBAL_FLAG_COARSE_GRAINED;
|
||||
else
|
||||
value = HSA_AMD_SVM_GLOBAL_FLAG_INDETERMINATE;
|
||||
break;
|
||||
}
|
||||
case HSA_AMD_SVM_ATTRIB_READ_ONLY: {
|
||||
|
||||
@@ -2170,13 +2170,25 @@ hsa_status_t HSA_API hsa_amd_deregister_deallocation_callback(void* ptr,
|
||||
|
||||
typedef enum hsa_amd_svm_model_s {
|
||||
/**
|
||||
* Updates to memory with this attribute conform to HSA memory consistency model.
|
||||
* Updates to memory with this attribute conform to HSA memory consistency
|
||||
* model.
|
||||
*/
|
||||
HSA_AMD_SVM_GLOBAL_FLAG_FINE_GRAINED = 0,
|
||||
/**
|
||||
* Writes to memory with this attribute can be performed by a single agent at a time.
|
||||
* Writes to memory with this attribute can be performed by a single agent
|
||||
* at a time.
|
||||
*/
|
||||
HSA_AMD_SVM_GLOBAL_FLAG_COARSE_GRAINED = 1
|
||||
HSA_AMD_SVM_GLOBAL_FLAG_COARSE_GRAINED = 1,
|
||||
/**
|
||||
* Memory region queried contains subregions with both
|
||||
* HSA_AMD_SVM_GLOBAL_FLAG_COARSE_GRAINED and
|
||||
* HSA_AMD_SVM_GLOBAL_FLAG_FINE_GRAINED attributes.
|
||||
*
|
||||
* This attribute can not be used in hsa_amd_svm_attributes_set. It is a
|
||||
* possible return from hsa_amd_svm_attributes_get indicating that the query
|
||||
* region contains both coarse and fine grained memory.
|
||||
*/
|
||||
HSA_AMD_SVM_GLOBAL_FLAG_INDETERMINATE = 2
|
||||
} hsa_amd_svm_model_t;
|
||||
|
||||
typedef enum hsa_amd_svm_attribute_s {
|
||||
|
||||
Reference in New Issue
Block a user