Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
alberta3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ians-nmh-siebert
alberta
alberta3
Commits
bcce8167
Commit
bcce8167
authored
16 years ago
by
Claus-Justus Heine
Browse files
Options
Downloads
Patches
Plain Diff
Check for OpenMP
parent
57cdb4c4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
m4/openmp.m4
+40
-0
40 additions, 0 deletions
m4/openmp.m4
with
40 additions
and
0 deletions
m4/openmp.m4
0 → 100644
+
40
−
0
View file @
bcce8167
AC_DEFUN([ALBERTA_OPENMP],
[AC_REQUIRE([AC_PROG_CC])
AC_CHECK_HEADERS([omp.h])
_alberta_save_cflags="${CFLAGS}"
CFLAGS="${CFLAGS} ${OPENMP_CFLAGS}"
AC_LANG_PUSH([C])
AC_MSG_CHECKING(
[for OpenMP availibility with "${CC} ${CFLAGS}"])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[#ifdef HAVE_OMP_H
# include <omp.h>
#endif
#include <stdio.h>],
[int nthreads, tid;
/* Fork a team of threads giving them their own copies of variables */
#pragma omp parallel private(tid)
{
/* Obtain and print thread id */
tid = omp_get_thread_num();
printf("Hello World from thread = %d\n", tid);
/* Only master thread does this */
if (tid == 0)
{
nthreads = omp_get_num_threads();
printf("Number of threads = %d\n", nthreads);
}
} /* All threads join master thread and terminate */])],
[AC_MSG_RESULT([OpenMP seems to be available])
AC_DEFINE([HAVE_OPENMP], 1, [Define to 1 if OpenMP is available])],
[AC_MSG_RESULT([OpenMP seems not to be available])
AC_DEFINE([HAVE_OPENMP], 0, [Define to 1 if OpenMP is available])])
AC_LANG_POP([C])
CFLAGS="${_alberta_save_cflags}"
AC_ARG_VAR([OPENMP_CFLAGS], [C/C++ compiler flags to enable OpenMP])
])
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment