// Copyright (c) 2021 CINN Authors. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #include "paddle/cinn/lang/placeholder.h" #include "paddle/cinn/runtime/intrinsic.h" namespace cinn { namespace lang { using cinn::common::bfloat16; using cinn::common::float16; ir::Tensor CreatePlaceHolder(const std::vector &shape, Type type, const std::string &name) { std::vector expr_shape; for (int s : shape) { expr_shape.push_back(Expr(s)); } return CreatePlaceHolder(expr_shape, type, name); } ir::Tensor CreatePlaceHolder(const std::vector &shape, Type type, const std::string &name) { if (type.is_float(32)) { return Placeholder(name, shape); } else if (type.is_float(64)) { return Placeholder(name, shape); } else if (type.is_bfloat16()) { return Placeholder(name, shape); } else if (type.is_float16()) { return Placeholder(name, shape); } else if (type.is_int(8)) { return Placeholder(name, shape); } else if (type.is_int(16)) { return Placeholder(name, shape); } else if (type.is_int(32)) { return Placeholder(name, shape); } else if (type.is_int(64)) { return Placeholder(name, shape); } else if (type.is_uint(8)) { return Placeholder(name, shape); } else if (type.is_uint(16)) { return Placeholder(name, shape); } else if (type.is_uint(32)) { return Placeholder(name, shape); } else if (type.is_uint(64)) { return Placeholder(name, shape); } else if (type.is_bool()) { return Placeholder(name, shape); } CINN_NOT_IMPLEMENTED } } // namespace lang } // namespace cinn