Skip to content

Commit

Permalink
fix precision issue #125
Browse files Browse the repository at this point in the history
  • Loading branch information
zeyiwen committed Feb 15, 2019
1 parent 640b7b0 commit a824a1a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/thundersvm/kernel/kernelmatrix_kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ namespace svm_kernel {
const float_type *coef1 = &coef_data[(j - 1) * total_sv];
const float_type *coef2 = &coef_data[i * total_sv];
const kernel_type *k_values = &k_mat_data[idx * total_sv];
kernel_type sum = 0;
double sum = 0;
#pragma omp parallel for reduction(+:sum)
for (int l = 0; l < ci; ++l) {
sum += coef1[si + l] * k_values[si + l];
Expand Down
2 changes: 1 addition & 1 deletion src/thundersvm/kernel/kernelmatrix_kernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ namespace svm_kernel {
const float_type *coef1 = &coef[(j - 1) * total_sv];
const float_type *coef2 = &coef[i * total_sv];
const kernel_type *k_values = &k_mat[idx * total_sv];
kernel_type sum = 0;
double sum = 0;
for (int l = 0; l < ci; ++l) {
sum += coef1[si + l] * k_values[si + l];
}
Expand Down

0 comments on commit a824a1a

Please sign in to comment.