GMX_CPU_ACCELERATION
"Acceleration for CPU kernels and compiler optimization"
"${GMX_SUGGESTED_CPU_ACCELERATION}"
- None SSE2 SSE4.1 AVX_128_FMA AVX_256 IBM_QPX Sparc64_HPC_ACE)
+ None SSE2 SSE4.1 AVX_128_FMA AVX_256 IBM_QPX Sparc64_HPC_ACE Reference)
gmx_option_multichoice(
GMX_FFT_LIBRARY
None
none gaussian mopac gamess orca)
+gmx_dependent_cache_variable(GMX_NBNXN_REF_KERNEL_TYPE "Reference kernel type (4xn or 2xnn)" STRING "4xn" "GMX_CPU_ACCELERATION STREQUAL REFERENCE")
+gmx_dependent_cache_variable(GMX_NBNXN_REF_KERNEL_WIDTH "Reference kernel width" STRING "4" "GMX_CPU_ACCELERATION STREQUAL REFERENCE")
+
option(GMX_BROKEN_CALLOC "Work around broken calloc()" OFF)
mark_as_advanced(GMX_BROKEN_CALLOC)
option(GMX_LOAD_PLUGINS "Compile with plugin support, needed to read VMD supported file formats" ON)
endif()
elseif(${GMX_CPU_ACCELERATION} STREQUAL "SPARC64_HPC_ACE")
set(GMX_CPU_ACCELERATION_SPARC64_HPC_ACE 1)
+elseif(${GMX_CPU_ACCELERATION} STREQUAL "REFERENCE")
+ add_definitions(-DGMX_SIMD_REFERENCE_PLAIN_C)
+ if(${GMX_NBNXN_REF_KERNEL_TYPE} STREQUAL "4xn")
+ if(${GMX_NBNXN_REF_KERNEL_WIDTH} STREQUAL "2" OR ${GMX_NBNXN_REF_KERNEL_WIDTH} STREQUAL "4" OR ${GMX_NBNXN_REF_KERNEL_WIDTH} STREQUAL "8")
+ add_definitions(-DGMX_NBNXN_SIMD_4XN -DGMX_SIMD_REF_WIDTH=${GMX_NBNXN_REF_KERNEL_WIDTH})
+ else()
+ message(FATAL_ERROR "Unsupported width for 4xn reference kernels")
+ endif()
+ elseif(${GMX_NBNXN_REF_KERNEL_TYPE} STREQUAL "2xnn")
+ if(${GMX_NBNXN_REF_KERNEL_WIDTH} STREQUAL "8" OR ${GMX_NBNXN_REF_KERNEL_WIDTH} STREQUAL "16")
+ add_definitions(-DGMX_NBNXN_SIMD_2XNN -DGMX_SIMD_REF_WIDTH=${GMX_NBNXN_REF_KERNEL_WIDTH})
+ else()
+ message(FATAL_ERROR "Unsupported width for 2xn reference kernels")
+ endif()
+ else()
+ message(FATAL_ERROR "Unsupported kernel type")
+ endif()
else()
gmx_invalid_option_value(GMX_CPU_ACCELERATION)
endif()
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
extern "C" {
#endif
-
-/* For testing the reference plain-C SIMD kernels, uncomment the next lines,
- * as well as the GMX_SIMD_REFERENCE_PLAIN_C define in gromacs/simd/macros.h
- * The actual SIMD width is set in gromacs/simd/macros.h
- * The 4xN reference kernels support 2-, 4- and 8-way SIMD.
- * The 2x(N+N) reference kernels support 8- and 16-way SIMD.
- */
-/* #define GMX_NBNXN_SIMD */
-/* #define GMX_NBNXN_SIMD_4XN */
-/* #define GMX_NBNXN_SIMD_2XNN */
-
+#ifdef GMX_SIMD_REFERENCE_PLAIN_C
+#define GMX_NBNXN_SIMD
+#endif
#if (defined GMX_X86_SSE2) || (defined GMX_CPU_ACCELERATION_IBM_QPX)
/* Use SIMD accelerated nbnxn search and kernels */
/* NOTE: SSE2 acceleration does not include floor or blendv */
-
-/* Uncomment the next line, without other SIMD active, for testing plain-C */
-/* #define GMX_SIMD_REFERENCE_PLAIN_C */
#ifdef GMX_SIMD_REFERENCE_PLAIN_C
/* Plain C SIMD reference implementation, also serves as documentation */
#define GMX_HAVE_SIMD_MACROS
-/* In general the reference SIMD supports any SIMD width, including 1.
- * But the nbnxn SIMD 4xN kernels only support 2, 4, 8 and 2xNN only 8, 16,
- * see types/nb_verlet.h for details
- */
-#define GMX_SIMD_REF_WIDTH 4
-
/* Include plain-C reference implementation, also serves as documentation */
#include "gromacs/simd/macros_ref.h"