| From 814e71e5ef28b728951de9f2ded3a67904740784 Mon Sep 17 00:00:00 2001 |
| From: Anisha Kulkarni <anisha.dattatraya.kulkarni@intel.com> |
| Date: Tue, 23 Feb 2021 15:49:43 -0800 |
| Subject: [PATCH] Enable changes needed for ChromeOS build |
| |
| - Add TARGET_OS variable to build without lto |
| optimizations. |
| - Add defaulted destructor and assignment operator |
| when constructor is default. |
| |
| Change-Id: I041f567b58f513916bcc132c6ff8d260574a9d4f |
| Signed-off-by: Anisha Kulkarni <anisha.dattatraya.kulkarni@intel.com> |
| --- |
| build/cmake/gna_compile_flags.cmake | 6 +++++- |
| src/gna-lib/kernels/KernelArguments.h | 16 ++++++++++++++-- |
| |
| diff --git a/build/cmake/gna_compile_flags.cmake b/build/cmake/gna_compile_flags.cmake |
| index 8d4d370..e915b08 100644 |
| --- a/build/cmake/gna_compile_flags.cmake |
| +++ b/build/cmake/gna_compile_flags.cmake |
| @@ -152,7 +152,11 @@ else() |
| if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel") |
| set(GNA_COMPILE_FLAGS_RELEASE ${GNA_COMPILE_FLAGS_RELEASE} -ipo) |
| else() |
| - set(GNA_COMPILE_FLAGS_RELEASE ${GNA_COMPILE_FLAGS_RELEASE} -flto -fno-fat-lto-objects) |
| + if(${TARGET_OS} STREQUAL "ChromeOS") |
| + set(GNA_COMPILE_FLAGS_RELEASE ${GNA_COMPILE_FLAGS_RELEASE}) |
| + else() |
| + set(GNA_COMPILE_FLAGS_RELEASE ${GNA_COMPILE_FLAGS_RELEASE} -flto -fno-fat-lto-objects) |
| + endif() |
| endif() |
| elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Android") |
| if(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel") |
| diff --git a/src/gna-lib/kernels/KernelArguments.h b/src/gna-lib/kernels/KernelArguments.h |
| index a74ec4f..45711ed 100644 |
| --- a/src/gna-lib/kernels/KernelArguments.h |
| +++ b/src/gna-lib/kernels/KernelArguments.h |
| @@ -109,7 +109,14 @@ struct KernelConfig : public BaseConfig |
| |
| struct ExecutionConfig |
| { |
| - ExecutionConfig() = default; |
| + const ExecutionConfig& operator =(const ExecutionConfig& right) |
| + { |
| + *this->SaturationCount = *right.SaturationCount; |
| + return *this; |
| + } |
| + ~ExecutionConfig() = default; |
| + ExecutionConfig(const ExecutionConfig&) = default; |
| + |
| ExecutionConfig(KernelBuffers * intermediate, uint32_t * saturationCount, uint32_t const * bufferElementCount) : |
| Intermediate{ intermediate }, |
| SaturationCount{ saturationCount }, |
| @@ -135,8 +142,13 @@ struct ExecutionKernelConfig : public ExecutionConfig |
| |
| struct ActivationConfig |
| { |
| - ActivationConfig() = default; |
| ActivationConfig(ActivationConfig const & source) = default; |
| + ~ActivationConfig() = default; |
| + const ActivationConfig& operator =(const ActivationConfig& right) |
| + { |
| + this->ElementCount = right.ElementCount; |
| + return *this; |
| + } |
| ActivationConfig(uint32_t elementCount, GNA::PwlCached const * kernel); |
| |
| uint32_t ElementCount; |
| -- |
| 2.17.1 |
| |