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 8526935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:24:47+00:00 2026-06-11T08:24:47+00:00

How do I use CUDA function in a cpp file? I must use a

  • 0

How do I use CUDA function in a cpp file?

I must use a CUDA function declared in “cuda.h” (or other cuda libraries), for example cudaMalloc. I know it is simple to do in .cu files but my project is extended, we decide call some CUDA functions in .cpp files.

I saw in the SDK some CUDA functions are called from main.cpp, so why is it not working for me? How do I configure CUDA with Visual Studio 2010?

The error is:

cudaMalloc identifier not found

and

undeclared identifier for size_t types

  • 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-11T08:24:49+00:00Added an answer on June 11, 2026 at 8:24 am

    You can call CUDA API calls from C/C++ compiled with cl.exe, just make sure you include the cuda.h header and link with cudart.lib.

    For more detailed instructions on setting up Visual Studio 2010, see this answer.

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

Sidebar

Related Questions

As far as I know I can use C++ templates in CUDA device code.
It it possible to use OpenMP pragmas in CUDA source files (not in kernel
i've a simple question , if for example i would like to use a
I want to use interoperability between OpenGL and CUDA. I know, as some tutorials
I use Emacs as an editor. Of late whenever I use CUDA files (which
I'm using CUBLAS (Cuda Blas libraries) for matrix operations. Is possible to use CUBLAS
I recently wanted to use a simple CUDA matrix-vector multiplication. I found a proper
Is there any minimum compute capability to use CUDA-OpenGL interoperability? I did not find
use C#,want to upload excel file on google doc. bellow syntax use to upload
I was following this: Dynamically allocating memory inside __device/global__ CUDA kernel But it still

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.