/third_party/mindspore/mindspore/lite/src/common/ |
D | context_util.cc | 102 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/ |
D | gpu_device_context.cc | 77 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/ |
D | ascend_graph_impl.cc | 291 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/ |
D | pipeline_split.cc | 29 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()
|
D | pipeline.cc | 663 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/ |
D | gpu_graph_impl.cc | 51 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/ |
D | ascend_device_address.cc | 76 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 …]
|
D | ascend_memory_pool.cc | 60 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/ |
D | convert_const_input_to_attr.cc | 45 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()
|
D | const_to_attr_strided_slice_grad.cc | 123 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/ |
D | kernel_build_client.h | 40 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()
|
D | ascend_session.cc | 139 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 …]
|
D | session_basic.cc | 152 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/ |
D | kernel_runtime_manager.cc | 116 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/ |
D | common.h | 54 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/ |
D | batch_norm_relu_grad_fusion.cc | 50 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/ |
D | transpose_transdata_fusion_test.cc | 84 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/ |
D | gpu_device_address.cc | 100 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/ |
D | graph_compiler.cc | 111 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/ |
D | insert_trans_op_test.cc | 113 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/ |
D | pynative_execute.cc | 511 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/ |
D | rectify_do_mask_kernel_info.cc | 39 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/ |
D | ai_core_dynamic_kernel.cc | 152 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/ |
D | insert_cast_cpu.cc | 134 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/ |
D | batchnorm_info.cc | 212 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()
|