Reorder loader extension functions to maintain backwards compatibility

Change-Id: I93f0899cdece4bab167290085da67d1a1770eb9b


[ROCm/ROCR-Runtime commit: 49a6a39724]
Этот коммит содержится в:
Konstantin Zhuravlyov
2016-07-19 13:01:08 -04:00
коммит произвёл Gerrit Code Review
родитель 8fe807f2a9
Коммит 83d9c273a5
3 изменённых файлов: 54 добавлений и 54 удалений
+3 -3
Просмотреть файл
@@ -228,7 +228,7 @@ hsa_status_t
return HSA_STATUS_SUCCESS;
}
if (extension == HSA_EXTENSION_FINALIZER) {
// Currently there is only version 1.00.
hsa_ext_finalizer_1_00_pfn_s* ext_table =
@@ -248,10 +248,10 @@ hsa_status_t
// Currently there is only version 1.00.
hsa_ven_amd_loader_1_00_pfn_t* ext_table =
reinterpret_cast<hsa_ven_amd_loader_1_00_pfn_t*>(table);
ext_table->hsa_ven_amd_loader_query_segment_descriptors =
hsa_ven_amd_loader_query_segment_descriptors;
ext_table->hsa_ven_amd_loader_query_host_address =
hsa_ven_amd_loader_query_host_address;
ext_table->hsa_ven_amd_loader_query_segment_descriptors =
hsa_ven_amd_loader_query_segment_descriptors;
return HSA_STATUS_SUCCESS;
}
+11 -11
Просмотреть файл
@@ -47,17 +47,6 @@
using namespace core;
hsa_status_t HSA_API hsa_ven_amd_loader_query_segment_descriptors(
hsa_ven_amd_loader_segment_descriptor_t *segment_descriptors,
size_t *num_segment_descriptors) {
if (false == core::Runtime::runtime_singleton_->IsOpen()) {
return HSA_STATUS_ERROR_NOT_INITIALIZED;
}
// Arguments are checked by the loader.
return Runtime::runtime_singleton_->loader()->QuerySegmentDescriptors(segment_descriptors, num_segment_descriptors);
}
hsa_status_t HSA_API hsa_ven_amd_loader_query_host_address(
const void *device_address,
const void **host_address) {
@@ -80,3 +69,14 @@ hsa_status_t HSA_API hsa_ven_amd_loader_query_host_address(
*host_address = reinterpret_cast<void*>(uhaddr);
return HSA_STATUS_SUCCESS;
}
hsa_status_t HSA_API hsa_ven_amd_loader_query_segment_descriptors(
hsa_ven_amd_loader_segment_descriptor_t *segment_descriptors,
size_t *num_segment_descriptors) {
if (false == core::Runtime::runtime_singleton_->IsOpen()) {
return HSA_STATUS_ERROR_NOT_INITIALIZED;
}
// Arguments are checked by the loader.
return Runtime::runtime_singleton_->loader()->QuerySegmentDescriptors(segment_descriptors, num_segment_descriptors);
}
+40 -40
Просмотреть файл
@@ -51,6 +51,42 @@
extern "C" {
#endif /* __cplusplus */
/**
* @brief Queries equivalent host address for given @p device_address, and
* records it in @p host_address.
*
*
* @details Contents of memory pointed to by @p host_address would be identical
* to contents of memory pointed to by @p device_address. Only difference
* between the two is host accessibility: @p host_address is always accessible
* from host, @p device_address might not be accessible from host.
*
* If @p device_address already points to host accessible memory, then the value
* of @p device_address is simply copied into @p host_address.
*
* The lifetime of @p host_address is the same as the lifetime of @p
* device_address, and both lifetimes are limited by the lifetime of the
* executable that is managing these addresses.
*
*
* @param[in] device_address Device address to query equivalent host address
* for.
*
* @param[out] host_address Pointer to application-allocated buffer to record
* queried equivalent host address in.
*
*
* @retval HSA_STATUS_SUCCESS Function is executed successfully.
*
* @retval HSA_STATUS_ERROR_NOT_INITIALIZED Runtime is not initialized.
*
* @retval HSA_STATUS_ERROR_INVALID_ARGUMENT @p device_address is invalid or
* null, or @p host_address is null.
*/
hsa_status_t HSA_API hsa_ven_amd_loader_query_host_address(
const void *device_address,
const void **host_address);
/**
* @brief The storage type of the code object that is backing loaded memory
* segment.
@@ -188,42 +224,6 @@ hsa_status_t HSA_API hsa_ven_amd_loader_query_segment_descriptors(
hsa_ven_amd_loader_segment_descriptor_t *segment_descriptors,
size_t *num_segment_descriptors);
/**
* @brief Queries equivalent host address for given @p device_address, and
* records it in @p host_address.
*
*
* @details Contents of memory pointed to by @p host_address would be identical
* to contents of memory pointed to by @p device_address. Only difference
* between the two is host accessibility: @p host_address is always accessible
* from host, @p device_address might not be accessible from host.
*
* If @p device_address already points to host accessible memory, then the value
* of @p device_address is simply copied into @p host_address.
*
* The lifetime of @p host_address is the same as the lifetime of @p
* device_address, and both lifetimes are limited by the lifetime of the
* executable that is managing these addresses.
*
*
* @param[in] device_address Device address to query equivalent host address
* for.
*
* @param[out] host_address Pointer to application-allocated buffer to record
* queried equivalent host address in.
*
*
* @retval HSA_STATUS_SUCCESS Function is executed successfully.
*
* @retval HSA_STATUS_ERROR_NOT_INITIALIZED Runtime is not initialized.
*
* @retval HSA_STATUS_ERROR_INVALID_ARGUMENT @p device_address is invalid or
* null, or @p host_address is null.
*/
hsa_status_t HSA_API hsa_ven_amd_loader_query_host_address(
const void *device_address,
const void **host_address);
/**
* @brief Extension version.
*/
@@ -233,13 +233,13 @@ hsa_status_t HSA_API hsa_ven_amd_loader_query_host_address(
* @brief Extension function table.
*/
typedef struct hsa_ven_amd_loader_1_00_pfn_s {
hsa_status_t (*hsa_ven_amd_loader_query_segment_descriptors)(
hsa_ven_amd_loader_segment_descriptor_t *segment_descriptors,
size_t *num_segment_descriptors);
hsa_status_t (*hsa_ven_amd_loader_query_host_address)(
const void *device_address,
const void **host_address);
hsa_status_t (*hsa_ven_amd_loader_query_segment_descriptors)(
hsa_ven_amd_loader_segment_descriptor_t *segment_descriptors,
size_t *num_segment_descriptors);
} hsa_ven_amd_loader_1_00_pfn_t;
#ifdef __cplusplus