diff --git a/projects/clr/rocclr/runtime/device/rocm/roccompiler.cpp b/projects/clr/rocclr/runtime/device/rocm/roccompiler.cpp index e29adf0333..c094e473c9 100644 --- a/projects/clr/rocclr/runtime/device/rocm/roccompiler.cpp +++ b/projects/clr/rocclr/runtime/device/rocm/roccompiler.cpp @@ -196,8 +196,16 @@ HSAILProgram::compileImpl_LC( return false; } + // Set fp32-denormals and fp64-denormals + bool fp32Denormals = !options->oVariables->DenormsAreZero + && dev().deviceInfo().gfxipVersion_ >= 900; + + driverOptions.append(" -Xclang -target-feature -Xclang "); + driverOptions.append(fp32Denormals ? "+" : "-") + .append("fp32-denormals,+fp64-denormals"); + // Tokenize the options string into a vector of strings - std::istringstream istrstr(driverOptions + codegenOptions(options)); + std::istringstream istrstr(driverOptions); std::istream_iterator sit(istrstr), end; std::vector params(sit, end); diff --git a/projects/clr/rocclr/runtime/device/rocm/rocprogram.cpp b/projects/clr/rocclr/runtime/device/rocm/rocprogram.cpp index 0ad5db81d1..8347e0b44a 100644 --- a/projects/clr/rocclr/runtime/device/rocm/rocprogram.cpp +++ b/projects/clr/rocclr/runtime/device/rocm/rocprogram.cpp @@ -914,7 +914,7 @@ HSAILProgram::linkImpl_LC(amd::option::Options *options) codegenOptions.append(" ").append(optLevel.str()); // Tokenize the options string into a vector of strings - std::istringstream strstr(codegenOptions + this->codegenOptions(options)); + std::istringstream strstr(codegenOptions); std::istream_iterator sit(strstr), end; std::vector params(sit, end); @@ -1438,14 +1438,7 @@ HSAILProgram::codegenOptions(amd::option::Options* options) { std::string optionsStr; -#if defined(WITH_LIGHTNING_COMPILER) - bool fp32Denormals = !options->oVariables->DenormsAreZero - && dev().deviceInfo().gfxipVersion_ >= 900; - - optionsStr.append(" -Xclang -target-feature -Xclang "); - optionsStr.append(fp32Denormals ? "+" : "-") - .append("fp32-denormals,+fp64-denormals"); -#else // !defined(WITH_LIGHTNING_COMPILER) +#if !defined(WITH_LIGHTNING_COMPILER) if (dev().deviceInfo().gfxipVersion_ < 900) { optionsStr.append(" -cl-denorms-are-zero"); }