added guard for offset calculations
added guard for offset calculations

ROCmSoftwarePlatform/MIOpen,ROCmSoftwarePlatform/MIOpen,ROCmSoftwarePlatform/MIOpen,ROCmSoftwarePlatform/MIOpen,ROCmSoftwarePlatform/MIOpen