[gmx-users] How can Build gromacs using MSVC on Win64 with AVX2?

Tatsuro MATSUOKA tmacchant3 at yahoo.co.jp
Thu Sep 12 07:15:41 CEST 2019


On GROMACS 2019.3, GROMACS cannot be built with AVX2.

In gmxSimdFlags.cmake

        SIMD_AVX2_C_FLAGS SIMD_AVX2_CXX_FLAGS
        "${TOOLCHAIN_FLAG_FOR_AVX2}" "-mavx2" "/arch:AVX" "-hgnu") # no AVX2-specific flag for MSVC yet

If I modify the above, "/arch:AVX" => "/arch:AVX" ,

-- Performing Test C_mavx2_mfma_FLAG_ACCEPTED
-- Performing Test C_mavx2_mfma_FLAG_ACCEPTED - Failed
-- Performing Test C_mavx2_FLAG_ACCEPTED
-- Performing Test C_mavx2_FLAG_ACCEPTED - Failed
-- Performing Test C_arch_AVX2_FLAG_ACCEPTED
-- Performing Test C_arch_AVX2_FLAG_ACCEPTED - Success
-- Performing Test C_arch_AVX2_COMPILE_WORKS
-- Performing Test C_arch_AVX2_COMPILE_WORKS - Success
-- Performing Test CXX_mavx2_mfma_FLAG_ACCEPTED
-- Performing Test CXX_mavx2_mfma_FLAG_ACCEPTED - Failed
-- Performing Test CXX_mavx2_FLAG_ACCEPTED
-- Performing Test CXX_mavx2_FLAG_ACCEPTED - Failed
-- Performing Test CXX_arch_AVX2_FLAG_ACCEPTED
-- Performing Test CXX_arch_AVX2_FLAG_ACCEPTED - Success
-- Performing Test CXX_arch_AVX2_COMPILE_WORKS
-- Performing Test CXX_arch_AVX2_COMPILE_WORKS - Success
-- Enabling 256-bit AVX2 SIMD instructions using CXX flags:  /arch:AVX2


But avx components 

         nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_avx_256_single.cpp
         nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_avx_256_single.cpp
         nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_avx_256_single.cpp
         nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_avx_256_single.cpp
         nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_avx_256_single.cpp
         nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_avx_256_single.cpp
         nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_avx_256_single.cpp
are complied.

How can I compile "avx2_256" files?

Tatsuro



More information about the gromacs.org_gmx-users mailing list