diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/CMakeLists.txt b/projects/rocr-runtime/runtime/hsa-runtime/core/CMakeLists.txt index ee066d132b..9dd3915154 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/CMakeLists.txt +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/CMakeLists.txt @@ -132,7 +132,6 @@ set ( CORE_SRCS ${CORE_SRCS} runtime/amd_cpu_agent.cpp ) set ( CORE_SRCS ${CORE_SRCS} runtime/amd_gpu_agent.cpp ) set ( CORE_SRCS ${CORE_SRCS} runtime/amd_aql_queue.cpp ) set ( CORE_SRCS ${CORE_SRCS} runtime/amd_loader_context.cpp ) -set ( CORE_SRCS ${CORE_SRCS} runtime/hsa_ven_amd_loaded_code_object.cpp ) set ( CORE_SRCS ${CORE_SRCS} runtime/hsa_ven_amd_loader.cpp ) set ( CORE_SRCS ${CORE_SRCS} runtime/amd_memory_region.cpp ) set ( CORE_SRCS ${CORE_SRCS} runtime/amd_topology.cpp ) diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/hsa.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/hsa.cpp index f5b49d1ad2..a7648b702c 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/hsa.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/hsa.cpp @@ -55,7 +55,6 @@ #include "core/inc/default_signal.h" #include "core/inc/interrupt_signal.h" #include "core/inc/amd_loader_context.hpp" -#include "inc/hsa_ven_amd_loaded_code_object.h" #include "inc/hsa_ven_amd_loader.h" using namespace amd::hsa::code; @@ -244,17 +243,7 @@ hsa_status_t return HSA_STATUS_SUCCESS; } - - if (extension == HSA_EXTENSION_AMD_LOADED_CODE_OBJECT) { - // Currently there is only version 1.00. - hsa_ven_amd_loaded_code_object_1_00_pfn_t* ext_table = - reinterpret_cast(table); - ext_table->hsa_ven_amd_loaded_code_object_query_host_address = - hsa_ven_amd_loaded_code_object_query_host_address; - return HSA_STATUS_SUCCESS; - } - if (extension == HSA_EXTENSION_AMD_LOADER) { // Currently there is only version 1.00. hsa_ven_amd_loader_1_00_pfn_t* ext_table = @@ -266,7 +255,7 @@ hsa_status_t return HSA_STATUS_SUCCESS; } - + return HSA_STATUS_ERROR; } diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/hsa_ven_amd_loaded_code_object.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/hsa_ven_amd_loaded_code_object.cpp deleted file mode 100644 index 958e3051ee..0000000000 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/hsa_ven_amd_loaded_code_object.cpp +++ /dev/null @@ -1,71 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// -// -// The University of Illinois/NCSA -// Open Source License (NCSA) -// -// Copyright (c) 2014-2015, Advanced Micro Devices, Inc. All rights reserved. -// -// Developed by: -// -// AMD Research and AMD HSA Software Development -// -// Advanced Micro Devices, Inc. -// -// www.amd.com -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to -// deal with the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following conditions: -// -// - Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimers. -// - Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimers in -// the documentation and/or other materials provided with the distribution. -// - Neither the names of Advanced Micro Devices, Inc, -// nor the names of its contributors may be used to endorse or promote -// products derived from this Software without specific prior written -// permission. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR -// OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS WITH THE SOFTWARE. -// -//////////////////////////////////////////////////////////////////////////////// - -#include "hsa_ven_amd_loaded_code_object.h" - -#include "core/inc/amd_hsa_loader.hpp" -#include "core/inc/runtime.h" - -using namespace core; - -hsa_status_t hsa_ven_amd_loaded_code_object_query_host_address( - const void *device_address, - const void **host_address) { - if (false == core::Runtime::runtime_singleton_->IsOpen()) { - return HSA_STATUS_ERROR_NOT_INITIALIZED; - } - if (nullptr == device_address) { - return HSA_STATUS_ERROR_INVALID_ARGUMENT; - } - if (nullptr == host_address) { - return HSA_STATUS_ERROR_INVALID_ARGUMENT; - } - - uint64_t udaddr = reinterpret_cast(device_address); - uint64_t uhaddr = Runtime::runtime_singleton_->loader()->FindHostAddress(udaddr); - if (0 == uhaddr) { - return HSA_STATUS_ERROR_INVALID_ARGUMENT; - } - - *host_address = reinterpret_cast(uhaddr); - return HSA_STATUS_SUCCESS; -} diff --git a/projects/rocr-runtime/runtime/hsa-runtime/inc/hsa.h b/projects/rocr-runtime/runtime/hsa-runtime/inc/hsa.h index c4de41fbf4..6ab97c3944 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/inc/hsa.h +++ b/projects/rocr-runtime/runtime/hsa-runtime/inc/hsa.h @@ -461,14 +461,10 @@ typedef enum { * Profiler extension. */ HSA_EXTENSION_AMD_PROFILER = 2, - /** - * @deprecated Loaded code object extension. - */ - HSA_EXTENSION_AMD_LOADED_CODE_OBJECT = 3, /** * Loader extension. */ - HSA_EXTENSION_AMD_LOADER = 4, + HSA_EXTENSION_AMD_LOADER = 3, /** * Extension count. */ diff --git a/projects/rocr-runtime/runtime/hsa-runtime/inc/hsa_ven_amd_loaded_code_object.h b/projects/rocr-runtime/runtime/hsa-runtime/inc/hsa_ven_amd_loaded_code_object.h deleted file mode 100644 index fe56e38136..0000000000 --- a/projects/rocr-runtime/runtime/hsa-runtime/inc/hsa_ven_amd_loaded_code_object.h +++ /dev/null @@ -1,95 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// -// -// The University of Illinois/NCSA -// Open Source License (NCSA) -// -// Copyright (c) 2014-2015, Advanced Micro Devices, Inc. All rights reserved. -// -// Developed by: -// -// AMD Research and AMD HSA Software Development -// -// Advanced Micro Devices, Inc. -// -// www.amd.com -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to -// deal with the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following conditions: -// -// - Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimers. -// - Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimers in -// the documentation and/or other materials provided with the distribution. -// - Neither the names of Advanced Micro Devices, Inc, -// nor the names of its contributors may be used to endorse or promote -// products derived from this Software without specific prior written -// permission. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR -// OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS WITH THE SOFTWARE. -// -//////////////////////////////////////////////////////////////////////////////// - -// HSA AMD extension for loaded code objects. - -#ifndef HSA_VEN_AMD_LOADED_CODE_OBJECT_H -#define HSA_VEN_AMD_LOADED_CODE_OBJECT_H - -#include "hsa.h" - -#ifdef __cplusplus -extern "C" { -#endif // __cplusplus - -/** - * @brief Records loaded code object's host address in @p host_address given - * loaded code object's device address. Recorded host address points to host - * accessible memory, which is identical to memory pointed to by device address. - * If device address already points to host accessible memory, then device - * address is recorded in @p host_address. - * - * @param[in] device_address Device address. - * - * @param[out] host_address Pointer to application-allocated buffer, where to - * record host address. - * - * @retval HSA_STATUS_SUCCESS Function has been executed successfully. - * - * @retval HSA_STATUS_ERROR_NOT_INITIALIZED Runtime has not been initialized. - * - * @retval HSA_STATUS_ERROR_INVALID_ARGUMENT @p device address is invalid/null, - * or @p host address is null. - */ -hsa_status_t HSA_API hsa_ven_amd_loaded_code_object_query_host_address( - const void *device_address, - const void **host_address); - -/** - * @brief Extension's version. - */ -#define hsa_ven_amd_loaded_code_object 001000 - -/** - * @brief Extension's function table. - */ -typedef struct hsa_ven_amd_loaded_code_object_1_00_pfn_s { - hsa_status_t (*hsa_ven_amd_loaded_code_object_query_host_address)( - const void *device_address, - const void **host_address); -} hsa_ven_amd_loaded_code_object_1_00_pfn_t; - -#ifdef __cplusplus -} // extern "C" -#endif // __cplusplus - -#endif // HSA_VEN_AMD_LOADED_CODE_OBJECT_H