diff options
| author | Jonathan Peyton <jonathan.l.peyton@intel.com> | 2022-01-31 10:04:49 -0600 |
|---|---|---|
| committer | Jonathan Peyton <jonathan.l.peyton@intel.com> | 2022-02-14 14:10:33 -0600 |
| commit | 1234011b80f835a297482467ca6ca2099677c39c (patch) | |
| tree | e40fd3ab8679c1cf92a90efe04124414975bda50 /openmp/runtime/src/kmp_stub.cpp | |
| parent | aabf6e65fde796fe936988e2f86aec791188954a (diff) | |
[OpenMP][libomp] Introduce oneAPI compiler support
Introduce KMP_COMPILER_ICX macro to represent compilation with oneAPI
compiler.
Fixup flag detection and compiler ID detection in CMake. Older CMake's
detect IntelLLVM as Clang.
Fix compiler warnings.
Fixup many of the tests to have non-empty parallel regions as they are
elided by oneAPI compiler.
Diffstat (limited to 'openmp/runtime/src/kmp_stub.cpp')
| -rw-r--r-- | openmp/runtime/src/kmp_stub.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/openmp/runtime/src/kmp_stub.cpp b/openmp/runtime/src/kmp_stub.cpp index 6aaec688013f..da7340fd1404 100644 --- a/openmp/runtime/src/kmp_stub.cpp +++ b/openmp/runtime/src/kmp_stub.cpp @@ -159,11 +159,11 @@ void *kmp_malloc(size_t size) { } void *kmp_aligned_malloc(size_t sz, size_t a) { i; - int err; void *res; #if KMP_OS_WINDOWS res = _aligned_malloc(sz, a); #else + int err; if ((err = posix_memalign(&res, a, sz))) { errno = err; // can be EINVAL or ENOMEM res = NULL; @@ -393,12 +393,12 @@ void *omp_alloc(size_t size, omp_allocator_handle_t allocator) { void *omp_aligned_alloc(size_t a, size_t size, omp_allocator_handle_t al) { i; - int err; void *res; #if KMP_OS_WINDOWS res = _aligned_malloc(size, a); #else - if (err = posix_memalign(&res, a, size)) { + int err; + if ((err = posix_memalign(&res, a, size))) { errno = err; // can be EINVAL or ENOMEM res = NULL; } @@ -420,12 +420,12 @@ void *omp_calloc(size_t nmemb, size_t size, omp_allocator_handle_t al) { void *omp_aligned_calloc(size_t a, size_t nmemb, size_t size, omp_allocator_handle_t al) { i; - int err; void *res; #if KMP_OS_WINDOWS res = _aligned_recalloc(NULL, nmemb, size, a); #else - if (err = posix_memalign(&res, a, nmemb * size)) { + int err; + if ((err = posix_memalign(&res, a, nmemb * size))) { errno = err; // can be EINVAL or ENOMEM res = NULL; } |
