Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix options and intrinsics for gcc8 and avx2 #262

Merged
merged 2 commits into from
Mar 4, 2020
Merged
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
13 changes: 6 additions & 7 deletions Makefile.config
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ OPT := -g -O3

# 4. Vectorization settings
ifdef AVX_512
VEC_GCC := -mavx512f -mavx512cd # -march=native -fopt-info-vec -mavx
VEC_ICC := -xHost -qopt-zmm-usage=high #-march=native -mtune=native #-xcore-avx512
VEC_GCC := -march=native # -fopt-info-vec -mavx512f -mavx512cd
VEC_ICC := -xHost -qopt-zmm-usage=high # -xcore-avx512
else ifdef AVX2
VEC_GCC := -mavx2
VEC_ICC := -mavx2
VEC_GCC := -mavx2 -mfma
VEC_ICC := -mavx2 -mfma
else
VEC_GCC := -mavx # -fopt-info-vec-all
VEC_ICC := -mavx
Expand Down Expand Up @@ -201,9 +201,8 @@ ifneq ($(CXX),icc)
ifdef CMSSW_BASE
CPPFLAGS += -I$(shell cd $$CMSSW_BASE && scram tool tag tbb INCLUDE)
LDFLAGS_HOST += -L$(shell cd $$CMSSW_BASE && scram tool tag tbb LIBDIR)
else ifneq (,$(realpath /opt/rh/python27/root/usr/include))
CPPFLAGS += -I/opt/rh/python27/root/usr/include
LDFLAGS_HOST += -L/opt/rh/python27/root/usr/lib64
else ifdef TBB_GCC
TBB_PREFIX = $(TBB_GCC)
endif
endif
endif
Expand Down
7 changes: 4 additions & 3 deletions Matriplex/MatriplexCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "immintrin.h"

#if defined(MPLEX_USE_INTRINSICS)

// This seems unnecessary: __AVX__ is usually defined for all higher ISA extensions
#if defined(__MIC__) || defined(__AVX__) || defined(__AVX512F__)

#define MPLEX_INTRINSICS
Expand All @@ -37,14 +37,15 @@
#define MUL(a, b) _mm512_mul_ps(a, b)
#define FMA(a, b, v) _mm512_fmadd_ps(a, b, v)

#elif defined(__AVX2__)
#elif defined(__AVX2__) && defined(__FMA__)

typedef __m256 IntrVec_t;
#define MPLEX_INTRINSICS_WIDTH_BYTES 32
#define MPLEX_INTRINSICS_WIDTH_BITS 256
#define AVX2_INTRINSICS
#define GATHER_INTRINSICS
#define GATHER_IDX_LOAD(name, arr) __m256i name = _mm256_load_epi32(arr);
// Previously used _mm256_load_epi32(arr) here, but that's part of AVX-512F, not AVX2
#define GATHER_IDX_LOAD(name, arr) __m256i name = _mm256_load_si256(reinterpret_cast<const __m256i *>(arr));

#define LD(a, i) _mm256_load_ps(&a[i*N+n])
#define ST(a, i, r) _mm256_store_ps(&a[i*N+n], r)
Expand Down
2 changes: 1 addition & 1 deletion mkFit/MatriplexPackers.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace mkfit {


//==============================================================================
// MatriplexErrParPackerSlurpIn
// MatriplexPackerSlurpIn
//==============================================================================

template<typename D>
Expand Down
2 changes: 1 addition & 1 deletion xeon_scripts/init-env.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

source /cvmfs/cms.cern.ch/slc7_amd64_gcc820/lcg/root/6.18.04-bcolbf/etc/profile.d/init.sh
export TBB_GCC=/cvmfs/cms.cern.ch/slc7_amd64_gcc820/external/tbb/2019_U9
# workaround for https://github.com/cms-sw/cmsdist/issues/5574
# remove when we switch to a ROOT build where that issues is fixed
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$LIBJPEG_TURBO_ROOT/lib64
Expand Down