From 2d64d36223d38abc5ffcedc99769da0a8fb94072 Mon Sep 17 00:00:00 2001 From: Konstantin Zhuravlyov Date: Wed, 31 Aug 2016 14:45:34 -0400 Subject: [PATCH] Use memcpy instead of hsa_memory_copy Change hsa_code_object_serialize and hsa_code_object_deserialize to use memcpy instead of hsa_memory_copy since it is system->system copy Change-Id: I329e270ae4e2fc25e177dc8080d93662ffb261ab [ROCm/ROCR-Runtime commit: 73ed2116d5edfc9262ae84298dcdbc3ea8e29e2b] --- .../runtime/hsa-runtime/core/runtime/hsa.cpp | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) 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 196e6709d2..b468e1b6ec 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/hsa.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/hsa.cpp @@ -1546,13 +1546,9 @@ AmdHsaCodeManager *GetCodeManager() { } assert(*serialized_code_object); - status = HSA::hsa_memory_copy( - *serialized_code_object, code->ElfData(), code->ElfSize()); - if (status != HSA_STATUS_SUCCESS) { - return status; - } - + memcpy(*serialized_code_object, code->ElfData(), code->ElfSize()); *serialized_code_object_size = code->ElfSize(); + return HSA_STATUS_SUCCESS; } @@ -1585,14 +1581,11 @@ AmdHsaCodeManager *GetCodeManager() { } assert(code_object_alloc_data); - status = HSA::hsa_memory_copy( + memcpy( code_object_alloc_data, serialized_code_object, serialized_code_object_size); - if (status != HSA_STATUS_SUCCESS) { - return status; - } - code_object->handle = reinterpret_cast(code_object_alloc_data); + return HSA_STATUS_SUCCESS; } @@ -1845,7 +1838,7 @@ hsa_status_t hsa_code_object_reader_destroy( // Invoke non-deprecated API. hsa_status_t status = HSA::hsa_executable_create_alt( - profile, HSA_DEFAULT_FLOAT_ROUNDING_MODE_DEFAULT, options, executable); + profile, HSA_DEFAULT_FLOAT_ROUNDING_MODE_DEFAULT, options, executable); if (status != HSA_STATUS_SUCCESS) { return status; }