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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:31:21+00:00 2026-06-11T04:31:21+00:00

I have developed a C++ DLL in windows which has many CUDA accelerated functions.

  • 0

I have developed a C++ DLL in windows which has many CUDA accelerated functions.
Currently i haven’t created the DllMain function as it is not mandatory.

I know that there are many limitations on the functions that can be called in the DllMain.

I just want to know that is it safe to call a CUDA Runtime function in DllMain just to initialize the default context, so that the subsequent CUDA calls are faster?

I’m using Visual Studio 2008, CUDA 5.0 and Windows 8 for development.

  • 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-11T04:31:23+00:00Added an answer on June 11, 2026 at 4:31 am

    Reading the DLLMain documentation, I would advise against it. From the docs:

    Warning There are serious limits on what you can do in a DLL entry point. To provide more complex initialization, create an initialization routine for the DLL. You can require applications to call the initialization routine before calling any other routines in the DLL.

    More specifically:

    Calling functions that require DLLs other than Kernel32.dll may result in problems that are difficult to diagnose.

    Since the CUDA Runtime API requires cudart.dll, this applies to your question.

    So I would create an initialization function for your library that does CUDA initialization, and require it to be called explicitly at application startup.

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

Sidebar

Related Questions

I have created a windows application which makes use of Office.dll and PowerPoint dlls
I have a solution consisting of about 10 important DLL files which are developed
I have developed several general purpose script functions, for Google Spreadsheet apps. Currently I
I have an R script which was developed in Windows, and which requires a
I have developed a small administration page for game servers which you can add/remove/edit
i have developed an app which executes sql jobs. When I click on execute
I have developed an app that in testing has worked fine but when it
I have an application which I have managed to keep reasonably cross-platform between windows
I have developed a windows application via .NET 3.5 and now I want to
My core project which is a standard windows application is being developed under C++

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.