Skip to content

Commit 46012f8

Browse files
authored
Merge pull request #54 from dgasmith/pragma
C: The ability to turn off pragmas and aligned mallocs
2 parents 38a142c + 29d12ac commit 46012f8

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

gau2grid/c_pragma.py

+13-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,18 @@
99
1010
#pragma once
1111
12-
#if defined(__ICC) || defined(__INTEL_COMPILER)
12+
13+
#if defined(__GG_NO_PRAGMA)
14+
// Turn everything off if there are issues
15+
16+
#define ALIGNED_MALLOC(alignment, size) malloc(size)
17+
#define ALIGNED_FREE(ptr) free(ptr)
18+
#define ASSUME_ALIGNED(ptr, width)
19+
20+
#define PRAGMA_VECTORIZE
21+
#define PRAGMA_RESTRICT
22+
23+
#elif defined(__ICC) || defined(__INTEL_COMPILER)
1324
// pragmas for Intel
1425
1526
#define ALIGNED_MALLOC(alignment, size) _mm_malloc(size, alignment)
@@ -28,7 +39,7 @@
2839
2940
#define PRAGMA_VECTORIZE __pragma(loop(ivdep))
3041
#define PRAGMA_RESTRICT __restrict
31-
42+
3243
#elif defined(__clang__)
3344
// pragmas for Clang.
3445
// Do this before GCC because clang also defines __GNUC__

0 commit comments

Comments
 (0)