diff --git a/projects/clr/rocclr/runtime/device/pal/palprogram.cpp b/projects/clr/rocclr/runtime/device/pal/palprogram.cpp index 53c3b4db1d..4979cb9e57 100644 --- a/projects/clr/rocclr/runtime/device/pal/palprogram.cpp +++ b/projects/clr/rocclr/runtime/device/pal/palprogram.cpp @@ -1382,8 +1382,9 @@ bool LightningProgram::linkImpl(amd::option::Options* options) { Data* correctly_rounded_sqrt_bc = C->NewBufferReference(DT_LLVM_BC, correctly_rounded_sqrt.first, correctly_rounded_sqrt.second); - auto daz_opt = - get_oclc_daz_opt(dev().hwInfo()->gfxipVersion_ < 900 || options->oVariables->DenormsAreZero); + auto daz_opt = get_oclc_daz_opt(!AMD_GPU_FORCE_SINGLE_FP_DENORM && + (dev().hwInfo()->gfxipVersion_ < 900 || + options->oVariables->DenormsAreZero)); Data* daz_opt_bc = C->NewBufferReference(DT_LLVM_BC, daz_opt.first, daz_opt.second); auto finite_only = get_oclc_finite_only(options->oVariables->FiniteMathOnly || @@ -1394,12 +1395,6 @@ bool LightningProgram::linkImpl(amd::option::Options* options) { options->oVariables->FastRelaxedMath); Data* unsafe_math_bc = C->NewBufferReference(DT_LLVM_BC, unsafe_math.first, unsafe_math.second); - if (!correctly_rounded_sqrt_bc || !daz_opt_bc || !finite_only_bc || !unsafe_math_bc) { - buildLog_ += "Error: Failed to open the control functions.\n"; - return false; - } - - if (!correctly_rounded_sqrt_bc || !daz_opt_bc || !finite_only_bc || !unsafe_math_bc) { buildLog_ += "Error: Failed to open the control functions.\n"; return false; diff --git a/projects/clr/rocclr/runtime/device/rocm/rocprogram.cpp b/projects/clr/rocclr/runtime/device/rocm/rocprogram.cpp index 6923762380..1ac7a60e42 100644 --- a/projects/clr/rocclr/runtime/device/rocm/rocprogram.cpp +++ b/projects/clr/rocclr/runtime/device/rocm/rocprogram.cpp @@ -678,8 +678,9 @@ bool HSAILProgram::linkImpl_LC(amd::option::Options* options) { Data* correctly_rounded_sqrt_bc = C->NewBufferReference(DT_LLVM_BC, correctly_rounded_sqrt.first, correctly_rounded_sqrt.second); - auto daz_opt = get_oclc_daz_opt(dev().deviceInfo().gfxipVersion_ < 900 || - options->oVariables->DenormsAreZero); + auto daz_opt = get_oclc_daz_opt(!AMD_GPU_FORCE_SINGLE_FP_DENORM && + (dev().deviceInfo().gfxipVersion_ < 900 || + options->oVariables->DenormsAreZero)); Data* daz_opt_bc = C->NewBufferReference(DT_LLVM_BC, daz_opt.first, daz_opt.second); auto finite_only = get_oclc_finite_only(options->oVariables->FiniteMathOnly ||