Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions common.h
Original file line number Diff line number Diff line change
Expand Up @@ -362,18 +362,6 @@ typedef int blasint;
#define MAX_CPU_NUMBER 2
#endif

#if defined(OS_SUNOS)
#define YIELDING thr_yield()
#endif

#if defined(OS_WINDOWS)
#if defined(_MSC_VER) && !defined(__clang__)
#define YIELDING YieldProcessor()
#else
#define YIELDING SwitchToThread()
#endif
#endif

#if defined(ARMV7) || defined(ARMV6) || defined(ARMV8) || defined(ARMV5)
#define YIELDING __asm__ __volatile__ ("nop;nop;nop;nop;nop;nop;nop;nop; \n");
#endif
Expand All @@ -398,14 +386,26 @@ typedef int blasint;
#endif
#endif


#ifdef __EMSCRIPTEN__
#define YIELDING
#endif

#if defined(_MSC_VER) && !defined(__clang__)
#undef YIELDING // MSVC doesn't support assembly code
#define YIELDING YieldProcessor()
#endif

#ifndef YIELDING
#if defined(OS_SUNOS)
#define YIELDING thr_yield()

#elif defined(OS_WINDOWS)
#define YIELDING SwitchToThread()

#else // assume POSIX.1-2008
#define YIELDING sched_yield()
#endif
#endif

/***
To alloc job_t on heap or stack.
Expand Down
Loading