Skip to content
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

fix accuracy cudamemset #5467

Merged

Conversation

typhoonzero
Copy link
Contributor

Fix #5452

@typhoonzero typhoonzero requested a review from reyoung November 8, 2017 05:04
@@ -14,6 +14,7 @@ limitations under the License. */

#include <thrust/execution_policy.h>
#include <thrust/reduce.h>
#include <iostream>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this line.

@@ -65,7 +66,8 @@ class AccuracyOpCUDAKernel : public framework::OpKernel<T> {

size_t num_samples = inference->dims()[0];
size_t infer_width = inference->dims()[1];
cudaMemset((void**)&accuracy_data, 0, sizeof(float));
cudaError_t e = cudaMemset(accuracy_data, 0, sizeof(float));
PADDLE_ENFORCE_EQ(0, e, "cudaMemset error");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PADDLE_ENFORCE(e);

Copy link
Contributor

@qingqing01 qingqing01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@typhoonzero typhoonzero merged commit 502d7da into PaddlePaddle:develop Nov 8, 2017
@typhoonzero typhoonzero deleted the fix_accuracy_cudamemset branch December 22, 2017 05:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants