Use C++20 (#3050)
This commit is contained in:
+1
-1
@@ -22,7 +22,7 @@ project(
|
||||
|
||||
# ----------------------------- Setup -----------------------------
|
||||
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
set(CMAKE_INSTALL_MESSAGE NEVER)
|
||||
|
||||
@@ -45,7 +45,7 @@ The next step is to setup a CMake file in ``CMakeLists.txt``:
|
||||
|
||||
project(example LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ Build from source
|
||||
Build Requirements
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- A C++ compiler with C++17 support (e.g. Clang >= 5.0)
|
||||
- A C++ compiler with C++20 support (e.g. Clang >= 15.0)
|
||||
- `cmake <https://cmake.org/>`_ -- version 3.25 or later, and ``make``
|
||||
- Xcode >= 15.0 and macOS SDK >= 14.0
|
||||
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
// Required for using M_LN2 in MSVC.
|
||||
#define _USE_MATH_DEFINES
|
||||
|
||||
#include <math.h>
|
||||
#include <stdint.h>
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <complex>
|
||||
#include <functional>
|
||||
|
||||
|
||||
@@ -126,9 +126,9 @@ endif()
|
||||
target_compile_options(
|
||||
mlx PRIVATE "$<$<COMPILE_LANGUAGE:CUDA>:--Wno-deprecated-gpu-targets>")
|
||||
|
||||
# Suppress nvcc warnings on MLX headers.
|
||||
target_compile_options(mlx PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:-Xcudafe
|
||||
--diag_suppress=997>)
|
||||
# Suppress nvcc warnings on C++ headers.
|
||||
target_compile_options(
|
||||
mlx PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:-Xcudafe="--diag_suppress=997,20208">)
|
||||
|
||||
# Use stronger binaries compression. This feature was introduced in CUDA 12.8
|
||||
# and requires drivers released after CUDA 12.4.
|
||||
|
||||
@@ -697,8 +697,8 @@ void MaskedScatter::eval_gpu(const std::vector<array>& inputs, array& out) {
|
||||
auto lib = d.get_library(kernel_name, [&]() {
|
||||
std::string source = metal::utils();
|
||||
source += metal::masked_scatter();
|
||||
source += fmt::format(
|
||||
std::string(masked_assign_kernel), kernel_name, value_type, contiguous);
|
||||
source +=
|
||||
fmt::format(masked_assign_kernel, kernel_name, value_type, contiguous);
|
||||
return source;
|
||||
});
|
||||
auto kernel = d.get_kernel(kernel_name, lib);
|
||||
|
||||
@@ -5,6 +5,15 @@
|
||||
|
||||
using namespace mlx::core;
|
||||
|
||||
namespace std {
|
||||
|
||||
// Required to make doctest compile.
|
||||
ostream& operator<<(ostream& os, const vector<vector<int>>&) {
|
||||
return os;
|
||||
}
|
||||
|
||||
} // namespace std
|
||||
|
||||
TEST_CASE("test einsum path") {
|
||||
std::vector<std::vector<int>> expected = {{1, 2}, {0, 1}};
|
||||
auto path =
|
||||
|
||||
Reference in New Issue
Block a user