| @@ -472,7 +472,7 @@ void KernelGraph::SetKernelInfoForNode(const AnfNodePtr &node) const { | |||||
| if (kOpAssignKernelNameList.find(AnfAlgo::GetCNodeName(node)) != kOpAssignKernelNameList.end()) { | if (kOpAssignKernelNameList.find(AnfAlgo::GetCNodeName(node)) != kOpAssignKernelNameList.end()) { | ||||
| ResetAssignInputFeaatureMapFlag(node->cast<CNodePtr>()); | ResetAssignInputFeaatureMapFlag(node->cast<CNodePtr>()); | ||||
| } | } | ||||
| #ifdef __APPLE__ | |||||
| #if defined(__APPLE__) | |||||
| std::vector<int> feature_map_input_indexs; | std::vector<int> feature_map_input_indexs; | ||||
| #else | #else | ||||
| std::vector<size_t> feature_map_input_indexs; | std::vector<size_t> feature_map_input_indexs; | ||||
| @@ -53,7 +53,7 @@ struct OpRunInfo { | |||||
| bool is_dynamic_shape = false; | bool is_dynamic_shape = false; | ||||
| bool is_auto_mixed_precision = false; | bool is_auto_mixed_precision = false; | ||||
| std::string next_op_name = ""; | std::string next_op_name = ""; | ||||
| #ifdef __APPLE__ | |||||
| #if defined(__APPLE__) | |||||
| int next_input_index = 0; | int next_input_index = 0; | ||||
| #else | #else | ||||
| size_t next_input_index = 0; | size_t next_input_index = 0; | ||||
| @@ -697,7 +697,7 @@ Status Tensor::GetDataAsNumpyStrings(py::array *data) { | |||||
| auto itr = begin<std::string_view>(); | auto itr = begin<std::string_view>(); | ||||
| uint64_t max_value = 0; | uint64_t max_value = 0; | ||||
| for (; itr != end<std::string_view>(); itr++) { | for (; itr != end<std::string_view>(); itr++) { | ||||
| #ifdef __APPLE__ | |||||
| #if defined(__APPLE__) | |||||
| max_value = fmax((*itr).length(), max_value); | max_value = fmax((*itr).length(), max_value); | ||||
| #else | #else | ||||
| max_value = std::max((*itr).length(), max_value); | max_value = std::max((*itr).length(), max_value); | ||||
| @@ -154,7 +154,7 @@ Status CacheServerHW::GetNumaNodeInfo() { | |||||
| } | } | ||||
| Status CacheServerHW::SetAffinity(const Task &tk, numa_id_t numa_node) { | Status CacheServerHW::SetAffinity(const Task &tk, numa_id_t numa_node) { | ||||
| #ifdef __APPLE__ | |||||
| #if defined(__APPLE__) | |||||
| return Status::OK(); | return Status::OK(); | ||||
| #else | #else | ||||
| auto r = numa_cpuset_.find(numa_node); | 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 { | numa_id_t CacheServerHW::GetMyNode() const { | ||||
| #ifdef __APPLE__ | |||||
| #if defined(__APPLE__) | |||||
| numa_id_t node_id = -1; | numa_id_t node_id = -1; | ||||
| #else | #else | ||||
| numa_id_t node_id = 0; | numa_id_t node_id = 0; | ||||
| @@ -32,7 +32,7 @@ | |||||
| #include "minddata/dataset/util/status.h" | #include "minddata/dataset/util/status.h" | ||||
| #include "minddata/dataset/util/task.h" | #include "minddata/dataset/util/task.h" | ||||
| #ifdef __APPLE__ | |||||
| #if defined(__APPLE__) | |||||
| #define SYSCTL_CORE_COUNT "machdep.cpu.core_count" | #define SYSCTL_CORE_COUNT "machdep.cpu.core_count" | ||||
| #include <sys/sysctl.h> | #include <sys/sysctl.h> | ||||
| #include <mach/thread_policy.h> | #include <mach/thread_policy.h> | ||||
| @@ -746,7 +746,7 @@ Status TFReaderOp::LoadBytesList(const ColDescriptor ¤t_col, const dataeng | |||||
| uint64_t max_size = 0; | uint64_t max_size = 0; | ||||
| for (uint32_t i = 0; i < bytes_list.value_size(); ++i) { | 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()); | max_size = fmax(max_size, bytes_list.value(i).size()); | ||||
| #else | #else | ||||
| max_size = std::max(max_size, bytes_list.value(i).size()); | max_size = std::max(max_size, bytes_list.value(i).size()); | ||||
| @@ -23,7 +23,7 @@ | |||||
| #include "minddata/dataset/util/allocator.h" | #include "minddata/dataset/util/allocator.h" | ||||
| #include "minddata/dataset/util/status.h" | #include "minddata/dataset/util/status.h" | ||||
| #ifdef __APPLE__ | |||||
| #if defined(__APPLE__) | |||||
| #define off64_t off_t | #define off64_t off_t | ||||
| #endif | #endif | ||||
| @@ -1337,7 +1337,7 @@ py::object PynativeExecutor::RunOpInMs(const OpExecInfoPtr &op_exec_info, Pynati | |||||
| ConstructInputTensor(op_exec_info, &tensors_mask, &input_tensors); | ConstructInputTensor(op_exec_info, &tensors_mask, &input_tensors); | ||||
| // get graph info for checking it whether existing in the cache | // get graph info for checking it whether existing in the cache | ||||
| std::string graph_info = GetSingleOpGraphInfo(op_exec_info, input_tensors); | 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, | session::OpRunInfo op_run_info = {op_exec_info->op_name, | ||||
| op_exec_info->py_primitive, | op_exec_info->py_primitive, | ||||
| op_exec_info->abstract, | op_exec_info->abstract, | ||||
| @@ -464,7 +464,7 @@ int SetAffinity(pthread_t thread_id, cpu_set_t *cpuSet) { | |||||
| } | } | ||||
| #endif | #endif | ||||
| #else | #else | ||||
| #ifdef __APPLE__ | |||||
| #if defined(__APPLE__) | |||||
| LOG_ERROR("not bind thread to apple's cpu."); | LOG_ERROR("not bind thread to apple's cpu."); | ||||
| return RET_TP_ERROR; | return RET_TP_ERROR; | ||||
| #else | #else | ||||