diff --git a/src/plugins/intel_gpu/src/plugin/compiled_model.cpp b/src/plugins/intel_gpu/src/plugin/compiled_model.cpp index 27c9a296403ed0..ac7d7263b846fe 100644 --- a/src/plugins/intel_gpu/src/plugin/compiled_model.cpp +++ b/src/plugins/intel_gpu/src/plugin/compiled_model.cpp @@ -184,11 +184,9 @@ void CompiledModel::export_model(std::ostream& model) const { const ov::EncryptionCallbacks encryption_callbacks = m_config.get_cache_encryption_callbacks(); - // Do not allow encryption for CacheMode::OPTIMIZE_SPEED - the cache size may cause severe memory penalty. const ov::CacheMode cache_mode = m_config.get_cache_mode(); - const bool encryption_enabled = encryption_callbacks.encrypt && cache_mode == ov::CacheMode::OPTIMIZE_SIZE; std::unique_ptr ob_ptr = - encryption_enabled + encryption_callbacks.encrypt ? std::make_unique(model, encryption_callbacks.encrypt) : std::make_unique(model); auto& ob = *ob_ptr; diff --git a/src/plugins/intel_gpu/src/plugin/plugin.cpp b/src/plugins/intel_gpu/src/plugin/plugin.cpp index 7c6ddf393a0cfe..d0b9f82ed12722 100644 --- a/src/plugins/intel_gpu/src/plugin/plugin.cpp +++ b/src/plugins/intel_gpu/src/plugin/plugin.cpp @@ -399,10 +399,9 @@ std::shared_ptr Plugin::import_model(std::istream& model, ov::CacheMode cache_mode = config.get_cache_mode(); ov::EncryptionCallbacks encryption_callbacks = config.get_cache_encryption_callbacks(); - const bool encryption_enabled = encryption_callbacks.decrypt && cache_mode == ov::CacheMode::OPTIMIZE_SIZE; std::unique_ptr ib_ptr = - encryption_enabled ? std::make_unique(model, + encryption_callbacks.decrypt ? std::make_unique(model, context_impl->get_engine(), encryption_callbacks.decrypt) : std::make_unique(model, context_impl->get_engine());