We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c0f1d3f commit 42ea205Copy full SHA for 42ea205
1 file changed
src/main_nep/snes.cu
@@ -451,7 +451,8 @@ static __global__ void gpu_find_L1_L2_NEP4(
451
s_cost_L2reg[tid] = 0.0f;
452
for (int v = tid; v < number_of_variables; v += blockDim.x) {
453
const float para = g_population[bid * number_of_variables + v];
454
- if (g_type_of_variable[v] == g_type || g_type == g_num_types) {
+ if ((g_type_of_variable[v] == g_type) && (g_type != g_num_types) ||
455
+ (g_type_of_variable[v] != g_type) && (g_type == g_num_types)) {
456
s_cost_L1reg[tid] += abs(para);
457
s_cost_L2reg[tid] += para * para;
458
}
0 commit comments