File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ limitations under the License.
2222#include < cuda_runtime.h>
2323#include < cublas_v2.h>
2424
25- #define SCALING_EPSILON 1e-8
25+ #define SCALING_EPSILON 1e-12
2626
2727__global__ void scale_variables_kernel (double *__restrict__ objective_vector,
2828 double *__restrict__ variable_lower_bound,
@@ -425,7 +425,7 @@ __global__ void clamp_sqrt_and_accum_kernel(double *__restrict__ scaling_factors
425425 for (int t = blockIdx .x * blockDim .x + threadIdx .x ; t < num_variables; t += blockDim .x * gridDim .x )
426426 {
427427 double v = scaling_factors[t];
428- double s = sqrt ( fmax (v, SCALING_EPSILON));
428+ double s = (v < SCALING_EPSILON) ? 1.0 : sqrt (v );
429429 cumulative_rescaling[t] *= s;
430430 scaling_factors[t] = s;
431431 inverse_scaling_factors[t] = 1.0 / s;
You can’t perform that action at this time.
0 commit comments