From 2ab47c1887257cc978958d06958b384ab8c93aa9 Mon Sep 17 00:00:00 2001 From: YangLuo Date: Mon, 1 Mar 2021 21:50:12 +0800 Subject: [PATCH] Disable MSContext in Minddata temporarily to avoid link error --- .../engine/ir/datasetops/transfer_node.cc | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/transfer_node.cc b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/transfer_node.cc index c85f555e0d..efa9c95244 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/transfer_node.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/transfer_node.cc @@ -72,13 +72,21 @@ Status TransferNode::Build(std::vector> *const node_o // Get a uuid for queue name queue_name_ = Services::GetUniqueID(); } + + // FIXME - This is an issue from MindSpore C++ user + // https://gitee.com/mindspore/mindspore/issues/I39J9A + // Link _c_expression.so and _c_dataengine.so simultaneously will cause heap overflow because MindData uses MSContext. + // We should find a new way to get device_type here. + // if (device_type_.empty()) { + // auto context = MsContext::GetInstance(); + // if (context == nullptr) { + // device_type_ = kCPUDevice; + // } else { + // device_type_ = context->get_param(MS_CTX_DEVICE_TARGET); + // } + // } if (device_type_.empty()) { - auto context = MsContext::GetInstance(); - if (context == nullptr) { - device_type_ = kCPUDevice; - } else { - device_type_ = context->get_param(MS_CTX_DEVICE_TARGET); - } + device_type_ = kCPUDevice; } // Get device type from ms context