diff --git a/rocclr/compiler/lib/utils/options.cpp b/rocclr/compiler/lib/utils/options.cpp index 9d05ed4c2f..d587faf017 100644 --- a/rocclr/compiler/lib/utils/options.cpp +++ b/rocclr/compiler/lib/utils/options.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include "options.hpp" diff --git a/rocclr/runtime/device/pal/palcompiler.cpp b/rocclr/runtime/device/pal/palcompiler.cpp index 3ef2f9b999..c3b8f21cd7 100644 --- a/rocclr/runtime/device/pal/palcompiler.cpp +++ b/rocclr/runtime/device/pal/palcompiler.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include "os/os.hpp" #include "device/pal/paldevice.hpp" @@ -242,9 +243,14 @@ LightningProgram::compileImpl( driverOptions.append(optLevel.str()); // Set the machine target +#if 0 std::ostringstream mCPU; mCPU << " -mcpu=gfx" << dev().hwInfo()->gfxipVersion_; driverOptions.append(mCPU.str()); +#else + driverOptions.append(" -mcpu="); + driverOptions.append(dev().hwInfo()->machineTarget_); +#endif driverOptions.append(options->llvmOptions); driverOptions.append(hsailOptions()); diff --git a/rocclr/runtime/device/pal/palkernel.cpp b/rocclr/runtime/device/pal/palkernel.cpp index 43e0cf277c..b639715f00 100644 --- a/rocclr/runtime/device/pal/palkernel.cpp +++ b/rocclr/runtime/device/pal/palkernel.cpp @@ -1440,8 +1440,6 @@ GetKernelAddrQual(const amd::hsa::code::KernelArg::Metadata& lcArg) static inline HSAIL_DATA_TYPE GetKernelDataType(const amd::hsa::code::KernelArg::Metadata& lcArg) { - aclArgDataType dataType; - if (lcArg.Kind() != AMDGPU::RuntimeMD::KernelArg::ByValue) { return HSAIL_DATATYPE_ERROR; } diff --git a/rocclr/runtime/device/pal/palprogram.cpp b/rocclr/runtime/device/pal/palprogram.cpp index f549db1516..8fe8796525 100644 --- a/rocclr/runtime/device/pal/palprogram.cpp +++ b/rocclr/runtime/device/pal/palprogram.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include "utils/options.hpp" #include "hsa.h" #include "hsa_ext_image.h" @@ -1205,9 +1206,14 @@ LightningProgram::linkImpl(amd::option::Options *options) std::string codegenOptions(options->llvmOptions); // Set the machine target +#if 0 std::ostringstream mCPU; mCPU << " -mcpu=gfx" << dev().hwInfo()->gfxipVersion_; codegenOptions.append(mCPU.str()); +#else + codegenOptions.append(" -mcpu="); + codegenOptions.append(dev().hwInfo()->machineTarget_); +#endif // Set the -O# std::ostringstream optLevel; diff --git a/rocclr/runtime/top.hpp b/rocclr/runtime/top.hpp index e2131f4403..5d1d9ba835 100644 --- a/rocclr/runtime/top.hpp +++ b/rocclr/runtime/top.hpp @@ -10,7 +10,46 @@ #endif /*ATI_ARCH_ARM*/ #ifdef _WIN32 -# define NOMINMAX 1 +// Disable unneeded features of for efficiency. +# define NOGDICAPMASKS +# define NOVIRTUALKEYCODES +# define NOWINMESSAGES +# define NOWINSTYLES +# define NOSYSMETRICS +# define NOMENUS +# define NOICONS +# define NOKEYSTATES +# define NOSYSCOMMANDS +# define NORASTEROPS +# define NOSHOWWINDOW +# define OEMRESOURCE +# define NOATOM +# define NOCLIPBOARD +# define NOCOLOR +# define NOCTLMGR +# define NODRAWTEXT +# define NOGDI +# define NOKERNEL +# define NOMB +# define NOMEMMGR +# define NOMETAFILE +# define NOMINMAX +# define NOOPENFILE +# define NOSCROLL +# define NOSERVICE +# define NOSOUND +# define NOTEXTMETRIC +# define NOWH +# define NOWINOFFSETS +# define NOCOMM +# define NOKANJI +# define NOHELP +# define NOPROFILER +# define NODEFERWINDOWPOS +# define NOMCX +# ifndef NOCRYPT +# define NOCRYPT +# endif # define WIN32_LEAN_AND_MEAN 1 #endif /*_WIN32*/ @@ -50,7 +89,9 @@ typedef __int32 ssize_t; #ifdef _WIN32 # define SIZE_T_FMT "%Iu" # define PTR_FMT "0x%p" -# define snprintf sprintf_s +# if _MSC_VER < 1900 +# define snprintf sprintf_s +# endif #else /*!_WIN32*/ # define SIZE_T_FMT "%zu" # define PTR_FMT "%p"