Skip to content

Commit

Permalink
Update omp_set_num_threads to void
Browse files Browse the repository at this point in the history
OpenMP Spec says omp_set_num_threads(..) should be a void. This conflicts with some research toolchains.
  • Loading branch information
nmhamster authored Apr 4, 2022
1 parent 7576016 commit c0f644d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions target/openmp.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ OpenMP wrapper for headerfile
#ifdef _OPENMP
#include <omp.h>
#else
inline int omp_get_thread_num() { return 0; }
inline int omp_get_max_threads() { return 1; }
inline int omp_set_num_threads(int num_threads) { return 1; }
inline int __sync_fetch_and_add(int *ptr, int value)
inline int omp_get_thread_num() { return 0; }
inline int omp_get_max_threads() { return 1; }
inline void omp_set_num_threads(int num_threads) { return 1; }
inline int __sync_fetch_and_add(int *ptr, int value)
{
int tmp = *ptr;
ptr[0] += value;
Expand Down

0 comments on commit c0f644d

Please sign in to comment.