Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8873311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:26:03+00:00 2026-06-14T18:26:03+00:00

Which header file to be included for following code snippet to measure time using

  • 0

Which header file to be included for following code snippet to measure time using cuda event mathods?

cudaEvent_t start,stop;
cudaEventCreate(&start);
cudaEventCreate(&stop);
float Elapsed=0,Cycle;

for (int p=1; p<=MSG_NUM; p++)
{ 
    cudaEventRecord(start,0);

    add<<<R, (M+R), (M+R)* sizeof(int)>>>( d_msg, d_checkSumArray ); 

    cudaEventRecord(stop,0);
    cudaEventSynchronize(stop);
    cudaElapsedTime(&Cycle,start,stop);
    Elapsed += Cycle;
}

printf("Time = %f",Elapsed);

My program show following error as no header file included.

error : identifier “cudaElapsedTime” is undefined

Can someone give the solution please?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T18:26:04+00:00Added an answer on June 14, 2026 at 6:26 pm

    The correct API call is cudaEventElapsedTime(…).

    Other than that your parameters look correct.

    You don’t need any special include headers if you are compiling with nvcc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the following jQuery in my header.php file, which is remotely included
I have a header.html which start with session_start();. Then the following code, $_SESSION['cart'][$sw_id] is
I created 2 C program source code files and one header file which just
Following the post , if I have header file,which has some functions implementations in
I have a class which defines the following members in a header file (.hpp):
I have the following code which works as expected: #include <iostream> using namespace std;
I have a xml file which has the following header: <?xml version=1.1 encoding=UTF-8?> .
I created a header file called ofdm.h which includes all the function prototypes. Then
I want to reimplement a library of which I have the header file. I
Assume I've declared a function (or class, doesn't matter) in a header file, which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.