| 1564 | } // namespace |
| 1565 | |
| 1566 | Status ValidateKernelRegistrations(const OpRegistryInterface& op_registry) { |
| 1567 | auto typed_registry = GlobalKernelRegistryTyped(); |
| 1568 | tf_shared_lock lock(typed_registry->mu); |
| 1569 | for (const auto& key_registration : typed_registry->registry) { |
| 1570 | const KernelDef& kernel_def(key_registration.second.def); |
| 1571 | const OpRegistrationData* op_reg_data; |
| 1572 | const Status status = op_registry.LookUp(kernel_def.op(), &op_reg_data); |
| 1573 | if (!status.ok()) { |
| 1574 | // TODO(josh11b): Make this a hard error. |
| 1575 | LOG(ERROR) << "OpKernel ('" << ProtoShortDebugString(kernel_def) |
| 1576 | << "') for unknown op: " << kernel_def.op(); |
| 1577 | continue; |
| 1578 | } |
| 1579 | const OpDef& op_def = op_reg_data->op_def; |
| 1580 | for (const auto& host_memory_arg : kernel_def.host_memory_arg()) { |
| 1581 | if (!FindArgInOp(host_memory_arg, op_def.input_arg()) && |
| 1582 | !FindArgInOp(host_memory_arg, op_def.output_arg())) { |
| 1583 | return errors::InvalidArgument( |
| 1584 | "HostMemory arg '", host_memory_arg, |
| 1585 | "' not found in OpDef: ", SummarizeOpDef(op_def)); |
| 1586 | } |
| 1587 | } |
| 1588 | } |
| 1589 | return Status::OK(); |
| 1590 | } |
| 1591 | |
| 1592 | template <> |
| 1593 | const Eigen::ThreadPoolDevice& OpKernelContext::eigen_device() const { |
no test coverage detected