File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 2222#include < vector>
2323
2424#ifdef _WIN32
25+ #define NOMINMAX
26+
2527#include < windows.h>
2628inline int ur_getpid (void ) { return static_cast <int >(GetCurrentProcessId ()); }
2729#else
@@ -59,7 +61,6 @@ inline int ur_getpid(void) { return static_cast<int>(getpid()); }
5961#endif
6062// /////////////////////////////////////////////////////////////////////////////
6163#if defined(_WIN32)
62- #include < Windows.h>
6364#define MAKE_LIBRARY_NAME (NAME, VERSION ) NAME " .dll"
6465#else
6566#define HMODULE void *
Original file line number Diff line number Diff line change 2323
2424#include < ur_api.h>
2525
26+ #include " ur_util.hpp"
27+
2628template <class To , class From > To ur_cast (From Value) {
2729 // TODO: see if more sanity checks are possible.
2830 assert (sizeof (From) == sizeof (To));
@@ -61,9 +63,10 @@ const ur_command_t UR_EXT_COMMAND_TYPE_USER =
6163// overhead from mutex locking. Default value is 0 which means that single
6264// thread mode is disabled.
6365static const bool SingleThreadMode = [] {
64- const char *UrRet = std::getenv (" UR_L0_SINGLE_THREAD_MODE" );
65- const char *PiRet = std::getenv (" SYCL_PI_LEVEL_ZERO_SINGLE_THREAD_MODE" );
66- const bool RetVal = UrRet ? std::stoi (UrRet) : (PiRet ? std::stoi (PiRet) : 0 );
66+ auto UrRet = ur_getenv (" UR_L0_SINGLE_THREAD_MODE" );
67+ auto PiRet = ur_getenv (" SYCL_PI_LEVEL_ZERO_SINGLE_THREAD_MODE" );
68+ const bool RetVal =
69+ UrRet ? std::stoi (*UrRet) : (PiRet ? std::stoi (*PiRet) : 0 );
6770 return RetVal;
6871}();
6972
You can’t perform that action at this time.
0 commit comments