Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -439,9 +439,9 @@ include(cmake/utils/CCache.cmake)

include(CheckCXXCompilerFlag)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
set(CMAKE_CUDA_STANDARD 17)
set(CMAKE_CUDA_STANDARD 20)

# Module rules
include(cmake/modules/CUDA.cmake)
Expand Down
4 changes: 2 additions & 2 deletions cmake/utils/FindLLVM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,9 @@ macro(find_llvm use_llvm)
# compiler-appropriate form so the probe works under MSVC as well.
if(NOT CMAKE_CXX_STANDARD)
if(MSVC)
set(CMAKE_REQUIRED_FLAGS "/std:c++17")
set(CMAKE_REQUIRED_FLAGS "/std:c++20")
else()
set(CMAKE_REQUIRED_FLAGS "-std=c++17")
set(CMAKE_REQUIRED_FLAGS "-std=c++20")
endif()
endif()
check_cxx_source_compiles("
Expand Down
14 changes: 9 additions & 5 deletions docs/install/from_source.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,15 @@ Apache TVM requires the following dependencies:
- CMake (>= 3.24.0)
- LLVM (recommended >= 15)
- Git
- A recent C++ compiler supporting C++ 17, at the minimum
- GCC 7.1
- Clang 5.0
- Apple Clang 9.3
- Visual Studio 2019 (v16.7)
- A recent C++ compiler supporting C++ 20, at the minimum
- GCC 10
- Clang 10
- Apple Clang 14
- Visual Studio 2022

Optional dependencies that use newer C++20 standard library facilities, such
as ``std::format``, may require a newer standard library (for example GCC 13
or newer on Linux).
- Python (>= 3.10)
- (Optional) Conda (Strongly Recommended)

Expand Down
3 changes: 2 additions & 1 deletion include/tvm/tirx/op.h
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,8 @@ inline bool IsPointerType(const Type& type, const DataType& element_type) {
* \param span The location of this operation in the source.
*/
template <typename ValueType,
typename = typename std::enable_if<std::is_pod<ValueType>::value>::type>
typename = typename std::enable_if<std::is_standard_layout<ValueType>::value &&
std::is_trivial<ValueType>::value>::type>
inline PrimExpr make_const(DataType t, ValueType value, Span span = Span());
/*!
* \brief Make a const zero expr.
Expand Down
2 changes: 1 addition & 1 deletion src/relax/transform/run_codegen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class CodeGenRunner : ExprMutator {
if (opt_codegen) {
auto ext_symbol = GetExtSymbol(func);
size_t count = 0;
PostOrderVisit(func->body, [=, &count](Expr e) {
PostOrderVisit(func->body, [=, this, &count](Expr e) {
if (e->IsInstance<ConstantNode>()) {
// Make sure to pick a unique name
auto name = ext_symbol + "_" + opt_codegen.value() + "_const_" + std::to_string(count++);
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/extra/contrib/cudnn/cudnn_json_runtime.cc
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class cuDNNJSONRuntime : public JSONRuntimeBase {
conv_dtype, false, &best_algo);

int algo = best_algo.cast<int>();
std::function<void()> op_exec = [=]() {
std::function<void()> op_exec = [=, this]() {
int device_id;
CUDA_CALL(cudaGetDevice(&device_id));
cudaStream_t stream = static_cast<cudaStream_t>(TVMFFIEnvGetStream(kDLCUDA, device_id));
Expand Down Expand Up @@ -223,7 +223,7 @@ class cuDNNJSONRuntime : public JSONRuntimeBase {
auto runner = tvm::contrib::CuDNNSDPARunner::Create();
runner->Init(batch, seq_len, num_heads, num_kv_heads, head_size, head_size_v, scale, dtype,
layout);
return [=]() {
return [=, this]() {
auto qkv = GetInput(node, 0);
auto workspace = const_cast<DLTensor*>(GetInput(node, 1));
auto out = const_cast<DLTensor*>(data_entry_[EntryID(outputs_[0])]);
Expand Down
4 changes: 3 additions & 1 deletion src/runtime/extra/disco/protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

#include <memory>
#include <string>
#include <type_traits>
#include <utility>
#include <vector>

Expand Down Expand Up @@ -78,7 +79,8 @@ struct DiscoProtocol {
/*!\ brief Arena used by RPCReference to allocate POD memory */
template <typename T>
T* ArenaAlloc(int count) {
static_assert(std::is_pod<T>::value, "need to be trival");
static_assert(std::is_standard_layout<T>::value && std::is_trivial<T>::value,
"need to be trivial");
return arena_.template allocate_<T>(count);
}

Expand Down
4 changes: 3 additions & 1 deletion src/runtime/rpc/rpc_endpoint.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <cmath>
#include <memory>
#include <string>
#include <type_traits>
#include <utility>
#include <vector>

Expand Down Expand Up @@ -312,7 +313,8 @@ class RPCEndpoint::EventHandler : public support::Stream {

template <typename T>
T* ArenaAlloc(int count) {
static_assert(std::is_pod<T>::value, "need to be trival");
static_assert(std::is_standard_layout<T>::value && std::is_trivial<T>::value,
"need to be trivial");
return arena_.template allocate_<T>(count);
}

Expand Down
2 changes: 2 additions & 0 deletions src/s_tir/transform/compact_buffer_region.cc
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ class BufferAccessRegionCollector : public StmtExprVisitor {
}

private:
using StmtExprVisitor::VisitBufferDef;

struct BufferAccessInfo {
/*! \brief The buffer. */
Buffer buffer;
Expand Down
2 changes: 1 addition & 1 deletion src/s_tir/transform/inject_software_pipeline.cc
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ class PipelineRewriter : public StmtExprMutator {
}
}

auto wait_count = [=, &ana_normalized]() {
auto wait_count = [=, this, &ana_normalized]() {
auto sum = PrimExpr(0);
for (auto producer_head : producer_head_per_commit) {
if (producer_head && ana_normalized->CanProve(producer_head.value() >= 0)) {
Expand Down
3 changes: 2 additions & 1 deletion src/target/llvm/codegen_params.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ struct LLVMConstantGetter<T, std::enable_if_t<std::is_floating_point<T>::value>>
static llvm::Constant* getElement(llvm::Type* ty, T t) { return llvm::ConstantFP::get(ty, t); }
};

template <typename T, typename = std::enable_if<std::is_pod<T>::value>>
template <typename T,
typename = std::enable_if_t<std::is_standard_layout<T>::value && std::is_trivial<T>::value>>
void BuildLLVMVector(llvm::Type* element_type, void* tensor_data, size_t num_elements,
std::vector<llvm::Constant*>* elements) {
elements->resize(num_elements, nullptr);
Expand Down
Loading