Skip to content

Commit

Permalink
[env](compile) compile failed caused by <immintrin.h> (#37068) (#38130)
Browse files Browse the repository at this point in the history
pick from master #37068
  • Loading branch information
xiedeyantu authored Jul 20, 2024
1 parent 7b74e8d commit 2e79612
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions be/src/util/simd/vstring_function.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@

#pragma once

#ifdef __AVX2__
#include <immintrin.h>

#include "gutil/macros.h"
#endif
#include <unistd.h>

#include <array>
Expand Down Expand Up @@ -112,7 +116,7 @@ class VStringFunctions {

if constexpr (trim_single) {
const auto ch = remove_str.data[0];
#if defined(__AVX2__) || defined(__aarch64__)
#if defined(__AVX2__)
constexpr auto AVX2_BYTES = sizeof(__m256i);
const auto size = end - begin;
const auto* const avx2_begin = end - size / AVX2_BYTES * AVX2_BYTES;
Expand Down Expand Up @@ -153,7 +157,7 @@ class VStringFunctions {

if constexpr (trim_single) {
const auto ch = remove_str.data[0];
#if defined(__AVX2__) || defined(__aarch64__)
#if defined(__AVX2__)
constexpr auto AVX2_BYTES = sizeof(__m256i);
const auto size = end - begin;
const auto* const avx2_end = begin + size / AVX2_BYTES * AVX2_BYTES;
Expand Down

0 comments on commit 2e79612

Please sign in to comment.