Skip to content

Commit

Permalink
feat: add cinatra isa usage
Browse files Browse the repository at this point in the history
  • Loading branch information
helintongh committed Jul 24, 2023
1 parent 2517bdc commit b7d93fc
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,17 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcoroutines")

set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fno-tree-slp-vectorize")

## cinatra指令集功能使用

cinatra支持通过指令集优化其内部逻辑,其通过宏来控制是否使用指令集。使用之前请确保cpu支持。

使用如下命令即可编译带simd优化的cinatra。

```shell
cmake -DENABLE_SIMD=SSE42 .. # 启用sse4.2指令集
cmake -DENABLE_SIMD=AVX2 .. # 启用avx2指令集
```

# 快速示例

## 示例1:一个简单的hello world
Expand Down
11 changes: 11 additions & 0 deletions lang/english/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fno-tree-slp-vectorize"

1. C++20 compiler (gcc 10.2, clang 13, Visual Studio 2022, or later versions)

## Usage:cinatra instruction set optimization

cinatra supports optimizing its internal logic through the instruction set, which controls whether to use the instruction set through macros. Please make sure the cpu support before use.

Use the following command to compile cinatra with simd optimization.

```shell
cmake -DENABLE_SIMD=SSE42 .. # enable sse4.2 instruction set
cmake -DENABLE_SIMD=AVX2 .. # enable avx2 instruction set
```

## Examples

### Example 1: A simple "Hello World"
Expand Down

0 comments on commit b7d93fc

Please sign in to comment.