Minor interface improvement to pointer info.
Take in const void* rather than void*. This does not break the abi or existing code. Existing code would need to cast away any const which is unnecessary and annoying. Change-Id: I28787e8fab1b600bf6871ea82835e10a4f475c5b
Цей коміт міститься в:
@@ -1079,13 +1079,13 @@ hsa_status_t HSA_API hsa_amd_image_create(
|
||||
}
|
||||
|
||||
// Mirrors Amd Extension Apis
|
||||
hsa_status_t hsa_amd_pointer_info(void* ptr, hsa_amd_pointer_info_t* info, void* (*alloc)(size_t),
|
||||
hsa_status_t hsa_amd_pointer_info(const void* ptr, hsa_amd_pointer_info_t* info, void* (*alloc)(size_t),
|
||||
uint32_t* num_agents_accessible, hsa_agent_t** accessible) {
|
||||
return amdExtTable->hsa_amd_pointer_info_fn(ptr, info, alloc, num_agents_accessible, accessible);
|
||||
}
|
||||
|
||||
// Mirrors Amd Extension Apis
|
||||
hsa_status_t hsa_amd_pointer_info_set_userdata(void* ptr, void* userptr) {
|
||||
hsa_status_t hsa_amd_pointer_info_set_userdata(const void* ptr, void* userptr) {
|
||||
return amdExtTable->hsa_amd_pointer_info_set_userdata_fn(ptr, userptr);
|
||||
}
|
||||
|
||||
|
||||
@@ -204,12 +204,12 @@ hsa_status_t hsa_amd_interop_map_buffer(uint32_t num_agents,
|
||||
hsa_status_t hsa_amd_interop_unmap_buffer(void* ptr);
|
||||
|
||||
// Mirrors Amd Extension Apis
|
||||
hsa_status_t hsa_amd_pointer_info(void* ptr, hsa_amd_pointer_info_t* info,
|
||||
hsa_status_t hsa_amd_pointer_info(const void* ptr, hsa_amd_pointer_info_t* info,
|
||||
void* (*alloc)(size_t), uint32_t* num_agents_accessible,
|
||||
hsa_agent_t** accessible);
|
||||
|
||||
// Mirrors Amd Extension Apis
|
||||
hsa_status_t hsa_amd_pointer_info_set_userdata(void* ptr, void* userdata);
|
||||
hsa_status_t hsa_amd_pointer_info_set_userdata(const void* ptr, void* userdata);
|
||||
|
||||
// Mirrors Amd Extension Apis
|
||||
hsa_status_t hsa_amd_ipc_memory_create(void* ptr, size_t len, hsa_amd_ipc_memory_t* handle);
|
||||
|
||||
@@ -284,11 +284,11 @@ class Runtime {
|
||||
size_t length;
|
||||
};
|
||||
|
||||
hsa_status_t PtrInfo(void* ptr, hsa_amd_pointer_info_t* info, void* (*alloc)(size_t),
|
||||
hsa_status_t PtrInfo(const void* ptr, hsa_amd_pointer_info_t* info, void* (*alloc)(size_t),
|
||||
uint32_t* num_agents_accessible, hsa_agent_t** accessible,
|
||||
PtrInfoBlockData* block_info = nullptr);
|
||||
|
||||
hsa_status_t SetPtrInfoData(void* ptr, void* userptr);
|
||||
hsa_status_t SetPtrInfoData(const void* ptr, void* userptr);
|
||||
|
||||
hsa_status_t IPCCreate(void* ptr, size_t len, hsa_amd_ipc_memory_t* handle);
|
||||
|
||||
|
||||
@@ -833,7 +833,7 @@ hsa_status_t hsa_amd_interop_unmap_buffer(void* ptr) {
|
||||
CATCH;
|
||||
}
|
||||
|
||||
hsa_status_t hsa_amd_pointer_info(void* ptr, hsa_amd_pointer_info_t* info, void* (*alloc)(size_t),
|
||||
hsa_status_t hsa_amd_pointer_info(const void* ptr, hsa_amd_pointer_info_t* info, void* (*alloc)(size_t),
|
||||
uint32_t* num_accessible, hsa_agent_t** accessible) {
|
||||
TRY;
|
||||
IS_OPEN();
|
||||
@@ -843,7 +843,7 @@ hsa_status_t hsa_amd_pointer_info(void* ptr, hsa_amd_pointer_info_t* info, void*
|
||||
CATCH;
|
||||
}
|
||||
|
||||
hsa_status_t hsa_amd_pointer_info_set_userdata(void* ptr, void* userdata) {
|
||||
hsa_status_t hsa_amd_pointer_info_set_userdata(const void* ptr, void* userdata) {
|
||||
TRY;
|
||||
IS_OPEN();
|
||||
IS_BAD_PTR(ptr);
|
||||
|
||||
@@ -761,7 +761,7 @@ hsa_status_t Runtime::InteropUnmap(void* ptr) {
|
||||
return HSA_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
hsa_status_t Runtime::PtrInfo(void* ptr, hsa_amd_pointer_info_t* info, void* (*alloc)(size_t),
|
||||
hsa_status_t Runtime::PtrInfo(const void* ptr, hsa_amd_pointer_info_t* info, void* (*alloc)(size_t),
|
||||
uint32_t* num_agents_accessible, hsa_agent_t** accessible,
|
||||
PtrInfoBlockData* block_info) {
|
||||
static_assert(static_cast<int>(HSA_POINTER_UNKNOWN) == static_cast<int>(HSA_EXT_POINTER_TYPE_UNKNOWN),
|
||||
@@ -884,7 +884,7 @@ hsa_status_t Runtime::PtrInfo(void* ptr, hsa_amd_pointer_info_t* info, void* (*a
|
||||
return HSA_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
hsa_status_t Runtime::SetPtrInfoData(void* ptr, void* userptr) {
|
||||
hsa_status_t Runtime::SetPtrInfoData(const void* ptr, void* userptr) {
|
||||
{ // Use allocation map if possible to handle fragments.
|
||||
ScopedAcquire<KernelMutex> lock(&memory_lock_);
|
||||
const auto& it = allocation_map_.find(ptr);
|
||||
|
||||
@@ -1815,7 +1815,7 @@ typedef struct hsa_amd_pointer_info_s {
|
||||
*
|
||||
* @retval HSA_STATUS_ERROR_INVALID_ARGUMENT NULL in @p ptr or @p info.
|
||||
*/
|
||||
hsa_status_t HSA_API hsa_amd_pointer_info(void* ptr,
|
||||
hsa_status_t HSA_API hsa_amd_pointer_info(const void* ptr,
|
||||
hsa_amd_pointer_info_t* info,
|
||||
void* (*alloc)(size_t),
|
||||
uint32_t* num_agents_accessible,
|
||||
@@ -1839,7 +1839,7 @@ hsa_status_t HSA_API hsa_amd_pointer_info(void* ptr,
|
||||
*
|
||||
* @retval HSA_STATUS_ERROR_INVALID_ARGUMENT @p ptr is not known to ROCr.
|
||||
*/
|
||||
hsa_status_t HSA_API hsa_amd_pointer_info_set_userdata(void* ptr,
|
||||
hsa_status_t HSA_API hsa_amd_pointer_info_set_userdata(const void* ptr,
|
||||
void* userdata);
|
||||
|
||||
/**
|
||||
|
||||
Посилання в новій задачі
Заблокувати користувача