Home
last modified time | relevance | path

Searched refs:ms_context (Results 1 – 25 of 57) sorted by relevance

123

/third_party/mindspore/mindspore/lite/src/common/
Dcontext_util.cc102 auto ms_context = new (std::nothrow) mindspore::Context(); in MSContextFromContext() local
103 if (ms_context == nullptr) { in MSContextFromContext()
107 ms_context->SetThreadNum(context->thread_num_); in MSContextFromContext()
108 ms_context->SetThreadAffinity(context->affinity_core_list_); in MSContextFromContext()
109 ms_context->SetEnableParallel(context->enable_parallel_); in MSContextFromContext()
110 ms_context->SetDelegate(context->delegate); in MSContextFromContext()
111 auto &device_infos = ms_context->MutableDeviceInfo(); in MSContextFromContext()
130 ms_context->SetThreadAffinity(device_context.device_info_.cpu_device_info_.cpu_bind_mode_); in MSContextFromContext()
134 return ms_context; in MSContextFromContext()
/third_party/mindspore/mindspore/ccsrc/runtime/hardware/gpu/
Dgpu_device_context.cc77 auto ms_context = MsContext::GetInstance(); in Initialize() local
78 MS_EXCEPTION_IF_NULL(ms_context); in Initialize()
79 ms_context->set_param<uint32_t>(MS_CTX_DEVICE_ID, device_context_key_.device_id_); in Initialize()
239 auto ms_context = MsContext::GetInstance(); in OptimizeGraphWithDeviceInfo() local
240 MS_EXCEPTION_IF_NULL(ms_context); in OptimizeGraphWithDeviceInfo()
252 if (ms_context->get_param<int>(MS_CTX_EXECUTION_MODE) == kGraphMode) { in OptimizeGraphWithDeviceInfo()
328 auto ms_context = MsContext::GetInstance(); in RunOpHideNopNode() local
329 MS_EXCEPTION_IF_NULL(ms_context); in RunOpHideNopNode()
330 if (!ms_context->get_param<bool>(MS_CTX_ENABLE_PYNATIVE_INFER)) { in RunOpHideNopNode()
336 auto ms_context = MsContext::GetInstance(); in RunOpRemoveNopNode() local
[all …]
/third_party/mindspore/mindspore/ccsrc/cxx_api/graph/ascend/
Dascend_graph_impl.cc291 auto ms_context = MsContext::GetInstance(); in MsEnvGuard() local
292 if (ms_context == nullptr) { in MsEnvGuard()
301 ms_context->set_param<bool>(MS_CTX_ENABLE_HCCL, true); in MsEnvGuard()
304 ms_context->set_param<int>(MS_CTX_EXECUTION_MODE, kGraphMode); in MsEnvGuard()
305 ms_context->set_param<uint32_t>(MS_CTX_DEVICE_ID, device_id_); in MsEnvGuard()
306 ms_context->set_param<std::string>(MS_CTX_DEVICE_TARGET, kAscendDevice); in MsEnvGuard()
307 ms_context->set_param<bool>(MS_CTX_IS_MULTI_GRAPH_SINK, true); in MsEnvGuard()
309 if (ms_context->get_param<bool>(MS_CTX_ENABLE_HCCL)) { in MsEnvGuard()
338 auto ms_context = MsContext::GetInstance(); in ~MsEnvGuard() local
339 if (ms_context == nullptr) { in ~MsEnvGuard()
[all …]
/third_party/mindspore/mindspore/ccsrc/pipeline/jit/
Dpipeline_split.cc29 auto ms_context = MsContext::GetInstance(); in GetWorldGroup() local
30 MS_EXCEPTION_IF_NULL(ms_context); in GetWorldGroup()
32 std::string backend = ms_context->get_param<std::string>(MS_CTX_DEVICE_TARGET); in GetWorldGroup()
44 auto ms_context = MsContext::GetInstance(); in GetRank() local
45 MS_EXCEPTION_IF_NULL(ms_context); in GetRank()
Dpipeline.cc663 auto ms_context = MsContext::GetInstance(); in GetGeBackendPolicy() local
664 MS_EXCEPTION_IF_NULL(ms_context); in GetGeBackendPolicy()
665 std::string backend = ms_context->backend_policy(); in GetGeBackendPolicy()
960 auto ms_context = MsContext::GetInstance(); in ProcessVmArgInner() local
961 if (ms_context->backend_policy() == kMsConvert && py::isinstance<py::array>(arg)) { in ProcessVmArgInner()
1134 auto ms_context = MsContext::GetInstance(); in PyExePath() local
1135 ms_context->set_param<std::string>(MS_CTX_PYTHON_EXE_PATH, py_exe_path_s); in PyExePath()
1143 auto ms_context = MsContext::GetInstance(); in KernelBuildServerDir() local
1144 ms_context->set_param<std::string>(MS_CTX_KERNEL_BUILD_SERVER_DIR, kernel_build_server_dir_s); in KernelBuildServerDir()
1152 auto ms_context = MsContext::GetInstance(); in InitExecDataset() local
[all …]
/third_party/mindspore/mindspore/ccsrc/cxx_api/graph/gpu/
Dgpu_graph_impl.cc51 auto ms_context = MsContext::GetInstance(); in InitEnv() local
52 if (ms_context == nullptr) { in InitEnv()
56 ms_context->set_param<int>(MS_CTX_EXECUTION_MODE, kGraphMode); in InitEnv()
57 ms_context->set_param<uint32_t>(MS_CTX_DEVICE_ID, device_id_); in InitEnv()
58 ms_context->set_param<std::string>(MS_CTX_DEVICE_TARGET, kGPUDevice); in InitEnv()
75 ms_context->set_param<bool>(MS_CTX_ENABLE_INFER_OPT, true); in InitEnv()
76 ms_context->set_param<std::string>(MS_CTX_INFER_PRECISION_MODE, gpu_info->GetPrecisionMode()); in InitEnv()
/third_party/mindspore/mindspore/ccsrc/runtime/device/ascend/
Dascend_device_address.cc76 auto ms_context = MsContext::GetInstance(); in SyncMemory() local
77 MS_EXCEPTION_IF_NULL(ms_context); in SyncMemory()
78 auto device_id = ms_context->get_param<uint32_t>(MS_CTX_DEVICE_ID); in SyncMemory()
79 auto execution_mode = ms_context->get_param<int>(MS_CTX_EXECUTION_MODE); in SyncMemory()
103 auto ms_context = MsContext::GetInstance(); in DataSync() local
104 MS_EXCEPTION_IF_NULL(ms_context); in DataSync()
105 auto device_id = ms_context->get_param<uint32_t>(MS_CTX_DEVICE_ID); in DataSync()
164 auto ms_context = MsContext::GetInstance(); in SyncStream() local
165 MS_EXCEPTION_IF_NULL(ms_context); in SyncStream()
166 if (ms_context->get_param<int>(MS_CTX_EXECUTION_MODE) != kPynativeMode && in SyncStream()
[all …]
Dascend_memory_pool.cc60 auto ms_context = MsContext::GetInstance(); in CalMemBlockAllocSize() local
61 MS_EXCEPTION_IF_NULL(ms_context); in CalMemBlockAllocSize()
62 const bool pynative_mode = (ms_context->get_param<int>(MS_CTX_EXECUTION_MODE) == kPynativeMode); in CalMemBlockAllocSize()
/third_party/mindspore/mindspore/ccsrc/backend/optimizer/pass/
Dconvert_const_input_to_attr.cc45 auto ms_context = MsContext::GetInstance(); in Process() local
46 MS_EXCEPTION_IF_NULL(ms_context); in Process()
47 auto device = ms_context->get_param<std::string>(MS_CTX_DEVICE_TARGET); in Process()
Dconst_to_attr_strided_slice_grad.cc123 auto ms_context = MsContext::GetInstance(); in Process() local
124 MS_EXCEPTION_IF_NULL(ms_context); in Process()
126 if (ms_context->get_param<std::string>(MS_CTX_DEVICE_TARGET) == kAscendDevice) { in Process()
/third_party/mindspore/mindspore/ccsrc/backend/session/
Dkernel_build_client.h40 auto ms_context = MsContext::GetInstance(); in GetPyExe() local
41 if (ms_context == nullptr) { in GetPyExe()
44 auto env = ms_context->get_param<std::string>(MS_CTX_PYTHON_EXE_PATH); in GetPyExe()
146 auto ms_context = MsContext::GetInstance(); in GetScriptFilePath() local
147 MS_EXCEPTION_IF_NULL(ms_context); in GetScriptFilePath()
148 auto server_dir = ms_context->get_param<std::string>(MS_CTX_KERNEL_BUILD_SERVER_DIR); in GetScriptFilePath()
Dascend_session.cc139 auto ms_context = MsContext::GetInstance(); in IsVMGraphTaskSink() local
140 MS_EXCEPTION_IF_NULL(ms_context); in IsVMGraphTaskSink()
141 if (ms_context->get_param<int>(MS_CTX_EXECUTION_MODE) != kGraphMode) { in IsVMGraphTaskSink()
144 if (ms_context->get_param<bool>(MS_CTX_ENABLE_TASK_SINK) == false) { in IsVMGraphTaskSink()
147 if (ms_context->get_param<bool>(MS_CTX_IS_MULTI_GRAPH_SINK) == true) { in IsVMGraphTaskSink()
324 auto ms_context = MsContext::GetInstance(); in TensorNeedSync() local
325 MS_EXCEPTION_IF_NULL(ms_context); in TensorNeedSync()
327 if (ms_context->get_param<bool>(MS_CTX_ENABLE_PYNATIVE_INFER)) { in TensorNeedSync()
411 auto ms_context = MsContext::GetInstance(); in UnifyMindIR() local
412 MS_EXCEPTION_IF_NULL(ms_context); in UnifyMindIR()
[all …]
Dsession_basic.cc152 auto ms_context = MsContext::GetInstance(); in IsPynativeMode() local
153 MS_EXCEPTION_IF_NULL(ms_context); in IsPynativeMode()
154 return ms_context->get_param<int>(MS_CTX_EXECUTION_MODE) == kPynativeMode; in IsPynativeMode()
235 auto ms_context = MsContext::GetInstance(); in CreateNodeOutputTensor() local
236 MS_EXCEPTION_IF_NULL(ms_context); in CreateNodeOutputTensor()
237 if (ms_context->get_param<int>(MS_CTX_EXECUTION_MODE) != kPynativeMode && in CreateNodeOutputTensor()
238 ms_context->get_param<std::string>(MS_CTX_DEVICE_TARGET) != kGPUDevice) { in CreateNodeOutputTensor()
1619 auto ms_context = MsContext::GetInstance(); in UpdateOutputs() local
1620 MS_EXCEPTION_IF_NULL(ms_context); in UpdateOutputs()
1626 if (ms_context->get_param<int>(MS_CTX_EXECUTION_MODE) == kPynativeMode && in UpdateOutputs()
[all …]
/third_party/mindspore/mindspore/ccsrc/runtime/device/
Dkernel_runtime_manager.cc116 auto ms_context = MsContext::GetInstance(); in GetCurrentKernelRuntime() local
117 MS_EXCEPTION_IF_NULL(ms_context); in GetCurrentKernelRuntime()
118 uint32_t device_id = ms_context->get_param<uint32_t>(MS_CTX_DEVICE_ID); in GetCurrentKernelRuntime()
119 std::string device_name = ms_context->get_param<std::string>(MS_CTX_DEVICE_TARGET); in GetCurrentKernelRuntime()
/third_party/mindspore/mindspore/ccsrc/debug/
Dcommon.h54 auto ms_context = MsContext::GetInstance();
55 MS_EXCEPTION_IF_NULL(ms_context);
56 save_graphs_path = ms_context->get_param<std::string>(MS_CTX_SAVE_GRAPHS_PATH);
/third_party/mindspore/mindspore/ccsrc/backend/optimizer/gpu/
Dbatch_norm_relu_grad_fusion.cc50 auto ms_context = MsContext::GetInstance(); in Process() local
51 MS_EXCEPTION_IF_NULL(ms_context); in Process()
52 if (ms_context->get_param<int>(MS_CTX_EXECUTION_MODE) == kPynativeMode) { in Process()
/third_party/mindspore/tests/ut/cpp/pre_activate/ascend/ir_fusion/
Dtranspose_transdata_fusion_test.cc84 auto ms_context = MsContext::GetInstance(); in TEST_F() local
85 MS_EXCEPTION_IF_NULL(ms_context); in TEST_F()
86 ms_context->set_param<int>(MS_CTX_EXECUTION_MODE, kGraphMode); in TEST_F()
/third_party/mindspore/mindspore/ccsrc/runtime/device/gpu/
Dgpu_device_address.cc100 auto ms_context = MsContext::GetInstance(); in SyncHostToDevice() local
101 MS_EXCEPTION_IF_NULL(ms_context); in SyncHostToDevice()
102 bool execution_mode = ms_context->get_param<int>(MS_CTX_EXECUTION_MODE); in SyncHostToDevice()
/third_party/mindspore/mindspore/ccsrc/runtime/framework/
Dgraph_compiler.cc111 const auto &ms_context = MsContext::GetInstance(); in CreateDeviceAddressForTensorValue() local
112 MS_EXCEPTION_IF_NULL(ms_context); in CreateDeviceAddressForTensorValue()
123 bool is_pynative_infer = ms_context->get_param<bool>(MS_CTX_ENABLE_PYNATIVE_INFER); in CreateDeviceAddressForTensorValue()
124 bool is_graph_mode = (ms_context->get_param<int>(MS_CTX_EXECUTION_MODE) == kGraphMode); in CreateDeviceAddressForTensorValue()
315 const auto &ms_context = MsContext::GetInstance(); in CompileGraphImpl() local
316 MS_EXCEPTION_IF_NULL(ms_context); in CompileGraphImpl()
318 bool save_graphs = ms_context->get_param<bool>(MS_CTX_SAVE_GRAPHS_FLAG); in CompileGraphImpl()
343 if (ms_context->get_param<int>(MS_CTX_EXECUTION_MODE) == kGraphMode) { in CompileGraphImpl()
/third_party/mindspore/tests/ut/cpp/pre_activate/ascend/format_type/
Dinsert_trans_op_test.cc113 auto ms_context = MsContext::GetInstance(); in TEST_F() local
114 MS_EXCEPTION_IF_NULL(ms_context); in TEST_F()
115 ms_context->set_param<int>(MS_CTX_EXECUTION_MODE, kGraphMode); in TEST_F()
/third_party/mindspore/mindspore/ccsrc/pipeline/pynative/
Dpynative_execute.cc511 auto ms_context = MsContext::GetInstance(); in ConstructInputTensor() local
512 MS_EXCEPTION_IF_NULL(ms_context); in ConstructInputTensor()
513 const auto &device_target = ms_context->get_param<std::string>(MS_CTX_DEVICE_TARGET); in ConstructInputTensor()
759 const auto &ms_context = MsContext::GetInstance(); in CheckPyNativeContext() local
760 MS_EXCEPTION_IF_NULL(ms_context); in CheckPyNativeContext()
763 ms_context->get_param<int>(MS_CTX_EXECUTION_MODE) == kPynativeMode) { in CheckPyNativeContext()
826 auto ms_context = MsContext::GetInstance(); in ClearDeviceMemory() local
827 MS_EXCEPTION_IF_NULL(ms_context); in ClearDeviceMemory()
828 const auto &device_target = ms_context->get_param<std::string>(MS_CTX_DEVICE_TARGET); in ClearDeviceMemory()
1818 auto ms_context = MsContext::GetInstance(); in InitEnv() local
[all …]
/third_party/mindspore/mindspore/ccsrc/backend/optimizer/ascend/format_type/
Drectify_do_mask_kernel_info.cc39 auto ms_context = MsContext::GetInstance(); in Process() local
40 MS_EXCEPTION_IF_NULL(ms_context); in Process()
41 if (ms_context->get_param<int>(MS_CTX_EXECUTION_MODE) == kPynativeMode) { in Process()
/third_party/mindspore/mindspore/ccsrc/runtime/device/ascend/executor/
Dai_core_dynamic_kernel.cc152 auto ms_context = MsContext::GetInstance(); in AllocateWorkspace() local
153 MS_EXCEPTION_IF_NULL(ms_context); in AllocateWorkspace()
154 auto device_id = ms_context->get_param<uint32_t>(MS_CTX_DEVICE_ID); in AllocateWorkspace()
/third_party/mindspore/mindspore/ccsrc/backend/optimizer/cpu/
Dinsert_cast_cpu.cc134 auto ms_context = MsContext::GetInstance(); in Run() local
135 MS_EXCEPTION_IF_NULL(ms_context); in Run()
136 if (ms_context->get_param<int>(MS_CTX_EXECUTION_MODE) != kPynativeMode) { in Run()
/third_party/mindspore/mindspore/ccsrc/frontend/parallel/ops_info/
Dbatchnorm_info.cc212 auto ms_context = MsContext::GetInstance(); in InferReplaceOps() local
213 MS_EXCEPTION_IF_NULL(ms_context); in InferReplaceOps()
214 std::string backend = ms_context->get_param<std::string>(MS_CTX_DEVICE_TARGET); in InferReplaceOps()

123