Created
June 22, 2011 16:37
-
-
Save eiiches/1040494 to your computer and use it in GitHub Desktop.
OpenMP with Python/Weave
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import scipy.weave as weave | |
code = \ | |
''' | |
#pragma omp parallel | |
{ | |
printf("ほむほむ\\n"); | |
} | |
''' | |
weave_omp = \ | |
{ | |
'headers': ['<omp.h>'], | |
'extra_compile_args': ['-fopenmp'], | |
'extra_link_args': ['-lgomp'] | |
} | |
weave.inline(code, **weave_omp) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment