-
Notifications
You must be signed in to change notification settings - Fork 96
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
added example cpp: example_commit_with_device_memory_view() #532
Conversation
projective_t hL1{}, hL2{}, hR1{}, hR2{}; | ||
|
||
//Allocate memory on device (scalars) | ||
cudaMalloc(&L1c, sizeof(projective_t)), cudaMalloc(&R1c, sizeof(projective_t)); |
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.
(1) what is this ',' syntax? no need to ';'?
(2) you'd better use the CHK_IF_RETURN macro on cuda runtime calls to make sure they do not fail. You can see it in the codebase everywehre.
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.
removed memory allocs and let bn254msm api manage memory on device
cudaMalloc(&L2c, sizeof(projective_t)),cudaMalloc(&R2c, sizeof(projective_t)); | ||
|
||
//straightforward msm bn254 api: no batching | ||
bn254_msm_cuda(viewL1.get(),points_d,N,config,L1c); |
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 need to set the 'is_on_device' fields to true in the config since the coefffs and scalars are on 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.
set
config.are_points_on_device = true;
config.are_scalars_on_device = true;
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.
overall looks good but I wrote a few comments
Describe the changes
This PR...
Added an example for simple commit that makes use of polynomial views.
Output attached
Linked Issues
Resolves #