-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ginkgo ILU #1684
base: develop
Are you sure you want to change the base?
ginkgo ILU #1684
Changes from all commits
f6f90da
53f7259
7ee9c83
26e1292
2e47fa7
57c0051
a97eb6a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -183,7 +183,8 @@ struct device_sparsity_lookup { | |
result = lookup_search_unsafe(col); | ||
break; | ||
} | ||
GKO_ASSERT(local_cols[result] == col); | ||
GKO_ASSERT(result >= 0 && result < row_nnz && | ||
local_cols[result] == col); | ||
return result; | ||
} | ||
|
||
|
@@ -230,7 +231,8 @@ struct device_sparsity_lookup { | |
const auto out_idx = | ||
block_bases[block] + | ||
gko::detail::popcount(block_bitmaps[block] & prefix_mask); | ||
GKO_ASSERT(local_cols[out_idx] == col); | ||
GKO_ASSERT(out_idx >= 0 && out_idx < row_nnz && | ||
local_cols[out_idx] == col); | ||
return out_idx; | ||
} | ||
|
||
|
@@ -262,15 +264,17 @@ struct device_sparsity_lookup { | |
(static_cast<unsigned_index_type>(col) * hash_param) % hashmap_size; | ||
GKO_ASSERT(hashmap[hash] >= 0); | ||
GKO_ASSERT(hashmap[hash] < row_nnz); | ||
while (local_cols[hashmap[hash]] != col) { | ||
auto out_idx = hashmap[hash]; | ||
// linear probing with invalid_index sentinel to avoid infinite loop | ||
while (out_idx >= 0 && local_cols[out_idx] != col) { | ||
hash++; | ||
if (hash >= hashmap_size) { | ||
hash = 0; | ||
} | ||
GKO_ASSERT(hashmap[hash] >= 0); | ||
out_idx = hashmap[hash]; | ||
GKO_ASSERT(hashmap[hash] < row_nnz); | ||
} | ||
const auto out_idx = hashmap[hash]; | ||
// out_idx is either correct or invalid_index, the hashmap sentinel | ||
Comment on lines
+267
to
+277
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am confused here. With this change, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
return out_idx; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want to improve the strategy type with 2.0 (or earlier), and the strategies have no impact on triangular solvers, so I think we should avoid adding new strategy-related functionality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think 2.0 happens soon
if we do not want to introduce here, I can only unpack them by original code path not the unpack them.
@nbeams it should be fine, right? the unpacking codes are the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean revert back to before 57c0051? It should be fine, as far as I know. I tested it before this commit, anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.