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 22
22
#include < vector>
23
23
24
24
#ifdef _WIN32
25
+ #define NOMINMAX
26
+
25
27
#include < windows.h>
26
28
inline int ur_getpid (void ) { return static_cast <int >(GetCurrentProcessId ()); }
27
29
#else
@@ -59,7 +61,6 @@ inline int ur_getpid(void) { return static_cast<int>(getpid()); }
59
61
#endif
60
62
// /////////////////////////////////////////////////////////////////////////////
61
63
#if defined(_WIN32)
62
- #include < Windows.h>
63
64
#define MAKE_LIBRARY_NAME (NAME, VERSION ) NAME " .dll"
64
65
#else
65
66
#define HMODULE void *
Original file line number Diff line number Diff line change 23
23
24
24
#include < ur_api.h>
25
25
26
+ #include " ur_util.hpp"
27
+
26
28
template <class To , class From > To ur_cast (From Value) {
27
29
// TODO: see if more sanity checks are possible.
28
30
assert (sizeof (From) == sizeof (To));
@@ -61,9 +63,10 @@ const ur_command_t UR_EXT_COMMAND_TYPE_USER =
61
63
// overhead from mutex locking. Default value is 0 which means that single
62
64
// thread mode is disabled.
63
65
static 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 );
67
70
return RetVal;
68
71
}();
69
72
You can’t perform that action at this time.
0 commit comments