Skip to content

Commit

Permalink
Move QMC_CLINE to CMake.
Browse files Browse the repository at this point in the history
  • Loading branch information
ye-luo committed Mar 3, 2021
1 parent 4d188e8 commit bd2e49e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 39 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ SET(OHMMS_DIM 3 CACHE STRING "Select physical dimension")
SET(OHMMS_INDEXTYPE int)
MESSAGE(STATUS "defining the float point precision")
SET(OHMMS_PRECISION_FULL double)
set(QMC_CLINE 32 CACHE STRING "Cache/SIMD alignment in bytes")

IF(QMC_CUDA)
SET(QMC_MIXED_PRECISION 1 CACHE BOOL "Enable/disable mixed precision")
SET(OHMMS_PRECISION double)
Expand Down
10 changes: 9 additions & 1 deletion src/Platforms/CPU/SIMD/aligned_allocator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,17 @@

#include <vector>
#include <cstdlib>
#include "alignment.config.h"
#include "config.h"
#include "Mallocator.hpp"

#if defined(__INTEL_COMPILER)
#define ASSUME_ALIGNED(x) __assume_aligned(x,QMC_CLINE)
#elif defined(__GNUC__) && !defined(__ibmxl__)
#define ASSUME_ALIGNED(x) (x) = (__typeof__(x)) __builtin_assume_aligned(x,QMC_CLINE)
#else
#define ASSUME_ALIGNED(x)
#endif

namespace qmcplusplus
{
template<class T, size_t ALIGN = QMC_CLINE>
Expand Down
37 changes: 0 additions & 37 deletions src/Platforms/CPU/SIMD/alignment.config.h

This file was deleted.

1 change: 0 additions & 1 deletion src/Platforms/CUDA/CUDAallocator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include "cudaError.h"
#include "allocator_traits.hpp"
#include "CUDAfill.hpp"
#include "CPU/SIMD/alignment.config.h"

namespace qmcplusplus
{
Expand Down
3 changes: 3 additions & 0 deletions src/config.h.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@
/* Define the full precision: double, long double */
#cmakedefine OHMMS_PRECISION_FULL @OHMMS_PRECISION_FULL@

/* Define Cache/SIMD alignment in bytes */
#cmakedefine QMC_CLINE @QMC_CLINE@

/* Define to 1 if precision is mixed, only for the CPU code */
#cmakedefine MIXED_PRECISION @MIXED_PRECISION@

Expand Down

0 comments on commit bd2e49e

Please sign in to comment.