ifdef __APPLE -> #if defined(__APPLE__)

This commit is contained in:
xiaoyisd 2020-12-09 15:03:57 +08:00
parent cd249089f3
commit 0cf09f4b8e
9 changed files with 10 additions and 10 deletions

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;

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;

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);

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;

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>

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());

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

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,

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