filename stringlengths 19 182 | omp_pragma_line stringlengths 24 416 | context_chars int64 100 100 | text stringlengths 152 177k |
|---|---|---|---|
void-echo/SDU-Parallel-Lab/LAB/try12/pivot.c | #pragma omp parallel for num_threads(thread_count) | 100 | printf("c_n_m = %d, each_thread_works = %d\n", c_n_m(n, m),
each_thread_works);
<LOOP-START>for (int __thread__ = 0; __thread__ < thread_count; __thread__++) {
struct timeval start1, end1;
gettimeofday(&start1, NULL);
// *******************************************... |
void-echo/SDU-Parallel-Lab/LAB/try8/pivot.c | #pragma omp parallel for num_threads(thread_count) | 100 | nDistanceAndStoreInArray() {
// when adding this pragma, the program can be really fast!
// <LOOP-START>for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
euclidean_distance[i * n + j] = get_distance(i, j);
}
// printf("calcEuclideanDistanceAndStoreInArray: %d\n", i)... |
void-echo/SDU-Parallel-Lab/LAB/try8/pivot.c | #pragma omp parallel for num_threads(thread_count) | 100 | printf("c_n_m = %d, each_thread_works = %d\n", c_n_m(n, m),
each_thread_works);
<LOOP-START>for (int __thread__ = 0; __thread__ < thread_count; __thread__++) {
struct timeval start1, end1;
gettimeofday(&start1, NULL);
// *******************************************... |
void-echo/SDU-Parallel-Lab/LAB/try4/pivot.c | #pragma omp parallel for num_threads(thread_count) | 100 | nDistanceAndStoreInArray() {
// when adding this pragma, the program can be really fast!
// <LOOP-START>for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
euclidean_distance[i * n + j] = get_distance(i, j);
}
// printf("calcEuclideanDistanceAndStoreInArray: %d\n", i)... |
void-echo/SDU-Parallel-Lab/LAB/try4/pivot.c | #pragma omp parallel for num_threads(thread_count) | 100 | chebyshev_matrix;
// omp_lock_t writelock;
// omp_init_lock(&writelock);
// <LOOP-START>for (int i = 0; i < c_n_m(n, m); i++) {
combination *com = next_combination(); // very quick
if (com == NULL) {
break;
}
chebyshev_matrix = (fl... |
Abhiramborige/Parallel_programs_C/sum_for_reduction.c | #pragma omp parallel for default(shared) private(i) reduction(+:sum) | 100 | ;
double t1,t2;
for(int i=0; i<MAX; i++){
array[i]=1;
}
t1=omp_get_wtime();
int i;
<LOOP-START>for(i=0; i<MAX; i++){
sum+=array[i];
}<LOOP-END> <OMP-START>#pragma omp parallel for default(shared) private(i) reduction(+:sum)<OMP-END> |
Abhiramborige/Parallel_programs_C/private.c | #pragma omp parallel for firstprivate(x) | 100 | #include<stdio.h>
#include<omp.h>
int main(){
int x=44;int i;
<LOOP-START>for(i=0; i<10; i++){
x=i;
printf("Thread no. %d and x = %d\n", omp_get_thread_num(), x);
}<LOOP-END> <OMP-START>#pragma omp parallel for firstprivate(x)<OMP-END> |
GuilloteauQ/omp-logs/examples/for_policies.c | #pragma omp parallel for schedule(static) reduction (+:s) | 100 |
task_list* l = task_list_init();
int s = 0;
// A nice for in parallel with openMP
<LOOP-START>for (int j = 0; j < N; j++) {
// We create the structure to hold the ints
struct data d = {j, &s};
/* We log the task
* We give it the info j which is the number that it is ad... |
GuilloteauQ/omp-logs/examples/for_policies.c | #pragma omp parallel for schedule(dynamic) reduction (+:s) | 100 | or_static.svg", 1);
// And we free the list of tasks
l = task_list_init();
s = 0;
<LOOP-START>for (int j = 0; j < N; j++) {
struct data d = {j, &s};
log_task(&l, "Sum", j, omp_get_thread_num(), sum, (void*) &d);
}<LOOP-END> <OMP-START>#pragma omp parallel for schedule(dynamic) red... |
GuilloteauQ/omp-logs/examples/for_policies.c | #pragma omp parallel for schedule(guided) reduction (+:s) | 100 | *) &d);
}
tasks_to_svg(l, "for_dynamic.svg", 1);
l = task_list_init();
s = 0;
<LOOP-START>for (int j = 0; j < N; j++) {
struct data d = {j, &s};
log_task(&l, "Sum", j, omp_get_thread_num(), sum, (void*) &d);
}<LOOP-END> <OMP-START>#pragma omp parallel for schedule(guided) redu... |
abagali1/mandelbrot/parallel/mandelbrot_openmp.c | #pragma omp parallel for | 100 | (*colors)[X][3] = malloc(sizeof(uchar[Y][X][3]));
Color* palette = make_palette(MAX_ITER);
<LOOP-START>for(int Py = 0; Py < Y; Py++){
for(int Px = 0; Px < X; Px++){
Color c = mandelbrot(Px, Py, palette);
colors[Py][Px][0] = c.r;
colors[Py][Px][1] = c.g;
c... |
abagali1/mandelbrot/parallel/mandelbrot_cuda.c | #pragma omp parallel for | 100 | (*colors)[X][3] = malloc(sizeof(uchar[Y][X][3]));
Color* palette = make_palette(MAX_ITER);
<LOOP-START>for(int Py = 0; Py < Y; Py++){
for(int Px = 0; Px < X; Px++){
Color c = mandelbrot(Px, Py, palette);
colors[Py][Px][0] = c.r;
colors[Py][Px][1] = c.g;
c... |
PAC-P2P/BPNN-Face-Recognition-For-Parallel/src/backprop.c | #pragma omp parallel for | 100 | NULL) {
printf("ALLOC_2D_DBL: Couldn't allocate array of dbl ptrs\n");
return (NULL);
}
<LOOP-START>for (i = 0; i < m; i++) {
new[i] = alloc_1d_dbl(n);
}<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END> |
PAC-P2P/BPNN-Face-Recognition-For-Parallel/src/backprop.c | #pragma omp parallel for | 100 | (n);
}
return (new);
}
void bpnn_randomize_weights(double **w,int m,int n)
{
int i, j;
<LOOP-START>for (i = 0; i <= m; i++) {
for (j = 0; j <= n; j++) {
w[i][j] = dpn1();
}
}<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END> |
PAC-P2P/BPNN-Face-Recognition-For-Parallel/src/backprop.c | #pragma omp parallel for | 100 | w[i][j] = dpn1();
}
}
}
void bpnn_zero_weights(double **w,int m,int n)
{
int i, j;
<LOOP-START>for (i = 0; i <= m; i++) {
for (j = 0; j <= n; j++) {
w[i][j] = 0.0;
}
}<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END> |
PAC-P2P/BPNN-Face-Recognition-For-Parallel/src/backprop.c | #pragma omp parallel for | 100 | e((char *) net->hidden_delta);
free((char *) net->output_delta);
free((char *) net->target);
<LOOP-START>for (i = 0; i <= n1; i++) {
free((char *) net->input_weights[i]);
free((char *) net->input_prev_weights[i]);
}<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END> |
PAC-P2P/BPNN-Face-Recognition-For-Parallel/src/backprop.c | #pragma omp parallel for | 100 | _weights[i]);
}
free((char *) net->input_weights);
free((char *) net->input_prev_weights);
<LOOP-START>for (i = 0; i <= n2; i++) {
free((char *) net->hidden_weights[i]);
free((char *) net->hidden_prev_weights[i]);
}<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.