-
Notifications
You must be signed in to change notification settings - Fork 3
Track updated status for each vector in multivector (third attempt) #314
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
Conversation
…implementation.- Hacked to restore previous behavior.- All tests pass, error messages printed where undesired behavior occurs.
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.
Looks good. I made some minor semantic comments. Tests pass.
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.
See comments
@@ -33,33 +34,37 @@ namespace ReSolve { namespace vector { | |||
int copyDataFrom(const real_type* data, memory::MemorySpace memspaceIn, memory::MemorySpace memspaceOut); | |||
int copyDataFrom(Vector* v, memory::MemorySpace memspaceIn, memory::MemorySpace memspaceOut); | |||
real_type* getData(memory::MemorySpace memspace); | |||
real_type* getData(index_type i, memory::MemorySpace memspace); // get pointer to i-th vector in multivector | |||
real_type* getData(index_type i, memory::MemorySpace memspace); |
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.
what was wrong with this comment :D
@@ -234,7 +234,7 @@ namespace ReSolve { | |||
using namespace constants; | |||
|
|||
if (k < 200) { | |||
hip::mass_inner_product_two_vectors(size, k, x->getData(memory::DEVICE) , x->getData(1, memory::DEVICE), V->getData(memory::DEVICE), res->getData(memory::DEVICE)); | |||
hip::mass_inner_product_two_vectors(size, k, x->getData(0, memory::DEVICE) , x->getData(1, memory::DEVICE), V->getData(memory::DEVICE), res->getData(memory::DEVICE)); |
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.
Code formatting is totally wrong here.
Description
Vector
class object is a multivector that allows access to individual vectors separately. It is plausible to expect that individual vectors could be updated individually and some of them may have device, while others may have host memory space updated. However, current implementation of theVector
class allows only for setting update flags for all vectors together, regardless of how they are accessed and updated. This is a bug, see #259.@superwhiskers
Proposed changes
This PR provides following:
syncData
overload to sync only one vector in multivector object. ClosesVector::getData
function incorrectly syncs memory spaces. #259.setToZero
andsetToConst
methods. Closes Vector initialization functions do not set "updated" flags correctly #216.GramSchmidt
class where multi vector view was set to a wrong size.getVectorData
function.Checklist
-Wall -Wpedantic -Wconversion -Wextra
.Further comments
This PR supersede #278.