Browse Source

ifdef __APPLE -> #if defined(__APPLE__)

tags/v1.1.0
xiaoyisd 5 years ago
parent
commit
0cf09f4b8e
9 changed files with 10 additions and 10 deletions
  1. +1
    -1
      mindspore/ccsrc/backend/session/kernel_graph.cc
  2. +1
    -1
      mindspore/ccsrc/backend/session/session_basic.h
  3. +1
    -1
      mindspore/ccsrc/minddata/dataset/core/tensor.cc
  4. +2
    -2
      mindspore/ccsrc/minddata/dataset/engine/cache/cache_hw.cc
  5. +1
    -1
      mindspore/ccsrc/minddata/dataset/engine/cache/cache_hw.h
  6. +1
    -1
      mindspore/ccsrc/minddata/dataset/engine/datasetops/source/tf_reader_op.cc
  7. +1
    -1
      mindspore/ccsrc/minddata/dataset/util/slice.h
  8. +1
    -1
      mindspore/ccsrc/pipeline/pynative/pynative_execute.cc
  9. +1
    -1
      mindspore/lite/src/runtime/thread_pool.c

+ 1
- 1
mindspore/ccsrc/backend/session/kernel_graph.cc View File

@@ -472,7 +472,7 @@ void KernelGraph::SetKernelInfoForNode(const AnfNodePtr &node) const {
if (kOpAssignKernelNameList.find(AnfAlgo::GetCNodeName(node)) != kOpAssignKernelNameList.end()) {
ResetAssignInputFeaatureMapFlag(node->cast<CNodePtr>());
}
#ifdef __APPLE__
#if defined(__APPLE__)
std::vector<int> feature_map_input_indexs;
#else
std::vector<size_t> feature_map_input_indexs;


+ 1
- 1
mindspore/ccsrc/backend/session/session_basic.h View File

@@ -53,7 +53,7 @@ struct OpRunInfo {
bool is_dynamic_shape = false;
bool is_auto_mixed_precision = false;
std::string next_op_name = "";
#ifdef __APPLE__
#if defined(__APPLE__)
int next_input_index = 0;
#else
size_t next_input_index = 0;


+ 1
- 1
mindspore/ccsrc/minddata/dataset/core/tensor.cc View File

@@ -697,7 +697,7 @@ Status Tensor::GetDataAsNumpyStrings(py::array *data) {
auto itr = begin<std::string_view>();
uint64_t max_value = 0;
for (; itr != end<std::string_view>(); itr++) {
#ifdef __APPLE__
#if defined(__APPLE__)
max_value = fmax((*itr).length(), max_value);
#else
max_value = std::max((*itr).length(), max_value);


+ 2
- 2
mindspore/ccsrc/minddata/dataset/engine/cache/cache_hw.cc View File

@@ -154,7 +154,7 @@ Status CacheServerHW::GetNumaNodeInfo() {
}

Status CacheServerHW::SetAffinity(const Task &tk, numa_id_t numa_node) {
#ifdef __APPLE__
#if defined(__APPLE__)
return Status::OK();
#else
auto r = numa_cpuset_.find(numa_node);
@@ -186,7 +186,7 @@ std::vector<cpu_id_t> CacheServerHW::GetCpuList(numa_id_t numa_id) {
}

numa_id_t CacheServerHW::GetMyNode() const {
#ifdef __APPLE__
#if defined(__APPLE__)
numa_id_t node_id = -1;
#else
numa_id_t node_id = 0;


+ 1
- 1
mindspore/ccsrc/minddata/dataset/engine/cache/cache_hw.h View File

@@ -32,7 +32,7 @@
#include "minddata/dataset/util/status.h"
#include "minddata/dataset/util/task.h"

#ifdef __APPLE__
#if defined(__APPLE__)
#define SYSCTL_CORE_COUNT "machdep.cpu.core_count"
#include <sys/sysctl.h>
#include <mach/thread_policy.h>


+ 1
- 1
mindspore/ccsrc/minddata/dataset/engine/datasetops/source/tf_reader_op.cc View File

@@ -746,7 +746,7 @@ Status TFReaderOp::LoadBytesList(const ColDescriptor &current_col, const dataeng

uint64_t max_size = 0;
for (uint32_t i = 0; i < bytes_list.value_size(); ++i) {
#ifdef __APPLE__
#if defined(__APPLE__)
max_size = fmax(max_size, bytes_list.value(i).size());
#else
max_size = std::max(max_size, bytes_list.value(i).size());


+ 1
- 1
mindspore/ccsrc/minddata/dataset/util/slice.h View File

@@ -23,7 +23,7 @@
#include "minddata/dataset/util/allocator.h"
#include "minddata/dataset/util/status.h"

#ifdef __APPLE__
#if defined(__APPLE__)
#define off64_t off_t
#endif



+ 1
- 1
mindspore/ccsrc/pipeline/pynative/pynative_execute.cc View File

@@ -1337,7 +1337,7 @@ py::object PynativeExecutor::RunOpInMs(const OpExecInfoPtr &op_exec_info, Pynati
ConstructInputTensor(op_exec_info, &tensors_mask, &input_tensors);
// get graph info for checking it whether existing in the cache
std::string graph_info = GetSingleOpGraphInfo(op_exec_info, input_tensors);
#ifdef __APPLE__
#if defined(__APPLE__)
session::OpRunInfo op_run_info = {op_exec_info->op_name,
op_exec_info->py_primitive,
op_exec_info->abstract,


+ 1
- 1
mindspore/lite/src/runtime/thread_pool.c View File

@@ -464,7 +464,7 @@ int SetAffinity(pthread_t thread_id, cpu_set_t *cpuSet) {
}
#endif
#else
#ifdef __APPLE__
#if defined(__APPLE__)
LOG_ERROR("not bind thread to apple's cpu.");
return RET_TP_ERROR;
#else


Loading…
Cancel
Save