diff --git a/cmake/cinn/external/absl.cmake b/cmake/cinn/external/absl.cmake
index bec032ff3f763f..076b46b711ac06 100644
--- a/cmake/cinn/external/absl.cmake
+++ b/cmake/cinn/external/absl.cmake
@@ -38,37 +38,14 @@ ExternalProject_Add(
-DCMAKE_INSTALL_PREFIX:PATH=${ABSL_INSTALL_DIR}
-DCMAKE_INSTALL_LIBDIR:PATH=${ABSL_INSTALL_DIR}/lib
-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON
- -DCMAKE_BUILD_TYPE:STRING=${THIRD_PARTY_BUILD_TYPE}
- BUILD_BYPRODUCTS ${ABSL_INSTALL_DIR}/lib/libabsl_base.a
- BUILD_BYPRODUCTS ${ABSL_INSTALL_DIR}/lib/libabsl_hash.a
- BUILD_BYPRODUCTS ${ABSL_INSTALL_DIR}/lib/libabsl_string_view.a
- BUILD_BYPRODUCTS ${ABSL_INSTALL_DIR}/lib/libabsl_low_level_hash.a
- BUILD_BYPRODUCTS ${ABSL_INSTALL_DIR}/lib/libabsl_demangle_internal.a
- BUILD_BYPRODUCTS ${ABSL_INSTALL_DIR}/lib/libabsl_raw_logging_internal.a
- BUILD_BYPRODUCTS ${ABSL_INSTALL_DIR}/lib/libabsl_city.a
- BUILD_BYPRODUCTS ${ABSL_INSTALL_DIR}/lib/libabsl_strings.a
- BUILD_BYPRODUCTS ${ABSL_INSTALL_DIR}/lib/libabsl_throw_delegate.a
- BUILD_BYPRODUCTS ${ABSL_INSTALL_DIR}/lib/libabsl_bad_any_cast_impl.a
- BUILD_BYPRODUCTS ${ABSL_INSTALL_DIR}/lib/libabsl_bad_optional_access.a
- BUILD_BYPRODUCTS ${ABSL_INSTALL_DIR}/lib/libabsl_bad_variant_access.a)
+ -DCMAKE_BUILD_TYPE:STRING=${THIRD_PARTY_BUILD_TYPE})
# It may be more convenient if we just include all absl libs
-set(ABSL_LIB_NAMES
- hash
- string_view
- low_level_hash
- demangle_internal
- raw_logging_internal
- city
- strings
- throw_delegate
- bad_any_cast_impl
- bad_optional_access
- bad_variant_access)
+set(ABSL_LIB_NAMES "")
set(ABSL_LIBS "")
if(WITH_ROCM)
- list(APPEND ABSL_LIB_NAMES strings_internal raw_logging_internal)
+ list(APPEND ABSL_LIB_NAMES strings_internal)
endif()
add_library(absl STATIC IMPORTED GLOBAL)
diff --git a/paddle/cinn/adt/op_equation_context.h b/paddle/cinn/adt/op_equation_context.h
index 494b731638d9c7..d3ebdf5b37823d 100644
--- a/paddle/cinn/adt/op_equation_context.h
+++ b/paddle/cinn/adt/op_equation_context.h
@@ -64,7 +64,7 @@ class OpEquationContext {
template
const T& Attr(const std::string& name) const {
- return absl::get(GetAttribute(name));
+ return std::get(GetAttribute(name));
}
protected:
diff --git a/paddle/cinn/backends/compiler.cc b/paddle/cinn/backends/compiler.cc
index 8d39efe823a01c..ebf6a6955bbe83 100644
--- a/paddle/cinn/backends/compiler.cc
+++ b/paddle/cinn/backends/compiler.cc
@@ -564,7 +564,7 @@ void Compiler::ExportObject(const std::string& path) {
engine_->ExportObject(path);
}
-void* Compiler::Lookup(absl::string_view fn_name) {
+void* Compiler::Lookup(std::string_view fn_name) {
PADDLE_ENFORCE_NOT_NULL(
engine_, ::common::errors::InvalidArgument("Sorry, engine_ is nullptr"));
if (engine_->Lookup(fn_name) != nullptr) {
diff --git a/paddle/cinn/backends/compiler.h b/paddle/cinn/backends/compiler.h
index 81c6cd6e62d83c..cfb5f8b0b37b83 100644
--- a/paddle/cinn/backends/compiler.h
+++ b/paddle/cinn/backends/compiler.h
@@ -14,7 +14,7 @@
#pragma once
-#include
+#include
#include
#include
@@ -127,7 +127,7 @@ class Compiler final {
* Retrieve a function by \p fn_name.
* @return function address or null if not exists.
*/
- void* Lookup(absl::string_view fn_name);
+ void* Lookup(std::string_view fn_name);
std::vector GetFnPtr() const { return fn_ptr_; }
diff --git a/paddle/cinn/backends/extern_func_emitter.cc b/paddle/cinn/backends/extern_func_emitter.cc
index 2c19730dc9226b..b6fdb764be588f 100644
--- a/paddle/cinn/backends/extern_func_emitter.cc
+++ b/paddle/cinn/backends/extern_func_emitter.cc
@@ -14,9 +14,7 @@
#include "paddle/cinn/backends/extern_func_emitter.h"
-#include
#include
-
#include
#include
#include
@@ -85,8 +83,8 @@ namespace std {
size_t hash::operator()(
const cinn::backends::ExternFuncID& x) const {
- return absl::Hash{}(x.name) ^
- absl::Hash{}(x.backend_id);
+ return std::hash{}(x.name) ^
+ std::hash{}(x.backend_id);
}
} // namespace std
diff --git a/paddle/cinn/backends/function_prototype.h b/paddle/cinn/backends/function_prototype.h
index d68d7c4c9c4447..0859a441ab5970 100644
--- a/paddle/cinn/backends/function_prototype.h
+++ b/paddle/cinn/backends/function_prototype.h
@@ -14,7 +14,7 @@
#pragma once
-#include
+#include
#include
#include
diff --git a/paddle/cinn/backends/llvm/codegen_llvm.cc b/paddle/cinn/backends/llvm/codegen_llvm.cc
index 4c338ec69949fc..dbf9a46c1b369a 100644
--- a/paddle/cinn/backends/llvm/codegen_llvm.cc
+++ b/paddle/cinn/backends/llvm/codegen_llvm.cc
@@ -1511,7 +1511,7 @@ void CodeGenLLVM::InitTarget(const Target &target) {
}
void CodeGenLLVM::AddTbaaMetadata(llvm::Instruction *inst,
- absl::string_view buffer,
+ std::string_view buffer,
Expr index) {
// If the index is constant, generate some TBAA info that helps LLVM
// understand our loads/stores aren't aliased.
diff --git a/paddle/cinn/backends/llvm/codegen_llvm.h b/paddle/cinn/backends/llvm/codegen_llvm.h
index f1befe4429bec9..4285dd4e98e246 100644
--- a/paddle/cinn/backends/llvm/codegen_llvm.h
+++ b/paddle/cinn/backends/llvm/codegen_llvm.h
@@ -14,7 +14,6 @@
#pragma once
-#include
#include
#include
#include
@@ -24,6 +23,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -254,7 +254,7 @@ class CodeGenLLVM : public LLVMIRVisitor, public IrBuilderMixin {
* can optimize by reordering loads and stores across different buffers.
*/
void AddTbaaMetadata(llvm::Instruction *inst,
- absl::string_view buffer,
+ std::string_view buffer,
Expr index);
void InitTarget(const Target &target);
diff --git a/paddle/cinn/backends/llvm/execution_engine.cc b/paddle/cinn/backends/llvm/execution_engine.cc
index 91a32c283c77db..9d77f42240db7b 100644
--- a/paddle/cinn/backends/llvm/execution_engine.cc
+++ b/paddle/cinn/backends/llvm/execution_engine.cc
@@ -14,7 +14,6 @@
#include "paddle/cinn/backends/llvm/execution_engine.h"
-#include
#include
#include
#include
@@ -52,6 +51,7 @@
#include
#include // NOLINT
#include
+#include
#include
#include "paddle/cinn/backends/codegen_cuda_host.h"
@@ -265,7 +265,7 @@ void ExecutionEngine::ExportObject(const std::string &path) {
fclose(of);
}
-void *ExecutionEngine::Lookup(absl::string_view name) {
+void *ExecutionEngine::Lookup(std::string_view name) {
utils::RecordEvent("ExecutionEngine Lookup", utils::EventType::kOrdinary);
std::lock_guard lock(mu_);
if (auto symbol = jit_->lookup(AsStringRef(name))) {
diff --git a/paddle/cinn/backends/llvm/execution_engine.h b/paddle/cinn/backends/llvm/execution_engine.h
index cd5f2e4499e9d1..26fdf13bd51088 100644
--- a/paddle/cinn/backends/llvm/execution_engine.h
+++ b/paddle/cinn/backends/llvm/execution_engine.h
@@ -73,7 +73,7 @@ class ExecutionEngine {
static std::unique_ptr Create(
const ExecutionOptions &config);
- void *Lookup(absl::string_view name);
+ void *Lookup(std::string_view name);
template
void Link(const ir::Module &module);
diff --git a/paddle/cinn/backends/llvm/generate_runtime_llvm_ir.py b/paddle/cinn/backends/llvm/generate_runtime_llvm_ir.py
index 257ef3a7215f0c..87b41abf1daf09 100644
--- a/paddle/cinn/backends/llvm/generate_runtime_llvm_ir.py
+++ b/paddle/cinn/backends/llvm/generate_runtime_llvm_ir.py
@@ -24,10 +24,10 @@ def main():
llvm_config = sys.argv[3]
srcs = []
- srcs.append('#include ')
+ srcs.append('#include ')
# srcs.append('#include "paddle/cinn/backends/llvm/cinn_runtime_llvm_ir.h"\n')
srcs.append('namespace cinn::backends {')
- srcs.append("static const absl::string_view kRuntimeLlvmIr(")
+ srcs.append("static const std::string_view kRuntimeLlvmIr(")
srcs.append('R"ROC(')
with open(path, 'r') as fr:
srcs.append(fr.read())
diff --git a/paddle/cinn/backends/llvm/llvm_util.h b/paddle/cinn/backends/llvm/llvm_util.h
index fb65ae457f9305..19b2c5ddd66f8e 100644
--- a/paddle/cinn/backends/llvm/llvm_util.h
+++ b/paddle/cinn/backends/llvm/llvm_util.h
@@ -14,7 +14,6 @@
#pragma once
-#include
#include
#include
#include
@@ -26,6 +25,7 @@
#include
#include
+#include
#include
#include
@@ -45,7 +45,7 @@ std::string DumpToString(const T &entity) {
// return "\033[33m" + buffer + "\033[0m"; // Green
}
-inline llvm::StringRef AsStringRef(absl::string_view str) {
+inline llvm::StringRef AsStringRef(std::string_view str) {
return llvm::StringRef(str.data(), str.size());
}
diff --git a/paddle/cinn/backends/llvm/runtime_symbol_registry.cc b/paddle/cinn/backends/llvm/runtime_symbol_registry.cc
index 2609b4fd4872aa..f96e4ea24407f3 100644
--- a/paddle/cinn/backends/llvm/runtime_symbol_registry.cc
+++ b/paddle/cinn/backends/llvm/runtime_symbol_registry.cc
@@ -14,10 +14,10 @@
#include "paddle/cinn/backends/llvm/runtime_symbol_registry.h"
-#include
#include
#include
+#include
#include "paddle/cinn/runtime/flags.h"
#include "paddle/common/enforce.h"
@@ -32,7 +32,7 @@ RuntimeSymbols &GlobalSymbolRegistry::Global() {
return symbols;
}
-void *RuntimeSymbols::Lookup(absl::string_view name) const {
+void *RuntimeSymbols::Lookup(std::string_view name) const {
std::lock_guard lock(mu_);
auto it = symbols_.find(std::string(name));
if (it != symbols_.end()) {
diff --git a/paddle/cinn/backends/llvm/runtime_symbol_registry.h b/paddle/cinn/backends/llvm/runtime_symbol_registry.h
index bffdb451aa0487..373cb8eea803fc 100644
--- a/paddle/cinn/backends/llvm/runtime_symbol_registry.h
+++ b/paddle/cinn/backends/llvm/runtime_symbol_registry.h
@@ -14,14 +14,14 @@
#pragma once
-#include
-#include
-#include
#include
+#include
+#include
#include