-
Notifications
You must be signed in to change notification settings - Fork 2
Added scal, copy, swap; Updated axpy #7
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
base: main
Are you sure you want to change the base?
Conversation
| y[global_i*incy] += a * x[global_i*incx] | ||
|
|
||
| else: |
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 this should cover both cases. If global_i < n, the for-loop terminates after the first iteration
| if (global_i < n): | ||
| y[global_i*incy] = x[global_i*incx] | ||
|
|
||
| else: |
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.
same here
| if (global_i < n): | ||
| x[global_i*incx] *= a | ||
|
|
||
| else: |
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.
and here
| x[global_i * incx] = y[global_i * incy] | ||
| y[global_i * incy] = tmp | ||
|
|
||
| else: |
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.
and here
axpy, scal, copy, and swap can support n > number of threads