mirror of
https://github.com/clearlinux/graphene.git
synced 2026-09-06 13:51:28 +00:00
Previously, OpenMP apps failed to run under Graphene-SGX because it did not support raw system calls (used inside of OpenMP lib, in particular the futex() syscall). Since recently, Graphene-SGX has support for raw syscall execution. This commit adds a test showing that OpenMP works.
16 lines
284 B
C
16 lines
284 B
C
/* build with: gcc -fopenmp openmp-test.c -o openmp-test */
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <omp.h>
|
|
|
|
int v[10];
|
|
|
|
int main(void) {
|
|
#pragma omp parallel for
|
|
for (int i=0; i<10; i++)
|
|
v[i] = i;
|
|
|
|
printf("first: %d, last: %d\n", v[0], v[9]);
|
|
return 0;
|
|
}
|