-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add sger and dger. #18
Changes from all commits
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 |
---|---|---|
|
@@ -66,6 +66,26 @@ matmatTest1ZGEMV = do | |
resList <- Matrix.mutableVectorToList $ _bufferMutDenseVector res | ||
resList @?= [2.0,2.0] | ||
|
||
---- | ||
---- | ||
|
||
matmatTest1SGER :: IO () | ||
matmatTest1SGER = do | ||
res <- Matrix.generateMutableDenseMatrix (Matrix.SRow) (2,2) (\_ -> 1.0) | ||
x <- Matrix.generateMutableDenseVector 2 (\_ -> 2.0) | ||
y <- Matrix.generateMutableDenseVector 2 (\_ -> 3.0) | ||
BLAS.sger 2.0 x y res | ||
resList <- Matrix.mutableVectorToList $ _bufferDenMutMat res | ||
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. might be good to add a wee comment explaining Which does raise the realted point that we should probably put those formulae in the haddcoks somewhhere, but probably not in the tests or this PR 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. eg a= 2* (2*3) +1= 13 |
||
resList @?= [13.0,13.0,13.0,13.0] | ||
|
||
matmatTest1DGER :: IO () | ||
matmatTest1DGER = do | ||
res <- Matrix.generateMutableDenseMatrix (Matrix.SRow) (2,2) (\_ -> 1.0) | ||
x <- Matrix.generateMutableDenseVector 2 (\_ -> 2.0) | ||
y <- Matrix.generateMutableDenseVector 2 (\_ -> 3.0) | ||
BLAS.sger 2.0 x y res | ||
resList <- Matrix.mutableVectorToList $ _bufferDenMutMat res | ||
resList @?= [13.0,13.0,13.0,13.0] | ||
|
||
---- | ||
---- | ||
|
@@ -120,6 +140,8 @@ unitTestLevel2BLAS = testGroup "BLAS Level 2 tests " [ | |
,testCase "dtrsv on 2x2 upper 1s" matmatTest1DTRSV | ||
,testCase "ctrsv on 2x2 upper 1s" matmatTest1CTRSV | ||
,testCase "ztrsv on 2x2 upper 1s" matmatTest1ZTRSV | ||
|
||
---- ger tests | ||
,testCase "sger on 2x2 all 1s" matmatTest1SGER | ||
,testCase "dger on 2x2 all 1s" matmatTest1DGER | ||
] | ||
|
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.
@archblob derp, should this have been a
<=
instead? ie we should be calling the fast code IFm*n
is LESS thanflopsThreshold
? shows what I get for merging a PR before doing a close readingThere 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 haven't really looked at the code since the pr was done almost a year ago :-P. I just rebased and added some tests. Will take a look when I get home.
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, I think we should be calling the fast code IF mn is LESS(or LEQ) than flopsThreshold. But I think it is the same that we should be calling the fast code IF flopsThreshold is GREATER(or GEQ) than mn?
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're correct. It is correct as written. Fast is true when the product is
less than the threshold. Probably I should write a little helper
function to make it less confusing
On Thursday, May 7, 2015, Jueji Yang [email protected] wrote: